Class UpdateDataEdge


  • public class UpdateDataEdge
    extends Object
    Change Operation to update the properties of a data edge. Call isPossible first to check if the update is valid, than call perform operation to execute the change. TODO Refactor; use a common interface for change operations. TODO enable the change of UserAttributes when concept is clear
    • Field Detail

      • logger

        protected static final Logger logger
        aLogger
    • Constructor Detail

      • UpdateDataEdge

        public UpdateDataEdge()
    • Method Detail

      • isPossible

        public static boolean isPossible​(Template template,
                                         int nodeID,
                                         int dataElementID,
                                         ActivityConstants.AccessType type,
                                         ProcessConstants.DataEdgeProperty... dataEdgeProperties)
        Checks if it is valid (concerning structural correctness) for the data edge (described by the given node ID and the given data element ID) to update the properties given by dataEdgeProperties in the template. The following attributes / properties may be updated and must therefore be tested:
        • OPTIONAL
        • USER_ATTRIBUTE
        Note: the property TYPE is not changeable with this method. Calling isPossible with these property causes an illegal argument exception. Furthermore calling this method with USER_ATTRIBUTE checks if the user attributes of the data edge are changeable at all. To check if a concrete value is changeable use UpdateUserAttribute instead.
        Parameters:
        template - the template where the method is performed on
        nodeID - the id of the node on one side of the data edge
        dataElementID - the id of the data element on the other side of the data edge
        type - the direction of the data edge READ or WRITE
        dataEdgeProperties - the properties which should be changed
        Returns:
        true if the change of the given properties are valid
      • isPossible

        public static boolean isPossible​(Template template,
                                         int nodeID,
                                         int dataElementID,
                                         ActivityConstants.AccessType type,
                                         CheckReport checkReport,
                                         ProcessConstants.DataEdgeProperty... dataEdgeProperties)
        Checks if it is valid (concerning structural correctness) for the data edge (described by the given node ID and the given data element ID) to update the properties given by dataEdgeProperties in the template. The following attributes / properties may be updated and must therefore be tested:
        • OPTIONAL
        • USER_ATTRIBUTE
        If it is not possible the reasons are stored in the checkReport. Note: the property TYPE is not changeable with this method. Calling isPossible with these property stores an error in the checkReport. Furthermore calling this method with USER_ATTRIBUTE checks if the user attributes of the data edge are changeable at all. To check if a concrete value is changeable use UpdateUserAttribute instead.
        Parameters:
        template - the template where the method is performed on
        nodeID - the id of the node on one side of the data edge
        dataElementID - the id of the data element on the other side of the data edge
        type - the direction of the data edge READ or WRITE
        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
        dataEdgeProperties - the properties which should be changed
        Returns:
        true if the change of the given properties are valid
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         int nodeID,
                                         int dataElementID,
                                         ActivityConstants.AccessType type,
                                         ProcessConstants.DataEdgeProperty... dataEdgeProperties)
        Checks if it is valid (concerning structural and state based correctness) for the data edge (described by the given node ID and the given data element ID) to update the properties given by dataEdgeProperties in the instance. The following attributes / properties may be updated and must therefore be tested:
        • OPTIONAL
        • USER_ATTRIBUTE
        Note: the property TYPE is not changeable with this method. Calling isPossible with these property causes an illegal argument exception. Furthermore calling this method with USER_ATTRIBUTE checks if the user attributes of the data edge are changeable at all. To check if a concrete value is changeable use UpdateUserAttribute instead.
        Parameters:
        instance - the changeable instance where the method is performed on
        nodeID - the id of the node on one side of the data edge
        dataElementID - the id of the data element on the other side of the data edge
        type - the direction of the data edge READ or WRITE
        dataEdgeProperties - the properties which should be changed
        Returns:
        true if the change of the given properties are valid
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         int nodeID,
                                         int dataElementID,
                                         ActivityConstants.AccessType type,
                                         CheckReport checkReport,
                                         ProcessConstants.DataEdgeProperty... dataEdgeProperties)
        Checks if it is valid (concerning structural and state based correctness) for the data edge (described by the given node ID and the given data element ID) to update the properties given by dataEdgeProperties in the instance. The following attributes / properties may be updated and must therefore be tested:
        • USER_ATTRIBUTE
        If it is not possible the reasons are stored in the checkReport. Note: the property TYPE is not changeable with this method. Calling isPossible with these property stores an error in the checkReport. Furthermore calling this method with USER_ATTRIBUTE checks if the user attributes of the data edge are changeable at all. To check if a concrete value is changeable use UpdateUserAttribute instead.
        Parameters:
        instance - the changeable instance where the method is performed on
        nodeID - the id of the node on one side of the data edge
        dataElementID - the id of the data element on the other side of the data edge
        type - the direction of the data edge READ or WRITE
        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
        dataEdgeProperties - the properties which should be changed
        Returns:
        true if the change of the given properties are valid
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableTemplate template,
                                            int nodeID,
                                            int dataElementID,
                                            ActivityConstants.AccessType type,
                                            DataEdge dataEdge,
                                            ProcessConstants.DataEdgeProperty... dataEdgeProperties)
        Updates the data edge (described by the given node ID and the given data element ID) in the given template using the data in the given data edge object. The given data edge object is just used as a temporary container for the new values. The properties specify which attributes of the data edge will be updated. The following properties may be updated from the given object:
        • OPTIONAL
        Parameters:
        session - the related session
        template - the changeable template where the method is performed on
        nodeID - the id of the node on one side of the data edge
        dataElementID - the id of the data element on the other side of the data edge
        type - the direction of the data edge READ or WRITE
        dataEdge - a temporary data edge object, containing the new values
        dataEdgeProperties - the properties which should be changed
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableTemplate template,
                                            int nodeID,
                                            int dataElementID,
                                            ActivityConstants.AccessType type,
                                            DataEdge dataEdge,
                                            UpdateManager updateManager,
                                            ProcessConstants.DataEdgeProperty... dataEdgeProperties)
        Updates the data edge (described by the given node ID and the given data element ID) in the given template using the data in the given data edge object. The given data edge object is just used as a temporary container for the new values. The properties specify which attributes of the data edge will be updated. (Operation with updateManager) The following properties may be updated from the given object:
        • OPTIONAL
        Parameters:
        session - the related session
        template - the changeable template where the method is performed on
        nodeID - the id of the node on one side of the data edge
        dataElementID - the id of the data element on the other side of the data edge
        type - the direction of the data edge READ or WRITE
        dataEdge - a temporary data edge object, containing the new values
        updateManager - The update manager which will be informed about process changes.
        dataEdgeProperties - the properties which should be changed
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableInstance instance,
                                            int nodeID,
                                            int dataElementID,
                                            ActivityConstants.AccessType type,
                                            DataEdge dataEdge,
                                            ProcessConstants.DataEdgeProperty... dataEdgeProperties)
        Updates the data edge (described by the given node ID and the given data element ID) in the given instance using the data in the given data edge object. The given data edge object is just used as a temporary container for the new values. The properties specify which attributes of the data edge will be updated. The following properties may be updated from the given object:
        • OPTIONAL
        Parameters:
        session - the related session
        instance - the changeable instance where the method is performed on
        nodeID - the id of the node on one side of the data edge
        dataElementID - the id of the data element on the other side of the data edge
        type - the direction of the data edge READ or WRITE
        dataEdge - a temporary data edge object, containing the new values
        dataEdgeProperties - the properties which should be changed
      • performOperation

        public static void performOperation​(SessionToken session,
                                            ChangeableInstance instance,
                                            int nodeID,
                                            int dataElementID,
                                            ActivityConstants.AccessType type,
                                            DataEdge dataEdge,
                                            UpdateManager updateManager,
                                            ProcessConstants.DataEdgeProperty... dataEdgeProperties)
        Updates the data edge (described by the given node ID and the given data element ID) in the given instance using the data in the given data edge object. The given data edge object is just used as a temporary container for the new values. The properties specify which attributes of the data edge will be updated. (Operation with updateManager) The following properties may be updated from the given object:
        • OPTIONAL
        Parameters:
        session - the related session
        instance - the changeable instance where the method is performed on
        nodeID - the id of the node on one side of the data edge
        dataElementID - the id of the data element on the other side of the data edge
        type - the direction of the data edge READ or WRITE
        dataEdge - a temporary data edge object, containing the new values
        updateManager - The update manager which will be informed about process changes.
        dataEdgeProperties - the properties which should be changed
      • performOperation

        protected static void performOperation​(SessionToken session,
                                               ChangePrimitives processGraph,
                                               int nodeID,
                                               int dataElementID,
                                               ActivityConstants.AccessType type,
                                               DataEdge dataEdge,
                                               UpdateManager updateManager,
                                               ProcessConstants.DataEdgeProperty... dataEdgeProperties)
        Worker method to do the structural changes for both changeable templates and changeable instances. The following properties may be updated from the given object:
        • OPTIONAL
        Parameters:
        session - the related session
        processGraph - an instance of type ChangeableTemplate or ChangeableInstance
        nodeID - the id of the node on one side of the data edge
        dataElementID - the id of the data element on the other side of the data edge
        type - the direction of the data edge READ or WRITE
        dataEdge - a temporary data edge object, containing the new values
        updateManager - The update manager which will be informed about process changes.
        dataEdgeProperties - the properties which should be changed