Class APostTestLoopBpmnModeler<Model>
- java.lang.Object
-
- de.xima.fc.workflow.bpmn.APostTestLoopBpmnModeler<Model>
-
- Type Parameters:
Model- The type of the node's property model, seeIElementHandler.getDataModelClass().
- All Implemented Interfaces:
IWorkflowNodeBpmnModeler<Model>
- Direct Known Subclasses:
FcDoUntilLoopBpmnModeler
public abstract class APostTestLoopBpmnModeler<Model> extends Object implements IWorkflowNodeBpmnModeler<Model>
BPMN modelerfornodesthat execute like a post-test loop, e.g. a do-until loop (do-while loop). Creates aconverginganddivergingexclusive gateway, and places the loop body between the gateways. First thesequence flowmoves to the loop body. After the loop body completes, passes on the sequence flow to the diverging gateway. When the loop condition matches, redirects back to the beginning of the loop. Otherwise, if the condition does not match, passes on the sequence flow to the end of the loop.If the loop body contains nodes that can
complete abruptlybytransferring controlto this loop (e.g. a break or continue statement), wraps the loop body in aSubProcessthat catches the correspondingescalationwith aboundary eventand redirects the sequence flow accordingly (to the beginning of the loop for a continue statement, or to the end of the loop for a break statement).At minimum, you should override
getConditionName,getConsequentLabelandgetAlternateLabelto provide the appropriate question and answers matching the business logic of your condition.

- Since:
- 8.4.0
-
-
Constructor Summary
Constructors Constructor Description APostTestLoopBpmnModeler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetAlternateLabel(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)Gets the label for when the condition does not match, ending the loop.protected StringgetConditionDetails(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)Gets the detailed description of the condition that is evaluated to determine when to end the loop.protected StringgetConditionName(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)Gets the name of the condition that checks when to end the loop.protected StringgetConsequentLabel(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)Gets the label for when the condition matches, which continues the loop.protected intgetLoopBodyChildIndex()Gets the 0-based index of the child representing the loop body.voidmodelNode(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)Models aWorkflowNodein the BPMN diagram.
-
-
-
Method Detail
-
modelNode
public final void modelNode(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Description copied from interface:IWorkflowNodeBpmnModelerModels aWorkflowNodein the BPMN diagram. This method is called once for theroot nodeof eachWorkflowTaskin the workflow. Implementations for nodes that havechildrenshould callcontext.modelNode(node)on their child nodes if needed.The responsibility of each modeler is to access the provided
params.partBuilder()and add the appropriate data to that builder. That data then gets used to create aIStructuredBpmnModelPartfor thenode, see the class-level documentation ofIStructuredBpmnModelPartfor more info.When modelling a workflow node as BPMN, the usual approach is to create a nested tree of
alignment items, making use of thelayouter. This tree then getsresolvedto a flat map. Finally, the various method onIFlattenedAlignmentItemMapcan be used to create theBPMN shapes,BPMN edgesandsequence flows.- Specified by:
modelNodein interfaceIWorkflowNodeBpmnModeler<Model>- Parameters:
params- The parameters for the modeler, containing theWorkflowNodeto model and its deserialized custom properties model, as well as the part builder to fill with data.context- The context for creating the BPMN diagram, its lifecycle starts when the conversion (of the workflow to a BPMN diagram) starts and ends when the conversion ends. The context lets you access various helper methods such as thelayouter()orcolorizer, and also provides access to all global data such as alltriggersandnodesin the workflow.
-
getAlternateLabel
protected String getAlternateLabel(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Gets the label for when the condition does not match, ending the loop. The label is displayed next to the outgoing sequence flow of the exclusive gateway.When this returns a blank string, defaults to a default localized label that may or may not be appropriate for the specific circumstances of the workflow node being modelled.
Note regarding the naming convention for gateways. Label a data-based exclusive gateway with a question.
- Invoice correct?
- Trust level of user?
- Yes
- No
- Untrusted
- Basic
- Secure
- Parameters:
params- The parameters for the workflow node to model, as provided by the workflow engine.context- The context for the BPMN modelling process, as provided by the workflow engine.- Returns:
- The label for the alternate part.
-
getConditionDetails
protected String getConditionDetails(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Gets the detailed description of the condition that is evaluated to determine when to end the loop. The description is placed within thetext annotationof thedivergingexclusive gateway. May return empty if no details are needed.- Parameters:
params- The parameters for the workflow node to model, as provided by the workflow engine.context- The context for the BPMN modelling process, as provided by the workflow engine.- Returns:
- The details description of the condition, may be empty if no condition is specified.
-
getConditionName
protected String getConditionName(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Gets the name of the condition that checks when to end the loop. Uses as thenameof thedivergingexclusive gateway.When this returns a blank string, defaults to a default localized name that may or may not be appropriate for the specific circumstances of the workflow node being modelled.
Note regarding the naming convention for gateways. Label a data-based exclusive gateway with a question.
- Invoice correct?
- Trust level of user?
- Yes
- No
- Untrusted
- Basic
- Secure
- Parameters:
params- The parameters for the workflow node to model, as provided by the workflow engine.context- The context for the BPMN modelling process, as provided by the workflow engine.- Returns:
- The details description of the condition, may be empty if no condition is specified.
-
getConsequentLabel
protected String getConsequentLabel(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Gets the label for when the condition matches, which continues the loop. The label is displayed next to the outgoing sequence flow of the exclusive gateway.When this returns a blank string, defaults to a default localized label that may or may not be appropriate for the specific circumstances of the workflow node being modelled.
Note regarding the naming convention for gateways. Label a data-based exclusive gateway with a question.
- Invoice correct?
- Trust level of user?
- Yes
- No
- Untrusted
- Basic
- Secure
- Parameters:
params- The parameters for the workflow node to model, as provided by the workflow engine.context- The context for the BPMN modelling process, as provided by the workflow engine.- Returns:
- The label for the consequent part.
-
getLoopBodyChildIndex
protected int getLoopBodyChildIndex()
Gets the 0-based index of the child representing the loop body. The default implementation returns 0, i.e. the first child of the post-test loop.- Returns:
- 0-based index of the loop body.
-
-