Class CopyNode


  • public class CopyNode
    extends Object
    Change operation to copy a process node. The node can only be inserted between two nodes which are connected by a control flow edge. TODO Refactor; use a common interface for change operations.
    • Constructor Detail

      • CopyNode

        public CopyNode()
    • Method Detail

      • isPossible

        public static boolean isPossible​(Template sourceTemplate,
                                         Template targetTemplate,
                                         int nodeToCopyID,
                                         int predID,
                                         int succID)
        Check if it is possible (concerning structural correctness) to copy the given node to the specified target position in the given template.
        Parameters:
        sourceTemplate - The template which contains the node to copy.
        targetTemplate - the template where the node should copied to
        nodeToCopyID - the node which is to be copied
        predID - The predecessor of the copied node in the target template.
        succID - The successor of the copied node in the target template.
        Returns:
        True, if possible.
      • isPossible

        public static boolean isPossible​(Template sourceTemplate,
                                         Template targetTemplate,
                                         int nodeToCopyID,
                                         int predID,
                                         int succID,
                                         CheckReport checkReport)
        Check if it is possible (concerning structural correctness) to copy the given node to the specified target position in the given template. If not, the reasons are stored in the checkReport.
        Parameters:
        sourceTemplate - The template which contains the node to copy.
        targetTemplate - the template where the node should copied to
        nodeToCopyID - the node which is to be copied
        predID - The predecessor of the copied node in the target template.
        succID - The successor of the copied node in the target template.
        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 possible.
      • isPossible

        public static boolean isPossible​(ChangeableInstance sourceInstance,
                                         Instance targetInstance,
                                         int nodeToCopyID,
                                         int predID,
                                         int succID)
        Check if it is possible (concerning structural and state based correctness) to copy the given node to the specified target position in the given instance.
        Parameters:
        sourceInstance - The instance which contains the node to copy.
        targetInstance - The instance where the node should copied to.
        nodeToCopyID - the node which is to be copied
        predID - The predecessor of the copied node in the target template.
        succID - The successor of the copied node in the target template.
        Returns:
        True, if possible.
      • isPossible

        public static boolean isPossible​(ChangeableInstance sourceInstance,
                                         Instance targetInstance,
                                         int nodeToCopyID,
                                         int predID,
                                         int succID,
                                         CheckReport checkReport)
        Check if it is possible (concerning structural and state based correctness) to copy the given node to the specified target position in the given instance. If not, the reasons are stored in the checkReport.
        Parameters:
        sourceInstance - The instance which contains the node to copy.
        targetInstance - The instance where the node should copied to.
        nodeToCopyID - the node which is to be copied
        predID - The predecessor of the copied node in the target template.
        succID - The successor of the copied node in the target template.
        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 possible.
      • isValidNodeToCopy

        public static boolean isValidNodeToCopy​(ChangeableInstance instance,
                                                int nodeToCopyID,
                                                CheckReport checkReport)
        Checks if the given node is a node which can be copied (concerning structural and state-based aspects) in the given instance. If it is not possible the reasons are stored in the checkReport.
        Parameters:
        instance - The changeable instance where the method is performed on.
        nodeToCopyID - the node which is to be copied
        checkReport - a checkReport object which can be filled with the reason why the method failed (i.e. in the case the method returns false), may be null
        Returns:
        True, if the node is valid.
      • isValidNodeToCopy

        public static boolean isValidNodeToCopy​(Template template,
                                                int nodeToCopyID,
                                                CheckReport checkReport)
        Checks if the given node is a node which can be copied (concerning structural aspects) in the given template. If it is not possible the reasons are stored in the checkReport.
        Parameters:
        template - The template where the method is performed on.
        nodeToCopyID - the node which is to be copied
        checkReport - a checkReport object which can be filled with the reason why the method failed (i.e. in the case the method returns false), may be null
        Returns:
        True, if the node is valid.
      • performOperation

        public static int performOperation​(SessionToken session,
                                           ChangeableTemplate sourceTemplate,
                                           ChangeableTemplate targetTemplate,
                                           int nodeToCopyID,
                                           int predID,
                                           int succID)
        Copies the given node from the source template between the two nodes in the target template.
        Parameters:
        session - The session which is used to check for access rights on this method.
        sourceTemplate - The template which contains the node to copy.
        targetTemplate - The template where the node should copied to.
        nodeToCopyID - The node which is to be copied.
        predID - The predecessor of the copied node in the target template.
        succID - The successor of the copied node in the target template.
        Returns:
        the ID of the copied node in the target template
      • performOperation

        public static int performOperation​(SessionToken session,
                                           ChangeableTemplate sourceTemplate,
                                           ChangeableTemplate targetTemplate,
                                           int nodeToCopyID,
                                           int predID,
                                           int succID,
                                           UpdateManager updateManager)
        Copies the given node from the source template between the two nodes in the target template.
        Parameters:
        session - The session which is used to check for access rights on this method.
        sourceTemplate - The template which contains the node to copy.
        targetTemplate - the template where the node should copied to
        nodeToCopyID - the node which is to be copied
        predID - The predecessor of the copied node in the target template.
        succID - The successor of the copied node in the target template.
        updateManager - The UpdateManager where modifications are logged, may be null
        Returns:
        the ID of the copied node in the target template
      • performOperation

        public static int performOperation​(SessionToken session,
                                           ChangeableInstance sourceInstance,
                                           ChangeableInstance targetInstance,
                                           int nodeToCopyID,
                                           int predID,
                                           int succID)
        Copies the given node from the source instance between the two nodes in the target instance.
        Parameters:
        session - The session which is used to check for access rights on this method.
        sourceInstance - The instance which contains the node to copy.
        targetInstance - the instance where the node should copied to
        nodeToCopyID - the node which is to be copied
        predID - The predecessor of the copied node in the target instance.
        succID - The successor of the copied node in the target instance.
        Returns:
        the ID of the copied node in the target instance
      • performOperation

        public static int performOperation​(SessionToken session,
                                           ChangeableInstance sourceInstance,
                                           ChangeableInstance targetInstance,
                                           int nodeToCopyID,
                                           int predID,
                                           int succID,
                                           UpdateManager updateManager)
        Copies the given node from the source instance between the two nodes in the target instance.
        Parameters:
        session - The session which is used to check for access rights on this method.
        sourceInstance - The instance which contains the node to copy.
        targetInstance - the instance where the node should copied to
        nodeToCopyID - the node which is to be copied
        predID - The predecessor of the copied node in the target instance.
        succID - The successor of the copied node in the target instance.
        updateManager - The UpdateManager where modifications are logged, may be null
        Returns:
        the ID of the copied node in the target instance
      • performOperation

        protected static int performOperation​(SessionToken session,
                                              ChangePrimitives sourceProcessGraph,
                                              ChangePrimitives targetProcessGraph,
                                              int nodeToCopyID,
                                              int predID,
                                              int succID,
                                              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.
        sourceProcessGraph - a ChangeableInstance or a ChangeableTemplate for the source.
        targetProcessGraph - a ChangeableInstance or a ChangeableTemplate for the target
        nodeToCopyID - the node which is to be copied
        predID - The predecessor of the copied node in the target process graph.
        succID - The successor of the copied node in the target process graph.
        updateManager - the manager which is responsible for the graphical adaptation of the template (maybe null)
        Returns:
        the ID of the copied node in the target process graph