Interface IBinarySelectionGatewayFlowLabelHelper


  • public interface IBinarySelectionGatewayFlowLabelHelper
    A flow label helper for binary selection gateways, i.e. gateways with two branches, usually an if and an else branch. Helps to position the labels for the names of the two SequenceFlow that emerge from the gateway.

    Assumptions:

    • The two sequence flow lines emanating from the gateway are perpendicular to each other, i.e. one is horizontal and the other is vertical.
    • Both labels for the flow lines are positioned inside the corner formed by the two lines.
    • The alignment items for the consequent and alternate branch are placed next to each other. The alignment item for the consequent branch is at index 0, and the alignment item for the alternate branch is at index 1.
    • The gateway is placed next to the aligned body with the consequent and alternate branches. The alignment for the gateway is at index 0, and the alignment for the body is at index 1.

    Horizontal layouts might look like this:

                                +----------------+
           -------------------> |    alternate   |
           |                    +----------------+
           |
           |
           | no
           |
           x    yes             +----------------+
         x x x ---------------> |   consequent   |
           x                    +----------------+
        gateway
    
    
         gateway
           x                    +----------------+
         x x x ---------------> |   consequent   |
           x     yes            +----------------+
           |
           | no
           |
           |
           |                    +----------------+
           -------------------> |    alternate  |
                                +----------------+
    
    
                                +----------------+
                                |    alternate   | <-------------------
                                +----------------+                    |
                                                                      |
                                                                      |
                                                                   no |
                                                                      |
                                +----------------+             yes    x
                                |   consequent   | <--------------- x x x
                                +----------------+                    x
                                                                   gateway
    
    
                                                                   gateway
                                +----------------+                    x
                                |   consequent   | <----------------x x x
                                +----------------+            yes     x
                                                                      |
                                                                   no |
                                                                      |
                                                                      |
                                +----------------+                    |
                                |    alternate   | <----------------- -
                                +----------------+
     

    Vertical layouts might look like this:

           gateway
              x
            x x x ------------------------
              x     no                   |
              |                          |
              | yes                      |
              |                          |
              |                          |
              |                          |
              |                          |
              |                          |
              |                          |
              v                          v
      +----------------+        +----------------+
      |   consequent   |        |    alternate   |
      +----------------+        +----------------+
    
    
                                      gateway
                                         x
              ------------------------ x x x
              |                 no       x
              |                          |
              |                      yes |
              |                          |
              |                          |
              |                          |
              |                          |
              |                          |
              |                          |
              v                          v
      +----------------+        +----------------+
      |    alternate   |        |   consequent   |
      +----------------+        +----------------+
    
    
      +----------------+        +----------------+
      |   consequent   |        |    alternate   |
      +----------------+        +----------------+
              ^                          ^
              |                          |
              |                          |
              |                          |
              |                          |
              |                          |
              |                          |
              | yes                      |
              |                          |
              x     no                   |
            x x x ------------------------
              x
           gateway
    
    
      +----------------+        +----------------+
      |    alternate   |        |   consequent   |
      +----------------+        +----------------+
              ^                          ^
              |                          |
              |                          |
              |                          |
              |                          |
              |                          |
              |                          |
              |                          |
              |                      yes |
              |                 no       x
              ------------------------ x x x
                                         x
                                      gateway
     
    To create such a layout, you should proceed as follows:
    Since:
    8.4.0
    • Method Detail

      • alternateText

        IWorkflowBpmnAlignmentItem<StyledBpmnLabel,​?> alternateText()
        The alignment item for the alternate text label, i.e. the label for the "else" branch.
        Returns:
        The alignment item for the alternate text label
      • branchesSpacingSelector

        IWorkflowBpmnCardinalAlignmentSpacingSelector branchesSpacingSelector​(int consequentIndex)
        Gets the spacing selector when aligning the two branches of the gateway, i.e. the two alignment items represent the consequent and alternate parts. Intended to be used with IWorkflowBpmnLayouter.alignAtAxis().

        For example, for horizontal layouts, the two branches are often put on top of each other. If the labels are tall, the spacing needs to be adjusted to accommodate the height of the labels.

        Parameters:
        consequentIndex - The index of the alignment items representing the consequent ("if") part in the list of items to align. The alternate ("else") part must be the next item in the list. If you only align the consequent with the alternate (2 items), this should be 0.
        Returns:
        The spacing selector for aligning the two alignment items for the two branches of the gateway.
      • branchesSpacingSelector

        IWorkflowBpmnCardinalAlignmentSpacingSelector branchesSpacingSelector​(Object consequentValue)
        Gets the spacing selector when aligning the two branches of the gateway, i.e. the two alignment items represent the consequent and alternate parts. Intended to be used with IWorkflowBpmnLayouter.alignAtAxis().

        For example, for horizontal layouts, the two branches are often put on top of each other. If the labels are tall, the spacing needs to be adjusted to accommodate the height of the labels.

        Parameters:
        consequentValue - The value of the alignment items representing the consequent ("if") part in the list of items to align. The alternate ("else") part must be the next item in the list.
        Returns:
        The spacing selector for aligning the two alignment items for the two branches of the gateway.
      • consequentText

        IWorkflowBpmnAlignmentItem<StyledBpmnLabel,​?> consequentText()
        The alignment item for the consequent text label, i.e. the label for the "if" branch.
        Returns:
        The alignment item for the consequent text label
      • gatewayBodySpacingSelector

        IWorkflowBpmnCardinalAlignmentSpacingSelector gatewayBodySpacingSelector​(int divergingGatewayIndex)
        Gets the spacing selector for aligning the gateway with the alignment item representing the body, i.e. the consequent branch aligned with the alternate branch. Intended to be used with IWorkflowBpmnLayouter.alignAtAxis().

        For example, for west-to-east layouts, the body is often put to the right of the gateway. If the labels are wide, the spacing needs to be adjusted to accommodate the width of the labels.

        Parameters:
        divergingGatewayIndex - The index of the diverging gateway in the list of items to align. The body with the aligned branches must be the next item in the list. If you only align the gateway with the body (2 items), this should be 0.
        Returns:
        The spacing selector for aligning the gateway with the body.
      • gatewayBodySpacingSelector

        IWorkflowBpmnCardinalAlignmentSpacingSelector gatewayBodySpacingSelector​(Object divergingGatewayValue)
        Gets the spacing selector for aligning the gateway with the alignment item representing the body, i.e. the consequent branch aligned with the alternate branch. Intended to be used with IWorkflowBpmnLayouter.alignAtAxis().

        For example, for west-to-east layouts, the body is often put to the right of the gateway. If the labels are wide, the spacing needs to be adjusted to accommodate the width of the labels.

        Parameters:
        divergingGatewayValue - The value of the diverging gateway in the list of items to align. The body with the aligned branches must be the next item in the list. If you only align the gateway with the body (2 items), this should be 0.
        Returns:
        The spacing selector for aligning the gateway with the body.