Interface AStartEventBpmnModeler.IStatefulStartEventPostProcessor

  • Enclosing class:
    AStartEventBpmnModeler<Model>

    public static interface AStartEventBpmnModeler.IStatefulStartEventPostProcessor
    A post-processor for the start event layout, see createStartEventLayoutPostProcessor.

    This allows you to enrich the start event with additional data and BPMN elements, such as adding an additional precondition for the start event.

    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 createStartEventPostProcessor
    • processStartEvent is called after the start event was created. It may return a replacement that contains the start event with additional BPMN elements.
    • After the positions of all elements were created and resolved, addShapes is called to create the required BPMN shapes for the additional BPMN elements.
    • addFlows is called to create the required sequence flows between the additional BPMN elements.
    • addAssociations is called to create the required associations between the additional BPMN elements.
    • Finally, finishLayout is called add the end, just before the modeling operation finishes.
    You must implement the processStartEvent method and, depending on what you do in that method, one or more of the addShapes, addFlows, and addAssociations methods. The finishLayout method is optional and does not need to be overridden in most cases.
    Since:
    8.4.0
    • Method Detail

      • addAssociations

        default void addAssociations​(IFlattenedAlignmentItemMap<?> flattened)
        Adds the associations for the additional BPMN elements created by processStartEvent. The default implementation does not add any associations. Normally, you should use the flattened.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 the SequenceFlow sequence flows for the additional BPMN elements created by processStartEvent. The default implementation does not add any flows. Normally, you should use the flattened.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 the BPMN shapes for the additional BPMN elements created by processStartEvent. The default implementation does not add any shapes. Normally, you should use the various methods of the flattened alignment map, such as createExclusiveGatewayShape, 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 start event 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.
      • processStartEvent

        IWorkflowBpmnAlignmentItem<?,​?> processStartEvent​(IAnnotatedNamedBpmnElementLayout<de.xima.bpmn_model.api.element.bpmn.events.StartEvent> startEvent)
        Applies post-processing to the created start event. You may for example create additional BPMN elements such as preconditions for the start event. If you do, you must align these additional BPMN elements with the start event and return the combined alignment item with the start event and the additional elements. Consider using the various helper methods provided by context.layouter() to align the items.

        You should store the created BPMN elements in instance fields, so you can access them later during addShapes, addFlows, and addAssociations.

        Parameters:
        startEvent - The layout of the start event that was created by the modeler, never null.
        Returns:
        The alignment item that contains the start event and any additional BPMN elements you created.