Interface IWorkflowBpmnModelContext
-
public interface IWorkflowBpmnModelContext
Interface for the context available when a workflow flowchart is converted to a BPMN diagram. The context is created when the conversion starts and discarded when the conversion ends. The context can be used to access data that is global to the conversion process, such as the entire workflow process to be converted, or the created BPMN elements. It also contains various helper methods you can use to create the BPMN diagram.The BPMN diagram for a workflow consists of nested
IStructuredBpmnModelPart
, see the class-level documentation for that class for more info.- Since:
- 8.4.0
- Author:
- XIMA MEDIA GmbH
- See Also:
IWorkflowProcessBpmnModeler
,IWorkflowTaskBpmnModeler
,IWorkflowTriggerBpmnModeler
,IWorkflowNodeBpmnModeler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IBpmnElementStore
bpmnElements()
Gets the store to access all BPMN element in the BPMN model being created.IWorkflowBpmnColorizer
colorizer()
Gets the colorizer with helper methods for apply color to BPMN shapes, edges, and labels.IBpmnCompatibilitySettings
compatibilitySettings()
Compatibility-related settings with various BPMN tools, used when creating a BPMN diagram.ECartesianAxis2D
crossFlowAxis()
The cross flow axis, i.e.ECardinalDirection2D
crossFlowDirection()
The cross flow direction, which is theflowDirection
rotated by 90 degrees anti-clockwise.EAxisPolarity
crossFlowPolarity()
Theaxis polarity
of the cross flow direction, which is theflowDirection
rotated by 90 degrees anti-clockwise.double
crossFlowSpacing()
Gets the default spacing in thecrossFlowDirection()
.double
crossFlowSpacing(double scalingFactor)
Gets the default spacing in thecrossFlowDirection()
, multiplied by the given scaling factor.Point2DDouble
crossFlowUnitVector()
APoint2DDouble
representing a unit vector in thecross flow direction
, with a magnitude of 1.Point2DDouble
crossFlowUnitVector(double magnitude)
APoint2DDouble
representing a unit vector in thecross flow direction
, scaled to the given magnitude.Point2DDouble
crossFlowVector()
APoint2DDouble
representing a vector in thecross flow direction
, with a magnitude equal to thecross flow direction spacing
.Point2DDouble
crossFlowVector(double scalingFactor)
APoint2DDouble
representing a vector in thecross flow direction
, with a magnitude equal to thecross flow direction spacing
scaled by the given scaling factor.IWorkflowBpmnDataStore
data()
Gets the data store that provides access to custom data associated with the current BPMN model context.de.xima.bpmn_model.api.model.BpmnElementFactory
elementFactory()
Contextual factory for creating BPMN elements.IWorkflowBpmnEnvironmentStore
environment()
Gets the store to access various data from the environment, such as entities that might be referenced by the workflow, e.g.IWorkflowFlowAnalysis
flowAnalysis()
The flow analysis of allprocessing chains
in the workflow.ECartesianAxis2D
flowAxis()
The flow axis, i.e.ECardinalDirection2D
flowDirection()
The direction of the flow indicating how BPMN elements are laid out in the diagram.EAxisPolarity
flowPolarity()
Theaxis polarity
of the direction of the flow indicating how BPMN elements are laid out in the diagram.double
flowSpacing()
Gets the default spacing in theflowDirection()
.double
flowSpacing(double scalingFactor)
Gets the default spacing in theflowDirection()
, multiplied by the given scaling factor.Point2DDouble
flowUnitVector()
APoint2DDouble
representing a unit vector in theflow direction
, with a magnitude of 1.Point2DDouble
flowUnitVector(double magnitude)
APoint2DDouble
representing a unit vector in theflow direction
, scaled to the given magnitude.Point2DDouble
flowVector()
APoint2DDouble
representing a vector in theflow direction
, with a magnitude equal to theflow direction spacing
.Point2DDouble
flowVector(double scalingFactor)
APoint2DDouble
representing a vector in theflow direction
, with a magnitude equal to theflow direction spacing
, scaled by the given scaling factor.IWorkflowBpmnLayouter
layouter()
Gets the layout helper that can be used to lay out the BPMN diagram, such as aligning the parts of a workflow node in a sequence.IWorkflowBpmnLayoutSettings
layoutSettings()
Gets the layout settings that affect how the BPMN diagram for the workflow is created.IWorkflowBpmnLocalization
localization()
The object providing access to the localization of the BPMN model.IStructuredBpmnModelPart
modelNode(WorkflowNode node)
Models the given node as a BPMN model part.IStructuredBpmnModelPart
modelProcess(WorkflowProcess process)
Models the given process as a BPMN model part.IStructuredBpmnModelPart
modelTask(WorkflowTask task)
Models the given task as a BPMN model part.IStructuredBpmnModelPart
modelTrigger(WorkflowTrigger node)
Models the given trigger as a BPMN model part.ECardinalDirection2D
negativeCrossFlowDirection()
Thecross flow axis
innegative
direction.ECardinalDirection2D
negativeFlowDirection()
ECardinalDirection2D
positiveCrossFlowDirection()
Thecross flow axis
inpositive
direction.ECardinalDirection2D
positiveFlowDirection()
ECardinalDirection2D
reverseCrossFlowDirection()
Thereverse
of thecross flow direction
.EAxisPolarity
reverseCrossFlowPolarity()
Thepolarity
of thecross flow direction
.Point2DDouble
reverseCrossFlowUnitVector()
APoint2DDouble
representing a unit vector in thereverse cross flow direction
, with a magnitude of 1.Point2DDouble
reverseCrossFlowUnitVector(double magnitude)
APoint2DDouble
representing a unit vector in thereverse cross flow direction
, scaled to the given magnitude.Point2DDouble
reverseCrossFlowVector()
APoint2DDouble
representing a vector in thereverse cross flow direction
, with a magnitude equal to thecross flow direction spacing
.Point2DDouble
reverseCrossFlowVector(double scalingFactor)
APoint2DDouble
representing a vector in thereverse cross flow direction
, with a magnitude equal to thecross flow direction spacing
, scaled by the given scaling factor.ECardinalDirection2D
reverseFlowDirection()
Thereverse
of theflow direction
.EAxisPolarity
reverseFlowPolarity()
Thepolarity
of theflow direction
.Point2DDouble
reverseFlowUnitVector()
APoint2DDouble
representing a unit vector in thereverse flow direction
, with a magnitude of 1.Point2DDouble
reverseFlowUnitVector(double magnitude)
APoint2DDouble
representing a unit vector in thereverse flow direction
, scaled to the given magnitude.Point2DDouble
reverseFlowVector()
APoint2DDouble
representing a vector in thereverse flow direction
, with a magnitude equal to theflow direction spacing
.Point2DDouble
reverseFlowVector(double scalingFactor)
APoint2DDouble
representing a vector in thereverse flow direction
, with a magnitude equal to theflow direction spacing
, scaled by the given scaling factor.boolean
shouldRenderTask(WorkflowTask task)
Whether the given task should be rendered in the BPMN diagram.double
spacing(ECardinalDirection2D side)
Gets the default spacing for the given side.double
spacing(ECartesianAxis2D axis)
Gets the default spacing for the given side.IWorkflowElementStore
workflowElements()
Gets the store to access all triggers and nodes in the workflow for which the BPMN model is created.
-
-
-
Method Detail
-
bpmnElements
IBpmnElementStore bpmnElements()
Gets the store to access all BPMN element in the BPMN model being created.- Returns:
- The store providing access to BPMN elements, never null.
-
colorizer
IWorkflowBpmnColorizer colorizer()
Gets the colorizer with helper methods for apply color to BPMN shapes, edges, and labels.- Returns:
- The colorizer for the BPMN diagram, never null.
-
compatibilitySettings
IBpmnCompatibilitySettings compatibilitySettings()
Compatibility-related settings with various BPMN tools, used when creating a BPMN diagram.- Returns:
- The compatibility settings for the BPMN diagram, never null.
-
crossFlowAxis
ECartesianAxis2D crossFlowAxis()
The cross flow axis, i.e. theaxis
of thecrossFlowDirection
.- Returns:
- The cross flow axis, never null.
-
crossFlowDirection
ECardinalDirection2D crossFlowDirection()
The cross flow direction, which is theflowDirection
rotated by 90 degrees anti-clockwise.- Returns:
- The cross flow direction, never null.
-
crossFlowPolarity
EAxisPolarity crossFlowPolarity()
Theaxis polarity
of the cross flow direction, which is theflowDirection
rotated by 90 degrees anti-clockwise.- Returns:
- The cross flow polarity, never null.
-
crossFlowSpacing
double crossFlowSpacing()
Gets the default spacing in thecrossFlowDirection()
.- Returns:
- The default spacing in the cross flow direction.
-
crossFlowSpacing
double crossFlowSpacing(double scalingFactor)
Gets the default spacing in thecrossFlowDirection()
, multiplied by the given scaling factor.- Parameters:
scalingFactor
- The scaling factor to apply to the default spacing.- Returns:
- The default spacing in the cross flow direction, scaled by the given factor.
-
crossFlowUnitVector
Point2DDouble crossFlowUnitVector()
APoint2DDouble
representing a unit vector in thecross flow direction
, with a magnitude of 1.- Returns:
- A point representing a vector in the cross flow direction, never null.
-
crossFlowUnitVector
Point2DDouble crossFlowUnitVector(double magnitude)
APoint2DDouble
representing a unit vector in thecross flow direction
, scaled to the given magnitude.- Parameters:
magnitude
- The magnitude of the vector to create. If negative, the vector will point in the opposite direction.- Returns:
- A point representing a vector in the cross flow direction, never null.
-
crossFlowVector
Point2DDouble crossFlowVector()
APoint2DDouble
representing a vector in thecross flow direction
, with a magnitude equal to thecross flow direction spacing
.- Returns:
- A point representing a vector in the cross flow direction, never null.
-
crossFlowVector
Point2DDouble crossFlowVector(double scalingFactor)
APoint2DDouble
representing a vector in thecross flow direction
, with a magnitude equal to thecross flow direction spacing
scaled by the given scaling factor.- Parameters:
scalingFactor
- The scaling factor to apply. If negative, the vector will point in the opposite direction.- Returns:
- A point representing a vector in the cross flow direction, never null.
-
data
IWorkflowBpmnDataStore data()
Gets the data store that provides access to custom data associated with the current BPMN model context. Can be used, for example, as a generic way to cache data temporarily during the BPMN model creation process. All data will be discarded after the BPMN model was created.- Returns:
- The generic data store for this context, never null.
-
elementFactory
de.xima.bpmn_model.api.model.BpmnElementFactory elementFactory()
Contextual factory for creating BPMN elements. This is a wrapper around the underlying factory that ensures all created elements will appear inIStructuredBpmnModelPart.ownedBpmnElements()
.- Returns:
- The BPMN element factory.
-
environment
IWorkflowBpmnEnvironmentStore environment()
Gets the store to access various data from the environment, such as entities that might be referenced by the workflow, e.g. theclient
orform files
.- Returns:
- The store providing access to environmental data, never null.
-
flowAnalysis
IWorkflowFlowAnalysis flowAnalysis()
The flow analysis of allprocessing chains
in the workflow.- Returns:
- The flow analysis of all
processing chains
in the workflow, never null.
-
flowAxis
ECartesianAxis2D flowAxis()
The flow axis, i.e. theaxis
of theflowDirection
.- Returns:
- The flow axis, never null.
-
flowDirection
ECardinalDirection2D flowDirection()
The direction of the flow indicating how BPMN elements are laid out in the diagram. This is the same aslayoutSettings()
.direction()
.- Returns:
- The direction of the flow, never null.
-
flowPolarity
EAxisPolarity flowPolarity()
Theaxis polarity
of the direction of the flow indicating how BPMN elements are laid out in the diagram. This is the same aslayoutSettings()
.direction()
.polarity()
.- Returns:
- The direction of the flow, never null.
-
flowSpacing
double flowSpacing()
Gets the default spacing in theflowDirection()
.- Returns:
- The default spacing in the flow direction.
-
flowSpacing
double flowSpacing(double scalingFactor)
Gets the default spacing in theflowDirection()
, multiplied by the given scaling factor.- Parameters:
scalingFactor
- The scaling factor to apply to the default spacing.- Returns:
- The default spacing in the flow direction, scaled by the given factor.
-
flowUnitVector
Point2DDouble flowUnitVector()
APoint2DDouble
representing a unit vector in theflow direction
, with a magnitude of 1.- Returns:
- A point representing a vector in the flow direction, never null.
-
flowUnitVector
Point2DDouble flowUnitVector(double magnitude)
APoint2DDouble
representing a unit vector in theflow direction
, scaled to the given magnitude.- Parameters:
magnitude
- The magnitude of the vector to create. If negative, the vector will point in the opposite direction.- Returns:
- A point representing a vector in the flow direction, never null.
-
flowVector
Point2DDouble flowVector()
APoint2DDouble
representing a vector in theflow direction
, with a magnitude equal to theflow direction spacing
.- Returns:
- A point representing a vector in the flow direction, never null.
-
flowVector
Point2DDouble flowVector(double scalingFactor)
APoint2DDouble
representing a vector in theflow direction
, with a magnitude equal to theflow direction spacing
, scaled by the given scaling factor.- Parameters:
scalingFactor
- The scaling factor to apply. If negative, the vector will point in the opposite direction.- Returns:
- A point representing a vector in the flow direction, never null.
-
layoutSettings
IWorkflowBpmnLayoutSettings layoutSettings()
Gets the layout settings that affect how the BPMN diagram for the workflow is created.- Returns:
- The layout settings for the BPMN diagram, never null.
-
layouter
IWorkflowBpmnLayouter layouter()
Gets the layout helper that can be used to lay out the BPMN diagram, such as aligning the parts of a workflow node in a sequence.- Returns:
- The layout helper for the BPMN diagram, never null.
-
localization
IWorkflowBpmnLocalization localization()
The object providing access to the localization of the BPMN model.- Returns:
- The localization object for the BPMN model, never null.
-
modelNode
IStructuredBpmnModelPart modelNode(WorkflowNode node)
Models the given node as a BPMN model part. Usually you'd call this method for the children of a node, then assemble the parts into a single BPMN model part.IStructuredBpmnModelPart.childParts()
should contain the modeled children.- Parameters:
node
- The node to model.- Returns:
- The BPMN model part for the given node, never null if the node is not null. Null when the given node is null.
-
modelProcess
IStructuredBpmnModelPart modelProcess(WorkflowProcess process)
Models the given process as a BPMN model part.- Parameters:
process
- The process to model.- Returns:
- The BPMN model part for the given task, never null.
-
modelTask
IStructuredBpmnModelPart modelTask(WorkflowTask task)
Models the given task as a BPMN model part. Usually you'd call this method when modeling aWorkflowProcess
, the combine the parts for all tasks together and assemble the parts into a single BPMN model part.- Parameters:
task
- The task to model.- Returns:
- The BPMN model part for the given task, never null.
-
modelTrigger
IStructuredBpmnModelPart modelTrigger(WorkflowTrigger node)
Models the given trigger as a BPMN model part. Usually you'd call this method when modeling aWorkflowTask
, the combine the trigger with the node to assemble the parts into a single BPMN model part.- Parameters:
node
- The trigger to model.- Returns:
- The BPMN model part for the given trigger, never null.
-
negativeCrossFlowDirection
ECardinalDirection2D negativeCrossFlowDirection()
Thecross flow axis
innegative
direction.- Returns:
- The negative cross flow direction, never null.
-
negativeFlowDirection
ECardinalDirection2D negativeFlowDirection()
- Returns:
- The negative flow direction, never null.
-
positiveCrossFlowDirection
ECardinalDirection2D positiveCrossFlowDirection()
Thecross flow axis
inpositive
direction.- Returns:
- The positive cross flow direction, never null.
-
positiveFlowDirection
ECardinalDirection2D positiveFlowDirection()
- Returns:
- The positive flow direction, never null.
-
reverseCrossFlowDirection
ECardinalDirection2D reverseCrossFlowDirection()
Thereverse
of thecross flow direction
.- Returns:
- The reverse cross flow direction, never null.
-
reverseCrossFlowPolarity
EAxisPolarity reverseCrossFlowPolarity()
Thepolarity
of thecross flow direction
.- Returns:
- The reverse cross flow polarity, never null.
-
reverseCrossFlowUnitVector
Point2DDouble reverseCrossFlowUnitVector()
APoint2DDouble
representing a unit vector in thereverse cross flow direction
, with a magnitude of 1.- Returns:
- A point representing a vector in the reverse cross flow direction, never null.
-
reverseCrossFlowUnitVector
Point2DDouble reverseCrossFlowUnitVector(double magnitude)
APoint2DDouble
representing a unit vector in thereverse cross flow direction
, scaled to the given magnitude.- Parameters:
magnitude
- The magnitude of the vector to create. If negative, the vector will point in the opposite direction.- Returns:
- A point representing a vector in the reverse cross flow direction, never null.
-
reverseCrossFlowVector
Point2DDouble reverseCrossFlowVector()
APoint2DDouble
representing a vector in thereverse cross flow direction
, with a magnitude equal to thecross flow direction spacing
.- Returns:
- A point representing a vector in the reverse cross flow direction, never null.
-
reverseCrossFlowVector
Point2DDouble reverseCrossFlowVector(double scalingFactor)
APoint2DDouble
representing a vector in thereverse cross flow direction
, with a magnitude equal to thecross flow direction spacing
, scaled by the given scaling factor.- Parameters:
scalingFactor
- The scaling factor to apply. If negative, the vector will point in the opposite direction.- Returns:
- A point representing a vector in the reverse cross flow direction, never null.
-
reverseFlowDirection
ECardinalDirection2D reverseFlowDirection()
Thereverse
of theflow direction
.- Returns:
- The reverse flow direction, never null.
-
reverseFlowPolarity
EAxisPolarity reverseFlowPolarity()
Thepolarity
of theflow direction
.- Returns:
- The reverse flow polarity, never null.
-
reverseFlowUnitVector
Point2DDouble reverseFlowUnitVector()
APoint2DDouble
representing a unit vector in thereverse flow direction
, with a magnitude of 1.- Returns:
- A point representing a vector in the reverse flow direction, never null.
-
reverseFlowUnitVector
Point2DDouble reverseFlowUnitVector(double magnitude)
APoint2DDouble
representing a unit vector in thereverse flow direction
, scaled to the given magnitude.- Parameters:
magnitude
- The magnitude of the vector to create. If negative, the vector will point in the opposite direction.- Returns:
- A point representing a vector in the reverse flow direction, never null.
-
reverseFlowVector
Point2DDouble reverseFlowVector()
APoint2DDouble
representing a vector in thereverse flow direction
, with a magnitude equal to theflow direction spacing
.- Returns:
- A point representing a vector in the reverse flow direction, never null.
-
reverseFlowVector
Point2DDouble reverseFlowVector(double scalingFactor)
APoint2DDouble
representing a vector in thereverse flow direction
, with a magnitude equal to theflow direction spacing
, scaled by the given scaling factor.- Parameters:
scalingFactor
- The scaling factor to apply. If negative, the vector will point in the opposite direction.- Returns:
- A point representing a vector in the reverse flow direction, never null.
-
shouldRenderTask
boolean shouldRenderTask(WorkflowTask task)
Whether the given task should be rendered in the BPMN diagram. If false, the task should be omitted from the BPMN diagram.- Parameters:
task
- The task to check.- Returns:
- True if the task should be rendered, false if it should be omitted.
-
spacing
double spacing(ECardinalDirection2D side)
Gets the default spacing for the given side. Returns eitherflowDirectionSpacing
orcrossFlowDirectionSpacing
, depending on the given side.- Parameters:
side
- The side for which to get the spacing.- Returns:
- The spacing for the given side, never null.
-
spacing
double spacing(ECartesianAxis2D axis)
Gets the default spacing for the given side. Returns eitherflowDirectionSpacing
orcrossFlowDirectionSpacing
, depending on the given axis.- Parameters:
axis
- The axis for which to get the spacing.- Returns:
- The spacing for the given side, never null.
-
workflowElements
IWorkflowElementStore workflowElements()
Gets the store to access all triggers and nodes in the workflow for which the BPMN model is created.- Returns:
- The store providing access to triggers and nodes, never null.
-
-