tassl.workflow
Class Workflow

java.lang.Object
  extended by tassl.workflow.Workflow

public class Workflow
extends java.lang.Object


Constructor Summary
Workflow(java.util.HashMap<java.lang.String,WorkflowStage> stages)
           
 
Method Summary
 boolean addStages(java.util.HashMap<java.lang.String,WorkflowStage> stages)
          Add stages to the workflow
 void cancelWorkflow()
           
 java.util.List<java.lang.String> getCompletedStages()
           
 java.util.List<WorkflowStage> getExecutableStages()
           
 java.lang.String getId()
           
 java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> getLoops()
           
 java.util.List<java.lang.String> getLoopsOrder()
           
 java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> getLoopsOrigName()
           
 java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> getNestedLoops()
           
 int getNumCompletedStages()
           
 int getNumStages()
           
 java.lang.String getResultList()
           
 WorkflowStage getStage(java.lang.String stageId)
           
 java.util.HashMap<java.lang.String,WorkflowStage> getWorkflowStages()
          Get stages that compose the workflow
 boolean isDone()
           
 boolean isEndLoop(java.lang.String stageId)
          Check if stage id is the end of a loop
 boolean isWorkflowCanceled()
          Return true if workflow is canceled and false otherwise
 void newIteration(java.lang.String stageIdendLoop)
          Create new iteration of a loop
 void prepareForOuterLoop(java.lang.String stageIdendLoop)
          Prepare inner loop for the next iteration of its outer loop
 void renameStages(java.util.HashMap<java.lang.String,WorkflowStage> wflStages, java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> loopsToUpdate, boolean newIteration)
          Rename all newly created stages, create forwardList for new stages add stages to workflow and link all
 void setForwardList(java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> forwardList)
           
 void setId(java.lang.String id)
          Set Workflow id and propagate it to the stages
 void setLoops(java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> loops)
           
 void setLoopsOrder(java.util.List<java.lang.String> loopsOrder)
           
 void setNestedLoops(java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> nestedLoops)
           
 void setStageDone(java.lang.String stageId)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Workflow

public Workflow(java.util.HashMap<java.lang.String,WorkflowStage> stages)
         throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException
Method Detail

setId

public void setId(java.lang.String id)
Set Workflow id and propagate it to the stages

Parameters:
id -

cancelWorkflow

public void cancelWorkflow()

isWorkflowCanceled

public boolean isWorkflowCanceled()
Return true if workflow is canceled and false otherwise

Returns:

setForwardList

public void setForwardList(java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> forwardList)

setLoops

public void setLoops(java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> loops)

setLoopsOrder

public void setLoopsOrder(java.util.List<java.lang.String> loopsOrder)

setNestedLoops

public void setNestedLoops(java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> nestedLoops)

getLoopsOrigName

public java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> getLoopsOrigName()

getNestedLoops

public java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> getNestedLoops()

getLoopsOrder

public java.util.List<java.lang.String> getLoopsOrder()

getId

public java.lang.String getId()

setStageDone

public void setStageDone(java.lang.String stageId)

isEndLoop

public boolean isEndLoop(java.lang.String stageId)
Check if stage id is the end of a loop

Parameters:
stageId -
Returns:

getLoops

public java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> getLoops()

isDone

public boolean isDone()

getStage

public WorkflowStage getStage(java.lang.String stageId)

getNumStages

public int getNumStages()

getNumCompletedStages

public int getNumCompletedStages()

getCompletedStages

public java.util.List<java.lang.String> getCompletedStages()

getExecutableStages

public java.util.List<WorkflowStage> getExecutableStages()

getResultList

public java.lang.String getResultList()

getWorkflowStages

public java.util.HashMap<java.lang.String,WorkflowStage> getWorkflowStages()
Get stages that compose the workflow

Returns:
Stages

addStages

public boolean addStages(java.util.HashMap<java.lang.String,WorkflowStage> stages)
Add stages to the workflow

Parameters:
stages -
Returns:
true or false. False status is reached when there are some stage with the same id of existing ones.

newIteration

public void newIteration(java.lang.String stageIdendLoop)
Create new iteration of a loop

Parameters:
stageIdendLoop - Identifies the loop, but the name of the last stage of last iteration until now

renameStages

public void renameStages(java.util.HashMap<java.lang.String,WorkflowStage> wflStages,
                         java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> loopsToUpdate,
                         boolean newIteration)
Rename all newly created stages, create forwardList for new stages add stages to workflow and link all

Parameters:
wflStages -
loopsToUpdate -
newIteration -

prepareForOuterLoop

public void prepareForOuterLoop(java.lang.String stageIdendLoop)
Prepare inner loop for the next iteration of its outer loop

Parameters:
stageIdendLoop - identify loop, (original name)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object