Class ReconnectDataEdge


  • public class ReconnectDataEdge
    extends Object
    The intended task of this change operation is to reconnect an already existent and already to a parameter connected data edge to a parameter which is disabled or unconnected. Call isPossible first to check if the change is valid, than call perform operation to execute the change. TODO Refactor; use a common interface for change operations. Note: if a data element should be mapped to a parameter which is actually connected use change operation SwapDataElementParameterConnection instead
    • Constructor Detail

      • ReconnectDataEdge

        public ReconnectDataEdge()
    • Method Detail

      • isPossible

        public static boolean isPossible​(Template template,
                                         int nodeID,
                                         int dataElementID,
                                         DataEdge dataEdge,
                                         ProcessModelParameter param)
        Check if it is possible to reconnect the given data edge (respectively the connected data element) to the given parameter in the template.
        Parameters:
        template - the template where the change operation is performed on.
        nodeID - the node where the data edge is connected with
        dataElementID - the data element where the data edge is connected with
        dataEdge - the data edge object
        param - the parameter the data element (via data edge) should be connected with
        Returns:
        true if possible
      • isPossible

        public static boolean isPossible​(Template template,
                                         int nodeID,
                                         int dataElementID,
                                         DataEdge dataEdge,
                                         ProcessModelParameter param,
                                         CheckReport checkReport)
        Check if it is possible to reconnect the given data edge (respectively the connected data element) to the given parameter in the template. If the check fails the reason is stored in the given checkReport (provided that checkReport is not null)
        Parameters:
        template - the template where the change operation is performed on.
        nodeID - the node where the data edge is connected with
        dataElementID - the data element where the data edge is connected with
        dataEdge - the data edge object
        param - the parameter the data element (via data edge) should be connected with
        checkReport - an (empty) checkReport object which contains 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 instance,
                                         int nodeID,
                                         int dataElementID,
                                         DataEdge dataEdge,
                                         ProcessModelParameter param)
        Check if it is possible to reconnect the given data edge (respectively the connected data element) to the given parameter in the instance .
        Parameters:
        instance - the changeable instance where the change operation is performed on.
        nodeID - the node where the data edge is connected with
        dataElementID - the data element where the data edge is connected with
        dataEdge - the data edge object
        param - the parameter the data element (via data edge) should be connected with
        Returns:
        true if possible
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         int nodeID,
                                         int dataElementID,
                                         DataEdge dataEdge,
                                         ProcessModelParameter param,
                                         CheckReport checkReport)
        Check if it is possible to reconnect the given data edge (respectively the connected data element) to the given parameter in the template. If the check fails the reason is stored in the given checkReport (provided that checkReport is not null)
        Parameters:
        instance - the changeable instance where the change operation is performed on.
        nodeID - the node where the data edge is connected with
        dataElementID - the data element where the data edge is connected with
        dataEdge - the data edge object
        param - the parameter the data element (via data edge) should be connected with
        checkReport - an (empty) checkReport object which contains the reason why the isPossible failed (i.e. in the case the method returns false), may be null
        Returns:
        true if possible
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableTemplate template,
                                            int nodeID,
                                            int dataElementID,
                                            DataEdge dataEdge,
                                            ProcessModelParameter param)
        Connect the given data element with the given parameter (via the given already existing data edge) in the template.
        Parameters:
        session - The session which is used to check for access rights on this method.
        template - the related template
        param - the parameter where the data element (given by dataElementID) is to be connected with
        nodeID - the node where the data edge is connected with
        dataElementID - the data element where the data edge is connected with
        dataEdge - the edge object
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableTemplate template,
                                            int nodeID,
                                            int dataElementID,
                                            DataEdge dataEdge,
                                            ProcessModelParameter param,
                                            UpdateManager updateManager)
        Connect the given data element with the given parameter (via the given already existing data edge) in the template. (with updateManager)
        Parameters:
        session - The session which is used to check for access rights on this method.
        template - the related template
        param - the parameter where the data element (given by dataElementID) is to be connected with
        nodeID - the node where the data edge is connected with
        dataElementID - the data element where the data edge is connected with
        dataEdge - the edge object
        updateManager - the manager who controls the update of the visual graph components. (maybe null)
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableInstance instance,
                                            int nodeID,
                                            int dataElementID,
                                            DataEdge dataEdge,
                                            ProcessModelParameter param)
        Connect the given data element with the given parameter (via the given already existing data edge) in the instance.
        Parameters:
        session - The session which is used to check for access rights on this method.
        instance - the related changeable instance
        param - the parameter where the data element (given by dataElementID) is to be connected with
        nodeID - the node where the data edge is connected with
        dataElementID - the data element where the data edge is connected with
        dataEdge - the edge object
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableInstance instance,
                                            int nodeID,
                                            int dataElementID,
                                            DataEdge dataEdge,
                                            ProcessModelParameter param,
                                            UpdateManager updateManager)
        Connect the given data element with the given parameter (via the given already existing data edge) in the instance. (with updateManager)
        Parameters:
        session - The session which is used to check for access rights on this method.
        instance - the related changeable instance
        param - the parameter where the data element (given by dataElementID) is to be connected with
        nodeID - the node where the data edge is connected with
        dataElementID - the data element where the data edge is connected with
        dataEdge - the edge object
        updateManager - the manager who controls the update of the visual graph components. (maybe null)
      • performOperation

        protected static void performOperation​(SessionToken session,
                                               ChangePrimitives processGraph,
                                               int nodeID,
                                               int dataElementID,
                                               DataEdge dataEdge,
                                               ProcessModelParameter param,
                                               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
        param - the parameter where the data element (given by dataElementID) is to be connected with
        nodeID - the node where the data edge is connected with
        dataElementID - the data element where the data edge is connected with
        dataEdge - the edge object
        updateManager - the manager who controls the update of the visual graph components. (maybe null)