com.dtolabs.rundeck.core.execution.workflow
Class BaseWorkflowStrategy

java.lang.Object
  extended by com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowStrategy
All Implemented Interfaces:
WorkflowExecutor, WorkflowStrategy
Direct Known Subclasses:
NodeFirstWorkflowStrategy, StepFirstWorkflowStrategy

public abstract class BaseWorkflowStrategy
extends java.lang.Object
implements WorkflowStrategy

BaseWorkflowStrategy is ...


Field Summary
 
Fields inherited from interface com.dtolabs.rundeck.core.execution.workflow.WorkflowStrategy
NODE_FIRST, STEP_FIRST
 
Constructor Summary
BaseWorkflowStrategy(Framework framework)
           
 
Method Summary
protected  java.util.Map<java.lang.String,java.util.Collection<StepExecutionResult>> convertFailures(java.util.Map<java.lang.Integer,StepExecutionResult> failedMap)
          Convert map of step execution results keyed by step number, to a collection of step execution results keyed by node name
protected  StepExecutionResult executeWFItem(StepExecutionContext executionContext, java.util.Map<java.lang.Integer,StepExecutionResult> failedMap, int c, StepExecutionItem cmd)
          Execute a workflow item, returns true if the item succeeds.
 WorkflowExecutionResult executeWorkflow(StepExecutionContext executionContext, WorkflowExecutionItem item)
           
abstract  WorkflowExecutionResult executeWorkflowImpl(StepExecutionContext executionContext, WorkflowExecutionItem item)
           
protected  boolean executeWorkflowItemsForNodeSet(StepExecutionContext executionContext, java.util.Map<java.lang.Integer,StepExecutionResult> failedMap, java.util.List<StepExecutionResult> resultList, java.util.List<StepExecutionItem> iWorkflowCmdItems, boolean keepgoing)
          Execute the sequence of ExecutionItems within the context, and with the given keepgoing value, return true if successful
protected  boolean executeWorkflowItemsForNodeSet(StepExecutionContext executionContext, java.util.Map<java.lang.Integer,StepExecutionResult> failedMap, java.util.List<StepExecutionResult> resultList, java.util.List<StepExecutionItem> iWorkflowCmdItems, boolean keepgoing, int beginStepIndex)
          Execute the sequence of ExecutionItems within the context, and with the given keepgoing value, return true if successful
protected  WorkflowExecutionListener getWorkflowListener(ExecutionContext executionContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseWorkflowStrategy

public BaseWorkflowStrategy(Framework framework)
Method Detail

executeWorkflow

public final WorkflowExecutionResult executeWorkflow(StepExecutionContext executionContext,
                                                     WorkflowExecutionItem item)
Specified by:
executeWorkflow in interface WorkflowExecutor

getWorkflowListener

protected WorkflowExecutionListener getWorkflowListener(ExecutionContext executionContext)

executeWorkflowImpl

public abstract WorkflowExecutionResult executeWorkflowImpl(StepExecutionContext executionContext,
                                                            WorkflowExecutionItem item)

executeWFItem

protected StepExecutionResult executeWFItem(StepExecutionContext executionContext,
                                            java.util.Map<java.lang.Integer,StepExecutionResult> failedMap,
                                            int c,
                                            StepExecutionItem cmd)
Execute a workflow item, returns true if the item succeeds. This method will throw an exception if the workflow item fails and the Workflow is has keepgoing==false.

Parameters:
failedMap - List to add any messages if the item fails
c - index of the WF item
cmd - WF item descriptor
Returns:
true if the execution succeeds, false otherwise

executeWorkflowItemsForNodeSet

protected boolean executeWorkflowItemsForNodeSet(StepExecutionContext executionContext,
                                                 java.util.Map<java.lang.Integer,StepExecutionResult> failedMap,
                                                 java.util.List<StepExecutionResult> resultList,
                                                 java.util.List<StepExecutionItem> iWorkflowCmdItems,
                                                 boolean keepgoing)
Execute the sequence of ExecutionItems within the context, and with the given keepgoing value, return true if successful


executeWorkflowItemsForNodeSet

protected boolean executeWorkflowItemsForNodeSet(StepExecutionContext executionContext,
                                                 java.util.Map<java.lang.Integer,StepExecutionResult> failedMap,
                                                 java.util.List<StepExecutionResult> resultList,
                                                 java.util.List<StepExecutionItem> iWorkflowCmdItems,
                                                 boolean keepgoing,
                                                 int beginStepIndex)
Execute the sequence of ExecutionItems within the context, and with the given keepgoing value, return true if successful


convertFailures

protected java.util.Map<java.lang.String,java.util.Collection<StepExecutionResult>> convertFailures(java.util.Map<java.lang.Integer,StepExecutionResult> failedMap)
Convert map of step execution results keyed by step number, to a collection of step execution results keyed by node name