Class DeleteDataElement
java.lang.Object
de.aristaflow.adept2.core.changeoperations.DeleteDataElement
ChangeOperation to delete a data element (including its in- and outgoing data
edges).
Call isPossible first to check if the deletion is valid, than call perform
operation to execute the change
TODO use the updateManager to update the graphical representation (at the
moment the data elements are updated implicitly by the EndTransaction
operation)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPossible(ChangeableInstance instance, DataElement dataElement) checks if it is valid (concerning structural and state-based correctness) to delete the given data element from the instancestatic booleanisPossible(ChangeableInstance instance, DataElement dataElement, CheckReport checkReport) checks if it is valid (concerning structural and state based correctness) to delete the given data element from the instance If not, the reasons are stored in the check report.static booleanisPossible(Template template, DataElement dataElement) checks if it is valid (concerning structural correctness) to delete the given data element from the templatestatic booleanisPossible(Template template, DataElement dataElement, CheckReport checkReport) Checks if it is valid (concerning structural correctness) to delete the given data element from the template.static voidperformOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement) Deletes the given data element from the instance.static voidperformOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement, UpdateManager updateManager) Deletes the given data element from the instance Possibly assigned in- or outgoing data edges are also deleted.static voidperformOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement) Deletes the given data element from the template.static voidperformOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement, UpdateManager updateManager) Deletes the given data element from the template Possibly assigned in- or outgoing data edges are also deleted.protected static voidperformOperation(SessionToken session, ChangePrimitives processGraph, DataElement dataElement, UpdateManager updateManager) Worker method to do the structural changes for both changeable templates and changeable instances.
-
Field Details
-
logger
a Logger
-
-
Constructor Details
-
DeleteDataElement
public DeleteDataElement()
-
-
Method Details
-
isPossible
checks if it is valid (concerning structural correctness) to delete the given data element from the template- Parameters:
template- the template where the data element should be deleteddataElement- the data element which should be deleted- Returns:
- True, if the deletion is valid
-
isPossible
public static boolean isPossible(Template template, DataElement dataElement, CheckReport checkReport) Checks if it is valid (concerning structural correctness) to delete the given data element from the template. If not, the reasons are stored in the check report.- Parameters:
template- the template where the data element should be deleteddataElement- the data element which should be deletedcheckReport- 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- Returns:
- True, if the deletion is valid
-
isPossible
checks if it is valid (concerning structural and state-based correctness) to delete the given data element from the instance- Parameters:
instance- the changeable instance where the data element should be deleteddataElement- the data element which should be deleted- Returns:
- True, if the deletion is valid
-
isPossible
public static boolean isPossible(ChangeableInstance instance, DataElement dataElement, CheckReport checkReport) checks if it is valid (concerning structural and state based correctness) to delete the given data element from the instance If not, the reasons are stored in the check report.- Parameters:
instance- the changeable instance where the data element should be deleteddataElement- the data element which should be deletedcheckReport- 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- Returns:
- True, if the deletion is valid
-
performOperation
public static void performOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement) Deletes the given data element from the template. Possibly assigned in- or outgoing data edges are also deleted.- Parameters:
session- The session which is used to check for access rights on this method.template- the template where the change is performed ondataElement- the data element which is to be deleted
-
performOperation
public static void performOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement, UpdateManager updateManager) Deletes the given data element from the template Possibly assigned in- or outgoing data edges are also deleted. (with updateManager).- Parameters:
session- The session which is used to check for access rights on this method.template- the template where the change is performed ondataElement- the data element which is to be deletedupdateManager- the manager which is responsible for the graphical adaptation of the template (maybe null)
-
performOperation
public static void performOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement) Deletes the given data element from the instance. Possibly assigned in- or outgoing data edges are also deleted.- Parameters:
session- The session which is used to check for access rights on this method.instance- the changeable instance where the change is performed ondataElement- the data element which is to be deleted
-
performOperation
public static void performOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement, UpdateManager updateManager) Deletes the given data element from the instance Possibly assigned in- or outgoing data edges are also deleted. (with updateManager).- Parameters:
session- The session which is used to check for access rights on this method.instance- the changeable instance where the change is performed ondataElement- the data element which is to be deletedupdateManager- the manager which is responsible for the graphical adaptation of the template (maybe null)
-
performOperation
protected static void performOperation(SessionToken session, ChangePrimitives processGraph, DataElement dataElement, UpdateManager updateManager) Worker method to do the structural changes for both changeable templates and changeable instances.- Parameters:
session- The session which is used to check for access rights on this method.processGraph- an instance of type ChangeableTemplate or ChangeableInstancedataElement- the data element which is to be deletedupdateManager- the manager which is responsible for the graphical adaptation of the template (maybe null)
-