Class DeleteDataElement

java.lang.Object
de.aristaflow.adept2.core.changeoperations.DeleteDataElement

public class DeleteDataElement extends Object
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 Details

    • logger

      protected static final Logger logger
      a Logger
  • Constructor Details

    • DeleteDataElement

      public DeleteDataElement()
  • Method Details

    • isPossible

      public static boolean isPossible(Template template, DataElement dataElement)
      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 deleted
      dataElement - 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 deleted
      dataElement - the data element which should be deleted
      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
      Returns:
      True, if the deletion is valid
    • isPossible

      public static boolean isPossible(ChangeableInstance instance, DataElement dataElement)
      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 deleted
      dataElement - 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 deleted
      dataElement - the data element which should be deleted
      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
      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 on
      dataElement - 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 on
      dataElement - the data element which is to be deleted
      updateManager - 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 on
      dataElement - 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 on
      dataElement - the data element which is to be deleted
      updateManager - 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 ChangeableInstance
      dataElement - the data element which is to be deleted
      updateManager - the manager which is responsible for the graphical adaptation of the template (maybe null)