Class FallbackExecutionAnalyzer
- java.lang.Object
-
- de.xima.fc.workflow.processor.logic.analysis.FallbackExecutionAnalyzer
-
- All Implemented Interfaces:
IWorkflowNodeFlowAnalyzer<Object>
public final class FallbackExecutionAnalyzer extends Object implements IWorkflowNodeFlowAnalyzer<Object>
Fallback execution analyzer when no logic handler could be found for a node. Attempts to supply a somewhat sane default that does not break the rest of the workflow, but no guarantees are made as to what this returns.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <TElement extends IWorkflowNodeTypeProviding & IActiveFlagProviding>
IFlowGraphEndPointscreateFlowGraph(ICreateFlowGraphParams<Object,TElement> params)
This method is used to create the flow graph that represents the control flow of a workflow task, and to determine the end points of the node when executed.static <TData> IWorkflowNodeFlowAnalyzer<TData>
getInstance()
-
-
-
Method Detail
-
getInstance
public static <TData> IWorkflowNodeFlowAnalyzer<TData> getInstance()
- Type Parameters:
TData
- Type of the workflow element's properties model.- Returns:
- The immutable instance of the fallback execution analyzer.
-
createFlowGraph
public <TElement extends IWorkflowNodeTypeProviding & IActiveFlagProviding> IFlowGraphEndPoints createFlowGraph(ICreateFlowGraphParams<Object,TElement> params) throws WorkflowAnalysisException
Description copied from interface:IWorkflowNodeFlowAnalyzer
This method is used to create the flow graph that represents the control flow of a workflow task, and to determine the end points of the node when executed. A flow graph constructed by the workflow engine and used for the purpose of deriving statements about the runtime behavior of the program represented by a workflow task with a root node.See below for details on how to construct a flow graph. However, note that unless you are creating a new custom flow control node, you should use on of the existing mixins that matches the type of node you are creating:
IExecutingLikeActionNode
for normal business actions that execute some logic and have no children.IExecutingLikeBinarySelectionNode
for custom conditions that behave like an if-else statement.IExecutingLikeControlTransferNode
for custom control transfer actions such as break or continue statements (you will rarely need this).IExecutingLikeExceptionHandlerNode
for custom error handlers that behave like a try-catch-finally statement.IExecutingLikeMultiSwitchNode
for custom conditions that behave like switch-case-default statement.IExecutingLikePostTestLoopNode
for custom loops that behave like a do-while-loop.IExecutingLikePreTestLoopNode
for custom loops that behave like a while-loop.IExecutingLikeReturningActionNode
for custom end points that can both throw an exception and end a processing chain by returning.IExecutingLikeReturnNode
for custom end points that always return and never throw an exception.IExecutingLikeSequenceNode
for custom block statements that never throw and execute their children in order (you will rarely need this).IExecutingLikeThrowNode
for custom throw statements that can never complete normally and always throw an error.
The flow graph is a directed graph. Each node in the control flow graph is either
- a real node that corresponds to a
WorkflowNode
; or - a
virtual
nodeowned
and created by a real node
FlowGraphConnectionType
. Virtual nodes are often used to model complex control transfers involving conversion between completion types, such as try-finally blocks.Regarding end points, see the documentation of
Normal
,Throwing
, andControlTransfer
for more details.This method is not pure and must have side-effects. It is responsible for
- calling
createFlowGraph
(or one of its variants) on all of its children (if applicable); - calling
connect
(or one of its variants); and - returning the set of normal and throwing end points of the node.
This method must return the set of all nodes (including the children, grand-children etc. of this node) that represent the normal and throwing end points when the node is executed. These throwing end points are used for connecting this node to other siblings and parents. See the documentation of the sub classes of
FlowGraphEndPoint
for more details.- Specified by:
createFlowGraph
in interfaceIWorkflowNodeFlowAnalyzer<Object>
- Type Parameters:
TElement
- The type of the node elements on which the analysis is performed. This type may be different depending on whether the analysis is performed on the backend data modelWorkflowNode
or the frontend view model.- Parameters:
params
- The node to analyze and the current analysis context.- Returns:
- The set of all end points of the given node. Use
ICreateFlowGraphContext#endPoints
and its variants to create this return value. See the documentation ofgetNormalEndPoints
andgetThrowingEndPoints
for more details. - Throws:
WorkflowAnalysisException
- May be thrown when an unhandled exception occurred during the analysis. If this exception is thrown, the entire analysis is cancelled and the exception is propagated up. You should only throw this exception yourself if encountering an illegal state that would render the analysis invalid.
-
-