Class UpdateNode


  • public class UpdateNode
    extends Object
    Change Operation to update the properties of a node. 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.
    • Field Detail

      • logger

        protected static final Logger logger
        aLogger
    • Constructor Detail

      • UpdateNode

        public UpdateNode()
    • Method Detail

      • isPossible

        public static boolean isPossible​(Template template,
                                         Node node,
                                         ProcessConstants.NodeProperty... nodeProperties)
        Checks if it is valid (concerning structural correctness) for the given node to update the properties given by nodeProperties in the template. The following attributes / properties may be updated and must therefore be tested:
        • NAME
        • DESCRIPTION
        • USER_ATTRIBUTE (checked here, updated by UpdateUserAttribute)
        • SYSTEM_READ_PARAMS
        • SYSTEM_WRITE_PARAMS
        Note: the property EXECUTABLE_BUSINESS_PROCESS (and implicitly CONNECTOR_PARAMETER_MAPPING) is updated by assign/removeExecutableBusinessProcess. Calling isPossible with these properties causes an illegal argument exception.
        Parameters:
        template - the template where the method is performed on
        node - the node which should be updated
        nodeProperties - the properties which should be changed
        Returns:
        true if the change of the given properties are valid
      • isPossible

        public static boolean isPossible​(Template template,
                                         Node node,
                                         CheckReport checkReport,
                                         ProcessConstants.NodeProperty... nodeProperties)
        Checks if it is valid (concerning structural correctness) for the given node to update the properties given by nodeProperties in the template. The following attributes / properties may be updated and must therefore be tested:
        • NAME
        • DESCRIPTION
        • STAFF_ASSIGNMENT_RULE
        • USER_ATTRIBUTE (checked here, updated by UpdateUserAttribute)
        If it is not possible the reasons are stored in the checkReport. Note: the property EXECUTABLE_BUSINESS_PROCESS (and implicitly CONNECTOR_PARAMETER_MAPPING) is updated by assign/removeExecutableBusinessProcess. Calling isPossible with these properties stores an error in the checkReport.
        Parameters:
        template - the template where the method is performed on
        node - the node where the the EBP is assigned to
        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
        nodeProperties - the properties which should be changed
        Returns:
        true if the change of the given properties are valid
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         Node node,
                                         ProcessConstants.NodeProperty... nodeProperties)
        Checks if it is valid (concerning structural and state based correctness) for the given node to update the properties given by nodeProperties in the instance. The following attributes / properties may be updated and must therefore be tested:
        • NAME
        • DESCRIPTION
        • STAFF_ASSIGNMENT_RULE
        • USER_ATTRIBUTE (checked here, updated by UpdateUserAttribute)
        Note: the property EXECUTABLE_BUSINESS_PROCESS (and implicitly CONNECTOR_PARAMETER_MAPPING) is updated by assign/removeExecutableBusinessProcess. Calling isPossible with these properties causes an illegal argument exception.
        Parameters:
        instance - the changeable instance where the method is performed on
        node - the node which should be updated
        nodeProperties - the properties which should be changed
        Returns:
        true if the change of the given properties are valid
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         Node node,
                                         CheckReport checkReport,
                                         ProcessConstants.NodeProperty... nodeProperties)
        Checks if it is valid (concerning structural and state based correctness) for the given node to update the properties given by nodeProperties in the instance. The following attributes / properties may be updated and must therefore be tested:
        • NAME
        • DESCRIPTION
        • STAFF_ASSIGNMENT_RULE
        • USER_ATTRIBUTE (checked here, updated by UpdateUserAttribute)
        If it is not possible the reasons are stored in the checkReport. Note: the property EXECUTABLE_BUSINESS_PROCESS (and implicitly CONNECTOR_PARAMETER_MAPPING) is updated by assign/removeExecutableBusinessProcess. Calling isPossible with these properties stores an error in the checkReport.
        Parameters:
        instance - the changeable instance where the method is performed on
        node - the node where the the EBP is assigned to
        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
        nodeProperties - the properties which should be changed
        Returns:
        true if the change of the given properties are valid
      • performOperation

        public static void performOperation​(ChangeableTemplate template,
                                            Node node,
                                            ProcessConstants.NodeProperty... nodeProperties)
        Updates a node object in the given template using the data in the given node. The given node is just used as a temporary container for the new values. The properties specify which attributes of the node will be updated. The following properties may be updated from the given object:
        • NAME
        • DESCRIPTION
        • STAFF_ASSIGNMENT_RULE
        Note: Removing/Assigning an ExecutableBusinessProcess from/to a node and the ConnectorParameterMapping is done with the change operation Remove/AssignExecutableBusinessProcess. Calling this method with these properties throws an IllegalArgumentException. Changing attributes of the ExecutableBusinessProcsess of a node:
        Please use UpdateExecutableBusinessProcess
        FIXME link to the conceptual description of the data-connector.
        Parameters:
        template - the related template
        node - A temporary node object, containing the new values.
        nodeProperties - Possible values of NodeProperty are described above.
      • performOperation

        public static void performOperation​(ChangeableTemplate template,
                                            Node node,
                                            UpdateManager updateManager,
                                            ProcessConstants.NodeProperty... nodeProperties)
        Updates a node object in the given template using the data in the given node. The given node is just used as a temporary container for the new values. The properties specify which attributes of the node will be updated in the given template. (Operation with updateManager) The following properties may be updated from the given object:
        • NAME
        • DESCRIPTION
        • STAFF_ASSIGNMENT_RULE
        Note: Removing/Assigning an ExecutableBusinessProcess from/to a node and the ConnectorParameterMapping is done with the change operation Remove/AssignExecutableBusinessProcess. Calling this method with these properties throws an IllegalArgumentException. Changing attributes of the ExecutableBusinessProcsess of a node:
        Please use UpdateExecutableBusinessProcess
        FIXME link to the conceptual description of the data-connector.
        Parameters:
        template - the related template
        node - A temporary node object, containing the new values.
        updateManager - The update manager which will be informed about process changes.
        nodeProperties - Possible values of NodeProperty are described above.
      • performOperation

        public static void performOperation​(ChangeableInstance instance,
                                            Node node,
                                            ProcessConstants.NodeProperty... nodeProperties)
        Updates a node object in the given instance using the data in the given node. The given node is just used as a temporary container for the new values. The properties specify which attributes of the node will be updated. The following properties may be updated from the given object:
        • NAME
        • DESCRIPTION
        • STAFF_ASSIGNMENT_RULE
        Note: Removing/Assigning an ExecutableBusinessProcess from/to a node and the ConnectorParameterMapping is done with the change operation Remove/AssignExecutableBusinessProcess. Calling this method with these properties throws an IllegalArgumentException. Changing attributes of the ExecutableBusinessProcsess of a node:
        Please use UpdateExecutableBusinessProcess.
        FIXME link to the conceptual description of the data-connector.
        Parameters:
        instance - the related changeable instance
        node - A temporary node object, containing the new values.
        nodeProperties - Possible values of NodeProperty are described above.
      • performOperation

        public static void performOperation​(ChangeableInstance instance,
                                            Node node,
                                            UpdateManager updateManager,
                                            ProcessConstants.NodeProperty... nodeProperties)
        Updates a node object in the given instance using the data in the given node. The given node is just used as a temporary container for the new values. The properties specify which attributes of the node will be updated in the given template. (Operation with updateManager) The following properties may be updated from the given object:
        • NAME
        • DESCRIPTION
        • STAFF_ASSIGNMENT_RULE
        Note: Removing/Assigning an ExecutableBusinessProcess from/to a node and the ConnectorParameterMapping is done with the change operation Remove/AssignExecutableBusinessProcess. Calling this method with these properties throws an IllegalArgumentException. Changing attributes of the ExecutableBusinessProcsess of a node:
        Please use UpdateExecutableBusinessProcess.
        FIXME link to the conceptual description of the data-connector.
        Parameters:
        instance - the related changeable instance
        node - A temporary node object, containing the new values.
        updateManager - The update manager which will be informed about process changes.
        nodeProperties - Possible values of NodeProperty are described above.
      • performOperation

        protected static void performOperation​(ChangePrimitives processGraph,
                                               Node node,
                                               UpdateManager updateManager,
                                               ProcessConstants.NodeProperty... nodeProperties)
        Worker method to do the structural changes for both changeable templates and changeable instances. This method is for internal use only since it offers the possibility to update the ExecutableBusinessProcess property and name, description and staff assignment rule properties with parameter references. For a complete assignment/deletion of an executable business process use change operation Assign/RemoveExecutableBusinessProcess instead. The following properties may be updated from the given object:
        • NAME
        • DESCRIPTION
        • STAFF_ASSIGNMENT_RULE
        • EXECUTABLE_BUSINESS_PROCESS (and implicitly CONNECTOR_PARAMETER_MAPPING)
        • SYSTEM_READ_PARAMS
        • SYSTEM_WRITE_PARAMS
        Removing the ExecutableBusinessProcsess from a node:
        If EXECUTABLE_BUSINESS_PROCESS is set in the parameter nodeProperties and getExecutableBusinessProcess() of the given node returns null, the EBP and the parameter/data-connector mapping is removed from the node as well as all data-connectors which are not connected (i.e marked as disabled or connect later) with a data edge.
        Setting a new ExecutableBusinessProcsess to a node:
        If the property EXECUTABLE_BUSINESS_PROCESS is set, and the attribute returns a value, the returned ExecutableBusinessProcess will be used as a new EBP. This means that the old EBP is removed (like described above), and afterwards added. Changing attributes of the ExecutableBusinessProcsess of a node:
        Please use UpdateExecutableBusinessProcess.
        Note: The declaration of CONNECTOR_PARAMETER_MAPPING in nodeProperties is senseless because the data parameter mapping is always changed if the EBP is changed. Therefore calling the method with the argument CONNECTOR_PARAMETER_MAPPING will produce an exception. In turn to that calling the method with EXECUTABLE_BUSINESS_PROCESS forces the user to store a correct connector mapping in the given node object. FIXME link to the conceptual description of the data-connector.
        Parameters:
        processGraph - an instance of type ChangeableTemplate or ChangeableInstance
        node - A temporary node object, containing the new values.
        updateManager - The update manager which will be informed about process changes.
        nodeProperties - Possible values of NodeProperty are described above.
      • autoStartEnabled

        public static boolean autoStartEnabled​(Template template,
                                               Node node)
        Parameters:
        template -
        node -
        Returns:
        true, if autoStart could be set, false otherwise
      • btnAutoStartEnabled

        public static boolean btnAutoStartEnabled​(Template template,
                                                  Node node,
                                                  String nodeSAR,
                                                  Map<String,​Dependency> dependencies)
        Parameters:
        template -
        node -
        nodeSAR -
        dependencies -
        Returns:
        true, if autoStart could be set, false otherwise