Class UpdateDataElement


  • public class UpdateDataElement
    extends Object
    Change Operation to update the properties of a data element. 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
        a Logger
    • Constructor Detail

      • UpdateDataElement

        public UpdateDataElement()
    • Method Detail

      • isPossible

        public static boolean isPossible​(Template template,
                                         DataElement dataElement,
                                         ProcessConstants.DataElementProperty... dataElementProperties)
        Tests if it is valid (concerning structural correctness) to change the data element properties given by dataElementProperties in the template. The following attributes / properties may be updated and must therefore be tested:
        • NAME
        • DESCRIPTION
        • TYPE
        • USER_DEFINED_TYPE
        • IDENTIFIER
        • VIRTUAL
        Parameters:
        template - the related template
        dataElement - the data element whose properties should be changed
        dataElementProperties - A constant describing the data element attribute(s) which are to be changed
        Returns:
        true if the change is possible
      • isPossible

        public static boolean isPossible​(Template template,
                                         DataElement dataElement,
                                         CheckReport checkReport,
                                         ProcessConstants.DataElementProperty... dataElementProperties)
        Tests if it is valid (concerning structural correctness) to change the data element properties given by dataElementProperties in the template. The following attributes / properties may be updated and must therefore be tested:
        • NAME
        • DESCRIPTION
        • TYPE
        • USER_DEFINED_TYPE
        • IDENTIFIER
        • VIRTUAL
        If it is not possible the reasons are stored in the checkReport.
        Parameters:
        template - the related template
        dataElement - the data element whose properties should be changed
        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
        dataElementProperties - A constant describing the data element attribute(s) which are to be changed
        Returns:
        true if the change is possible
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         DataElement dataElement,
                                         ProcessConstants.DataElementProperty... dataElementProperties)
        Tests if it is valid (concerning structural and state-based correctness) to change the data element properties given by dataElementProperties in the instance. The following attributes / properties may be updated and must therefore be tested:
        • NAME
        • DESCRIPTION
        • TYPE
        • USER_DEFINED_TYPE
        • IDENTIFIER
        • VIRTUAL
        Parameters:
        instance - the changeable instance the method is performed on
        dataElement - the data element whose properties should be changed
        dataElementProperties - A constant describing the data element attribute(s) which are to be changed
        Returns:
        true if the change is possible
      • isPossible

        public static boolean isPossible​(ChangeableInstance instance,
                                         DataElement dataElement,
                                         CheckReport checkReport,
                                         ProcessConstants.DataElementProperty... dataElementProperties)
        Tests if it is valid (concerning structural and state-based correctness) to change the data element properties given by dataElementProperties in the instance. The following attributes / properties may be updated and must therefore be tested:
        • NAME
        • DESCRIPTION
        • TYPE
        • USER_DEFINED_TYPE
        • IDENTIFIER
        • VIRTUAL
        If it is not possible the reasons are stored in the checkReport.
        Parameters:
        instance - the changeable instance the method is performed on
        dataElement - The data element whose properties should be changed
        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
        dataElementProperties - A constant describing the data element attribute(s) which are to be changed
        Returns:
        true if the change is possible
      • performOperation

        public static DataElement performOperation​(SessionToken session,
                                                   ChangeableTemplate template,
                                                   DataElement dataElement,
                                                   ProcessConstants.DataElementProperty... dataElementProperties)
        Updates the data element attributes given by dataElementProperties in the template. The values of the changed attributes are contained in the given dataElement itself. The given data element is used as a container only. The following attributes / properties may be updated:
        • NAME
        • DESCRIPTION
        • TYPE
        • USER_DEFINED_TYPE
        • IDENTIFIER
        • VIRTUAL
        Parameters:
        session - the related session
        template - the changeable template the method is performed on
        dataElement - the data element whose properties should be changed
        dataElementProperties - A constant describing the changed data element attribute(s)
        Returns:
        The updated data element object.
      • performOperation

        public static DataElement performOperation​(SessionToken session,
                                                   ChangeableTemplate template,
                                                   DataElement dataElement,
                                                   UpdateManager updateManager,
                                                   ProcessConstants.DataElementProperty... dataElementProperties)
        Updates the data element attributes given by dataElementProperties in the template. The values of the changed attributes are contained in the given dataElement itself. The given data element is used as a container only. (Method with updateManager) The following attributes / properties may be updated:
        • NAME
        • DESCRIPTION
        • TYPE
        • USER_DEFINED_TYPE
        • IDENTIFIER
        • VIRTUAL
        Parameters:
        session - the related session
        template - the changeable template the method is performed on
        dataElement - the data element whose properties should be changed
        updateManager - the manager who controls the update of the visual graph components.
        dataElementProperties - A constant describing the changed data element attribute(s)
        Returns:
        The updated data element object.
      • performOperation

        public static DataElement performOperation​(SessionToken session,
                                                   ChangeableInstance instance,
                                                   DataElement dataElement,
                                                   ProcessConstants.DataElementProperty... dataElementProperties)
        Updates the data element attributes given by dataElementProperties in the instance. The values of the changed attributes are contained in the given dataElement itself. The given data element is used as a container only. The following attributes / properties may be updated:
        • NAME
        • DESCRIPTION
        • TYPE
        • USER_DEFINED_TYPE
        • IDENTIFIER
        • VIRTUAL
        Parameters:
        session - the related session
        instance - the changeable instance the method is performed on
        dataElement - the data element whose properties should be changed
        dataElementProperties - A constant describing the changed data element attribute(s)
        Returns:
        The updated data element object.
      • performOperation

        public static DataElement performOperation​(SessionToken session,
                                                   ChangeableInstance instance,
                                                   DataElement dataElement,
                                                   UpdateManager updateManager,
                                                   ProcessConstants.DataElementProperty... dataElementProperties)
        Updates the data element attributes given by dataElementProperties in the instance. The values of the changed attributes are contained in the given dataElement itself. The given data element is used as a container only. (Method with updateManager) The following attributes / properties may be updated:
        • NAME
        • DESCRIPTION
        • TYPE
        • USER_DEFINED_TYPE
        • IDENTIFIER
        • VIRTUAL
        Parameters:
        session - the related session
        instance - the changeable instance the method is performed on
        dataElement - the data element whose properties should be changed
        updateManager - the manager who controls the update of the visual graph components.
        dataElementProperties - A constant describing the changed data element attribute(s)
        Returns:
        The updated data element object.
      • performOperation

        protected static DataElement performOperation​(SessionToken session,
                                                      ChangePrimitives processGraph,
                                                      DataElement dataElement,
                                                      UpdateManager updateManager,
                                                      ProcessConstants.DataElementProperty... dataElementProperties)
        Worker method to do the structural changes for both changeable templates and changeable instances.
        Parameters:
        session - the related session
        processGraph - an instance of type ChangeableTemplate or ChangeableInstance
        dataElement - the data element whose properties should be changed
        updateManager - the manager who controls the update of the visual graph components.
        dataElementProperties - A constant describing the changed data element attribute(s)
        Returns:
        The updated data element object.