Class UpdateDataElement
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.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.
-
-
Constructor Summary
Constructors Constructor Description UpdateDataElement()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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 bydataElementProperties
in the instance.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 bydataElementProperties
in the instance.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 bydataElementProperties
in the template.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 bydataElementProperties
in the template.static DataElement
performOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement, UpdateManager updateManager, ProcessConstants.DataElementProperty... dataElementProperties)
Updates the data element attributes given bydataElementProperties
in the instance.static DataElement
performOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement, ProcessConstants.DataElementProperty... dataElementProperties)
Updates the data element attributes given bydataElementProperties
in the instance.static DataElement
performOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement, UpdateManager updateManager, ProcessConstants.DataElementProperty... dataElementProperties)
Updates the data element attributes given bydataElementProperties
in the template.static DataElement
performOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement, ProcessConstants.DataElementProperty... dataElementProperties)
Updates the data element attributes given bydataElementProperties
in the template.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.
-
-
-
Field Detail
-
logger
protected static final Logger logger
a Logger
-
-
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 bydataElementProperties
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 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 bydataElementProperties
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 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 bydataElementProperties
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 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 bydataElementProperties
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 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 bydataElementProperties
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 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 bydataElementProperties
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 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 bydataElementProperties
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 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 bydataElementProperties
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 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.
-
-