Author: mattmann
Date: Sun Oct 7 17:49:46 2012
New Revision: 1395349
URL: http://svn.apache.org/viewvc?rev=1395349&view=rev
Log:
- fix for OODT-516: Add WorkflowLifecycle tests that check pctComplete for
wengine and w1 style lifecycles
- set the stage if it's not already set
Modified:
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowLifecycleManager.java
Modified:
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowLifecycleManager.java
URL:
http://svn.apache.org/viewvc/oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowLifecycleManager.java?rev=1395349&r1=1395348&r2=1395349&view=diff
==============================================================================
---
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowLifecycleManager.java
(original)
+++
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowLifecycleManager.java
Sun Oct 7 17:49:46 2012
@@ -212,9 +212,16 @@ public class WorkflowLifecycleManager {
*/
public int getLastCompletedStageNum(WorkflowInstance inst) {
int currStageNum = getStageNum(inst);
+ if(inst.getState().getCategory() == null){
+ WorkflowLifecycleStage category = null;
+ if((category = getStage(inst)) != null){
+ inst.getState().setCategory(category);
+ }
+ }
+
if ((inst.getStatus().equals(WorkflowStatus.FINISHED) ||
- (inst.getState().getCategory() != null &&
- inst.getState().getCategory().getName().equals("done")))
+ inst.getState().getCategory() != null &&
+ inst.getState().getCategory().getName().equals("done"))
&& currStageNum == getNumStages(inst.getWorkflow())) {
return currStageNum;
} else