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 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.
      • crossFlowDirection

        ECardinalDirection2D crossFlowDirection()
        The cross flow direction, which is the flowDirection rotated by 90 degrees anti-clockwise.
        Returns:
        The cross flow direction, never null.
      • crossFlowPolarity

        EAxisPolarity crossFlowPolarity()
        The axis polarity of the cross flow direction, which is the flowDirection rotated by 90 degrees anti-clockwise.
        Returns:
        The cross flow polarity, never null.
      • crossFlowSpacing

        double crossFlowSpacing()
        Gets the default spacing in the crossFlowDirection().
        Returns:
        The default spacing in the cross flow direction.
      • crossFlowSpacing

        double crossFlowSpacing​(double scalingFactor)
        Gets the default spacing in the crossFlowDirection(), 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()
        A Point2DDouble representing a unit vector in the cross 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)
        A Point2DDouble representing a unit vector in the 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 cross flow direction, never null.
      • crossFlowVector

        Point2DDouble crossFlowVector​(double scalingFactor)
        A Point2DDouble representing a vector in the cross flow direction, with a magnitude equal to the cross 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 in IStructuredBpmnModelPart.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. the client or form files.
        Returns:
        The store providing access to environmental data, never null.
      • flowDirection

        ECardinalDirection2D flowDirection()
        The direction of the flow indicating how BPMN elements are laid out in the diagram. This is the same as layoutSettings().direction().
        Returns:
        The direction of the flow, never null.
      • flowSpacing

        double flowSpacing()
        Gets the default spacing in the flowDirection().
        Returns:
        The default spacing in the flow direction.
      • flowSpacing

        double flowSpacing​(double scalingFactor)
        Gets the default spacing in the flowDirection(), 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()
        A Point2DDouble representing a unit vector in the flow direction, with a magnitude of 1.
        Returns:
        A point representing a vector in the flow direction, never null.
      • flowUnitVector

        Point2DDouble flowUnitVector​(double magnitude)
        A Point2DDouble representing a unit vector in the 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 flow direction, never null.
      • flowVector

        Point2DDouble flowVector​(double scalingFactor)
        A Point2DDouble representing a vector in the flow direction, with a magnitude equal to the 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 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 a WorkflowProcess, 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 a WorkflowTask, 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.
      • reverseCrossFlowUnitVector

        Point2DDouble reverseCrossFlowUnitVector​(double magnitude)
        A Point2DDouble representing a unit vector in the reverse 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​(double scalingFactor)
        A Point2DDouble representing a vector in the reverse cross flow direction, with a magnitude equal to the cross 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.
      • reverseFlowUnitVector

        Point2DDouble reverseFlowUnitVector()
        A Point2DDouble representing a unit vector in the reverse 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)
        A Point2DDouble representing a unit vector in the reverse 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​(double scalingFactor)
        A Point2DDouble representing a vector in the reverse flow direction, with a magnitude equal to the 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 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.
      • 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.