Interface IWorkflowExecutor
-
public interface IWorkflowExecutor
Handler for running other nodes during the execution of a task, or triggering events.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description INormalCompletionResult
execute(WorkflowNode node)
Executes the given node.INormalCompletionResult
executeChild(WorkflowNode parentNode, int childIndex)
Executes the given child of the node.List<IWorkflowQueueItem>
triggerEvent(IWorkflowEventData event, EWorkflowEventLoopTiming timing)
Triggers the given event.
-
-
-
Method Detail
-
execute
@Nullable INormalCompletionResult execute(WorkflowNode node) throws AbstractAbruptCompletionException, ExecutionAbortedException
Executes the given node. This should be used by workflow nodes that contain children, such as condition or try-catch nodes.Loops may be allowed to a certain extent - but execution may be terminated when a certain limit (instruction count or time-based) is reached.
Please note that you should usually NOT catch any exception other than
NodeThrewException
.- Parameters:
node
- The node to execute.- Returns:
- The result returned by the given node. In case the execution of the node was skipped (such as because the
node is not active),
null
is returned. - Throws:
AbstractAbruptCompletionException
- When the node failed to execute, see below.NodeThrewException
- If this exception was thrown by theINodeHandler.execute(de.xima.fc.interfaces.workflow.params.INodeExecutionParams)
method of the given node.NodeReturnedException
- If this exception was thrown by theINodeHandler.execute(de.xima.fc.interfaces.workflow.params.INodeExecutionParams)
method of the given node.ExecutionAbortedException
- When the execution of the task was aborted, such as when certain limits were exceeded. Usually you should not catch this exception and allow it to propagate upwards.
-
executeChild
@Nullable INormalCompletionResult executeChild(WorkflowNode parentNode, int childIndex) throws AbstractAbruptCompletionException, ExecutionAbortedException
Executes the given child of the node. This should be used by workflow nodes that contain children, such as condition or try-catch nodes.Loops may be allowed to a certain extent - but execution may be terminated when a certain limit (instruction count or time-based) is reached.
Please note that you should usually NOT catch any exception other than
NodeThrewException
.- Parameters:
parentNode
- A node with one or more children.childIndex
- 0-based index of the child to execute- Returns:
- The result returned by the given node. In case the execution of the node was skipped (such as because the
node is not active),
null
is returned. - Throws:
AbstractAbruptCompletionException
- When the node failed to execute, see below.NodeThrewException
- If this exception was thrown by theINodeHandler.execute(de.xima.fc.interfaces.workflow.params.INodeExecutionParams)
method of the given node.NodeReturnedException
- If this exception was thrown by theINodeHandler.execute(de.xima.fc.interfaces.workflow.params.INodeExecutionParams)
method of the given node.ExecutionAbortedException
- When the execution of the task was aborted, such as when certain limits were exceeded. Usually you should not catch this exception and allow it to propagate upwards.
-
triggerEvent
List<IWorkflowQueueItem> triggerEvent(IWorkflowEventData event, EWorkflowEventLoopTiming timing) throws WorkflowEventRunnerException
Triggers the given event. This method returns immediately, the tasks are run either after the current task is done, or after all tasks are done, depending on the giventiming
value.The given event should either
IFormRecordProvidingEvent
or otherwise make sure it applies only to the current form record that is being processed.The given events are assumed to have occurred simultaneously. Therefore, when a multiple triggers of a task react to the given events, the task is run only once.
- Parameters:
event
- Events that has occurred.timing
- Whether the events should be processed immediately, or later.- Returns:
- A list of all workflow tasks that were added to the event queue.
- Throws:
WorkflowEventRunnerException
- When the event could not be added to the queue, such as due to a database failure when trying to find matching tasks etc. Also thrown when the event applies to a form record different from the one currently being processed.
-
-