Package de.xima.fc.workflow.bpmn
Interface AServiceTaskBpmnModeler.IStatefulTaskLayoutPostProcessor
-
- Enclosing class:
- AServiceTaskBpmnModeler<Model>
public static interface AServiceTaskBpmnModeler.IStatefulTaskLayoutPostProcessor
A post-processor for the service task layout, seecreateTaskLayoutPostProcessor
.This allows you to enrich the service task with additional data and BPMN elements, such as adding
data objects
that represent the input or output of the service task.Implementations of this interface need not be thread-safe and is used only for the duration of a single
modeling operation
. Implementations may store state that is accessed by the various methods.The lifecycle of the post-processor is as follows:
- A new instance is created by
createTaskLayoutPostProcessor
processTask
is called after the service task was created. It may return a replacement that contains the task with additional BPMN elements.- After the positions of all elements were created and resolved,
addShapes
is called to create the requiredBPMN shapes
for the additional BPMN elements. addFlows
is called to create the requiredsequence flows
between the additional BPMN elements.addAssociations
is called to create the requiredassociations
between the additional BPMN elements.- Finally,
finishLayout
is called add the end, just before the modeling operation finishes.
processTask
method and, depending on what you do in that method, one or more of theaddShapes
,addFlows
, andaddAssociations
methods. ThefinishLayout
method is optional and does not need to be overridden in most cases.- Since:
- 8.4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
addAssociations(IFlattenedAlignmentItemMap<?> flattened)
Adds theassociations
for the additional BPMN elements created byprocessTask
.default void
addFlows(IFlattenedAlignmentItemMap<?> flattened)
Adds theSequenceFlow sequence flows
for the additional BPMN elements created byprocessTask
.default void
addShapes(IFlattenedAlignmentItemMap<?> flattened)
Adds theBPMN shapes
for the additional BPMN elements created byprocessTask
.default void
finishLayout(IFlattenedAlignmentItemMap<?> flattened)
Finishes the layout of the service task and any additional BPMN elements.IWorkflowBpmnAlignmentItem<?,?>
processTask(IAnnotatedNamedBpmnElementLayout<de.xima.bpmn_model.api.element.bpmn.activities.ServiceTask> task)
Applies post-processing to the createdservice task
.
-
-
-
Method Detail
-
addAssociations
default void addAssociations(IFlattenedAlignmentItemMap<?> flattened)
Adds theassociations
for the additional BPMN elements created byprocessTask
. The default implementation does not add any associations. Normally, you should use theflattened
.association()
helper method to create the associations, passing the BPMN elements you created and stored in an instance field.- Parameters:
flattened
- The flattened alignment item map that contains all BPMN elements together with their resolved absolute positions.
-
addFlows
default void addFlows(IFlattenedAlignmentItemMap<?> flattened)
Adds theSequenceFlow sequence flows
for the additional BPMN elements created byprocessTask
. The default implementation does not add any flows. Normally, you should use theflattened
.flow()
helper method to create the flows, passing the BPMN elements you created and stored in an instance field.- Parameters:
flattened
- The flattened alignment item map that contains all BPMN elements together with their resolved absolute positions.
-
addShapes
default void addShapes(IFlattenedAlignmentItemMap<?> flattened)
Adds theBPMN shapes
for the additional BPMN elements created byprocessTask
. The default implementation does not add any shapes. Normally, you should use the various methods of theflattened
alignment map, such ascreateDataObjectShape
, passing the BPMN element you created and stored in an instance field.- Parameters:
flattened
- The flattened alignment item map that contains all BPMN elements together with their resolved absolute positions.
-
finishLayout
default void finishLayout(IFlattenedAlignmentItemMap<?> flattened)
Finishes the layout of the service task and any additional BPMN elements. This is a generic callback that you might use to perform any final adjustments. Normally, you should not need to override this method. The default implementation does nothing.- Parameters:
flattened
- The flattened alignment item map that contains all BPMN elements together with their resolved absolute positions.
-
processTask
IWorkflowBpmnAlignmentItem<?,?> processTask(IAnnotatedNamedBpmnElementLayout<de.xima.bpmn_model.api.element.bpmn.activities.ServiceTask> task)
Applies post-processing to the createdservice task
. You may for example create additional BPMN elements such asdata objects
that represent the input or output of the service task. If you do, you must align these additional BPMN elements with the service task and return the combinedalignment item
with the service task and the additional elements. Consider using the various helper methods provided bycontext.layouter()
to align the items.You should store the created BPMN elements in instance fields, so you can access them later during
addShapes
,addFlows
, andaddAssociations
.- Parameters:
task
- The layout of the service task that was created by the modeler, never null.- Returns:
- The alignment item that contains the service task and any additional BPMN elements you created.
-
-