Interface IExecutingLikeMultiSwitchNode<TData>
-
- Type Parameters:
TData- Type of the node's properties model.
- All Superinterfaces:
ICustomParametersUpdateable,IElementHandler<TData,WorkflowNode>,IExecutionResultDescriptor,INodeHandler<TData>,IRefinedExecutionResultDescriptor<TData>,IResourceBundleLocator,IWorkflowElementTypeProviding,IWorkflowNodeFlowAnalyzer<TData>,IWorkflowNodeTypeProviding
- All Known Implementing Classes:
FcSwitchHandler
public interface IExecutingLikeMultiSwitchNode<TData> extends INodeHandler<TData>
Mixin with the implementation ofcreateFlowGraphfornode handlersthat execute their children like a switch statement. A switch node has one or more children. The default switch case is located at acertain index, the other children are normal switch cases with a condition. A switch case is executed when it matches the switch condition. Multiple switch cases can be executed when multiple cases match. When no case matches, the default case is executed.- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from interface de.xima.fc.interfaces.workflow.elements.IElementHandler
CURRENT_HANDLER_VERSION
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <TElement extends IWorkflowNodeTypeProviding & IActiveFlagProviding>
IFlowGraphEndPointscreateFlowGraph(ICreateFlowGraphParams<TData,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.default intfindNextSwitchCaseIndex(int switchCaseIndex, int currentIndex, int childCount)It may be possible that multiple switch cases are matching.intgetDefaultCaseChildIndex()-
Methods inherited from interface de.xima.fc.interfaces.workflow.ICustomParametersUpdateable
updateCustomParams
-
Methods inherited from interface de.xima.fc.interfaces.workflow.elements.IElementHandler
extractDescription, extractName, extractSearchTerms, getCascadingStyleSheet, getCascadingStyleSheet, getDataModelClass, getDisplayLabel, getElementSummaryModel, getElementSummaryXhtml, getFastJsonConverter, getFilterCriteriaForEntities, getHelpPageLocation, getJavaScript, getJavaScript, getPropertiesViewXhtml, getResourceBundle, getVersion, isAvailable, isHasUserVisibleName, readEntityReferences, readPlaceholders, validateGlobal, validateLocal, writeEntityReferences, writePlaceholders
-
Methods inherited from interface de.xima.fc.interfaces.workflow.execution.IExecutionResultDescriptor
getAlwaysValueDescriptor, getAttachmentValueDescriptor, getCurrentAttachmentValueDescriptor, getCurrentFileValueDescriptor, getCurrentValueDescriptor, getErrorValueDescriptor, getFileValueDescriptor, getSoftErrorValueDescriptor, getSuccessValueDescriptor
-
Methods inherited from interface de.xima.fc.interfaces.workflow.nodes.INodeHandler
execute, getLocalizedTypeName, getNodePrototypes, getPropertiesBeanClass, getRelatedNodeTypes, getSupportedControlTransferTypes, isCreateProtocolEntryAfterExecution, isCreateProtocolEntryAfterExecution, isReplacePlaceholderBeforeExecution
-
Methods inherited from interface de.xima.fc.interfaces.workflow.execution.IRefinedExecutionResultDescriptor
getAlwaysValueDescriptor, getAttachmentValueDescriptor, getCurrentAttachmentValueDescriptor, getCurrentFileValueDescriptor, getCurrentValueDescriptor, getErrorValueDescriptor, getFileValueDescriptor, getSoftErrorValueDescriptor, getSuccessValueDescriptor
-
Methods inherited from interface de.xima.fc.interfaces.workflow.IWorkflowElementTypeProviding
getType
-
-
-
-
Method Detail
-
createFlowGraph
default <TElement extends IWorkflowNodeTypeProviding & IActiveFlagProviding> IFlowGraphEndPoints createFlowGraph(ICreateFlowGraphParams<TData,TElement> params) throws WorkflowAnalysisException
Description copied from interface:IWorkflowNodeFlowAnalyzerThis 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:
IExecutingLikeActionNodefor normal business actions that execute some logic and have no children.IExecutingLikeBinarySelectionNodefor custom conditions that behave like an if-else statement.IExecutingLikeControlTransferNodefor custom control transfer actions such as break or continue statements (you will rarely need this).IExecutingLikeExceptionHandlerNodefor custom error handlers that behave like a try-catch-finally statement.IExecutingLikeMultiSwitchNodefor custom conditions that behave like switch-case-default statement.IExecutingLikePostTestLoopNodefor custom loops that behave like a do-while-loop.IExecutingLikePreTestLoopNodefor custom loops that behave like a while-loop.IExecutingLikeReturningActionNodefor custom end points that can both throw an exception and end a processing chain by returning.IExecutingLikeReturnNodefor custom end points that always return and never throw an exception.IExecutingLikeSequenceNodefor custom block statements that never throw and execute their children in order (you will rarely need this).IExecutingLikeThrowNodefor 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
virtualnodeownedand 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, andControlTransferfor 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
FlowGraphEndPointfor more details.- Specified by:
createFlowGraphin interfaceIWorkflowNodeFlowAnalyzer<TData>- 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 modelWorkflowNodeor 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#endPointsand its variants to create this return value. See the documentation ofgetNormalEndPointsandgetThrowingEndPointsfor 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.
-
findNextSwitchCaseIndex
default int findNextSwitchCaseIndex(int switchCaseIndex, int currentIndex, int childCount)It may be possible that multiple switch cases are matching. If that is the case, the switch may decide to execute all such switch cases in some defined order. This method allows finding all switch cases which might be executed after a given case.The default implementation assumes that multiple matching switch cases are executed in the order of how they appear in the list of children of the switch node, from the left to the right.
- Parameters:
switchCaseIndex- Index of a switch case for which to find all switch cases that might be executed after it.currentIndex- Current index, either the switchCaseIndex when starting the iteration, or the last value returned by this method.childCount- Total number of children of the switch node.- Returns:
- The index of the next switch case, or
-1if no more switch cases exist that may be executed afterwards. When this method returns a value >= the number of children, it is treated as if-1had been returned. If this method returns thedefault case index, that index is skipped.
-
getDefaultCaseChildIndex
int getDefaultCaseChildIndex()
- Returns:
- Index of the child representing the default case. If negative, the number of children is added to the
index, so that
-1is the last child,-2the seconds to last child etc.
-
-