Class InsertEmptyBlock


  • public class InsertEmptyBlock
    extends Object
    Inserts an empty block consisting of a split, and a join node, and a single empty branch between them. The following blocks are possible at the moment:
    • AND-Split -> AND-Join
    • XOR-Split -> XOR-Join
    • LOOP-Start -> LOOP-End
    Call isPossible first to check if the insertion is valid, than call perform operation to execute the change. TODO Refactor; use a common interface for change operations.
    • Field Detail

      • logger

        protected static final Logger logger
        a Logger
    • Constructor Detail

      • InsertEmptyBlock

        public InsertEmptyBlock()
    • Method Detail

      • isPossible

        public static boolean isPossible​(Template template,
                                         Node pred,
                                         Node succ)
        Checks if it is possible (concerning structural correctness) to insert an empty block in the given template.
        Parameters:
        template - the template the change is performed on
        pred - the node after which the empty block should be inserted
        succ - the node before which the empty block should be inserted
        Returns:
        True, if it is possible
      • isPossible

        public static boolean isPossible​(Template template,
                                         Node pred,
                                         Node succ,
                                         CheckReport checkReport)
        Checks if it is possible (concerning structural correctness) to insert an empty block in the given template. If it is not possible the reasons are stored in the checkReport.
        Parameters:
        template - he template the change is performed on
        pred - the node after which the empty block should be inserted
        succ - the node before which the empty block should be inserted
        checkReport - a checkReport object which can be filled with the reason why the isPossible failed (i.e. in the case the method returns false), may be null
        Returns:
        True, if it is possible
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         Node pred,
                                         Node succ)
        Checks if it is possible (concerning structural and state-based correctness) to insert an empty block in the given instance.
        Parameters:
        instance - the changeable instance the change is performed on
        pred - the node after which the empty block should be inserted
        succ - the node before which the empty block should be inserted
        Returns:
        True, if it is possible
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         Node pred,
                                         Node succ,
                                         CheckReport checkReport)
        Checks if it is possible (concerning structural and state-based correctness) to insert an empty block in the given instance. If it is not possible the reasons are stored in the checkReport.
        Parameters:
        instance - the changeable instance the change is performed on
        pred - the node after which the empty block should be inserted
        succ - the node before which the empty block should be inserted
        checkReport - a checkReport object which can be filled with the reason why the isPossible failed (i.e. in the case the method returns false), may be null
        Returns:
        True, if it is possible
      • performOperation

        public static Node[] performOperation​(SessionToken session,
                                              ChangeableTemplate template,
                                              Node pred,
                                              Node succ,
                                              ProcessConstants.BlockType type)
        Inserts an empty block of the given type in the template. Supported block types:
        • AND_BLOCK
        • OR_BLOCK
        • LOOP-BLOCK
        Parameters:
        session - The session which is used to check for access rights on this method.
        template - the template where the change is performed on
        pred - the node after which the empty block should be inserted
        succ - the node before which the empty block should be inserted
        type - the type of the block to insert
        Returns:
        the inserted block
      • performOperation

        public static Node[] performOperation​(SessionToken session,
                                              ChangeableTemplate template,
                                              Node pred,
                                              Node succ,
                                              ProcessConstants.BlockType type,
                                              UpdateManager updateManager)
        Inserts an empty block of the given type in the template (with updateManager). Supported block types:
        • AND_BLOCK
        • OR_BLOCK
        • LOOP-BLOCK
        Parameters:
        session - The session which is used to check for access rights on this method.
        template - the template where the change is performed on
        pred - the node after which the empty block should be inserted
        succ - the node before which the empty block should be inserted
        type - the type of the block to insert
        updateManager - the manager who controls the update of the visual graph components.
        Returns:
        the inserted block
      • performOperation

        public static Node[] performOperation​(SessionToken session,
                                              ChangeableInstance instance,
                                              Node pred,
                                              Node succ,
                                              ProcessConstants.BlockType type)
        Inserts an empty block of the given type in the instance. Supported block types:
        • AND_BLOCK
        • OR_BLOCK
        • LOOP-BLOCK
        Parameters:
        session - The session which is used to check for access rights on this method.
        instance - the changeable instance where the change is performed on
        pred - the node after which the empty block should be inserted
        succ - the node before which the empty block should be inserted
        type - the type of the block to insert
        Returns:
        the inserted block
      • performOperation

        public static Node[] performOperation​(SessionToken session,
                                              ChangeableInstance instance,
                                              Node pred,
                                              Node succ,
                                              ProcessConstants.BlockType type,
                                              UpdateManager updateManager)
        Inserts an empty block of the given type in the instance (with updateManager). Supported block types:
        • AND_BLOCK
        • OR_BLOCK
        • LOOP-BLOCK
        Parameters:
        session - The session which is used to check for access rights on this method.
        instance - the changeable instance where the change is performed on
        pred - the node after which the empty block should be inserted
        succ - the node before which the empty block should be inserted
        type - the type of the block to insert
        updateManager - the manager who controls the update of the visual graph components.
        Returns:
        the inserted block
      • performOperation

        protected static Node[] performOperation​(SessionToken session,
                                                 ChangePrimitives processGraph,
                                                 Node pred,
                                                 Node succ,
                                                 ProcessConstants.BlockType type,
                                                 UpdateManager updateManager)
        Worker method to do the structural changes for both changeable templates and changeable instances.
        Parameters:
        session - The session which is used to check for access rights on this method.
        processGraph - an instance of type ChangeableTemplate or ChangeableInstance
        pred - the node after which the empty block should be inserted
        succ - the node before which the empty block should be inserted
        type - the type of the block to insert
        updateManager - the manager who controls the update of the visual graph components.
        Returns:
        The newly inserted data element.