Class UpdateDataElement
java.lang.Object
de.aristaflow.adept2.core.changeoperations.UpdateDataElement
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPossible(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 bydataElementPropertiesin the instance.static booleanisPossible(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 bydataElementPropertiesin the instance.static booleanisPossible(Template template, DataElement dataElement, ProcessConstants.DataElementProperty... dataElementProperties) Tests if it is valid (concerning structural correctness) to change the data element properties given bydataElementPropertiesin the template.static booleanisPossible(Template template, DataElement dataElement, CheckReport checkReport, ProcessConstants.DataElementProperty... dataElementProperties) Tests if it is valid (concerning structural correctness) to change the data element properties given bydataElementPropertiesin the template.static DataElementperformOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement, UpdateManager updateManager, ProcessConstants.DataElementProperty... dataElementProperties) Updates the data element attributes given bydataElementPropertiesin the instance.static DataElementperformOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement, ProcessConstants.DataElementProperty... dataElementProperties) Updates the data element attributes given bydataElementPropertiesin the instance.static DataElementperformOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement, UpdateManager updateManager, ProcessConstants.DataElementProperty... dataElementProperties) Updates the data element attributes given bydataElementPropertiesin the template.static DataElementperformOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement, ProcessConstants.DataElementProperty... dataElementProperties) Updates the data element attributes given bydataElementPropertiesin the template.protected static DataElementperformOperation(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.
-
Field Details
-
logger
a Logger
-
-
Constructor Details
-
UpdateDataElement
public UpdateDataElement()
-
-
Method Details
-
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 bydataElementPropertiesin 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 templatedataElement- the data element whose properties should be changeddataElementProperties- 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 bydataElementPropertiesin 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 templatedataElement- the data element whose properties should be changedcheckReport- 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 nulldataElementProperties- 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 bydataElementPropertiesin 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 ondataElement- the data element whose properties should be changeddataElementProperties- 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 bydataElementPropertiesin 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 ondataElement- The data element whose properties should be changedcheckReport- 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 nulldataElementProperties- 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 bydataElementPropertiesin 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 sessiontemplate- the changeable template the method is performed ondataElement- the data element whose properties should be changeddataElementProperties- 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 bydataElementPropertiesin 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 sessiontemplate- the changeable template the method is performed ondataElement- the data element whose properties should be changedupdateManager- 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 bydataElementPropertiesin 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 sessioninstance- the changeable instance the method is performed ondataElement- the data element whose properties should be changeddataElementProperties- 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 bydataElementPropertiesin 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 sessioninstance- the changeable instance the method is performed ondataElement- the data element whose properties should be changedupdateManager- 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 sessionprocessGraph- an instance of type ChangeableTemplate or ChangeableInstancedataElement- the data element whose properties should be changedupdateManager- 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.
-