Class ABinarySelectionBpmnModeler<Model>
- java.lang.Object
-
- de.xima.fc.workflow.bpmn.ABinarySelectionBpmnModeler<Model>
-
- Type Parameters:
Model
- The type of the node's property model, seeIElementHandler.getDataModelClass()
.
- All Implemented Interfaces:
IWorkflowNodeBpmnModeler<Model>
- Direct Known Subclasses:
FcMultipleConditionBpmnModeler
public abstract class ABinarySelectionBpmnModeler<Model> extends Object implements IWorkflowNodeBpmnModeler<Model>
BPMN modeler
fornodes
that execute like a binary selection, e.g. an if-else node. Aligns the consequent and alternate parts in cross-flow direction, the creates adiverging
andconverging
exclusive gateway
for splitting and rejoining the sequence flow; and places the combined consequent+alternate part between the gateways.At minimum, you should override
getConditionName
,getConsequentLabel
andgetAlternateLabel
to provide the appropriate question and answers matching the business logic of your condition.- Since:
- 8.4.0
-
-
Constructor Summary
Constructors Constructor Description ABinarySelectionBpmnModeler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getAlternateChildIndex()
Gets the 0-based index of the child representing the alternate (else) part.protected String
getAlternateLabel(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Gets the label for the alternate part, which is displayed next to the outgoing sequence flow of the exclusive gateway.protected String
getConditionDetails(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Gets the detailed description of the condition that is evaluated to determine which branch to take.protected String
getConditionName(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Gets the name of the condition, uses as thename
of thediverging
exclusive gateway
.protected int
getConsequentChildIndex()
Gets the 0-based index of the child representing the consequent (if) part.protected String
getConsequentLabel(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Gets the label for the consequent part, which is displayed next to the outgoing sequence flow of the exclusive gateway.void
modelNode(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Models aWorkflowNode
in the BPMN diagram.
-
-
-
Method Detail
-
modelNode
public final void modelNode(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Description copied from interface:IWorkflowNodeBpmnModeler
Models aWorkflowNode
in the BPMN diagram. This method is called once for theroot node
of eachWorkflowTask
in the workflow. Implementations for nodes that havechildren
should 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 aIStructuredBpmnModelPart
for thenode
, see the class-level documentation ofIStructuredBpmnModelPart
for 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 getsresolved
to a flat map. Finally, the various method onIFlattenedAlignmentItemMap
can be used to create theBPMN shapes
,BPMN edges
andsequence flows
.- Specified by:
modelNode
in interfaceIWorkflowNodeBpmnModeler<Model>
- Parameters:
params
- The parameters for the modeler, containing theWorkflowNode
to 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 alltriggers
andnodes
in the workflow.
-
getAlternateChildIndex
protected int getAlternateChildIndex()
Gets the 0-based index of the child representing the alternate (else) part.- Returns:
- 0-based index of the alternate child.
-
getAlternateLabel
protected String getAlternateLabel(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Gets the label for the alternate part, which 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 which branch to take. The description is placed within thetext annotation
of thediverging
exclusive 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, uses as thename
of thediverging
exclusive 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.
-
getConsequentChildIndex
protected int getConsequentChildIndex()
Gets the 0-based index of the child representing the consequent (if) part.- Returns:
- 0-based index of the consequent child.
-
getConsequentLabel
protected String getConsequentLabel(IModelWorkflowNodeParams<Model> params, IWorkflowBpmnModelContext context)
Gets the label for the consequent part, which 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.
-
-