Class InsertDataElement
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.InsertDataElement
-
public class InsertDataElement extends Object
Change operation for insertion of a new data element. Call isPossible first to check if the insertion is valid, than call perform operation to execute the change. TODO Refactor; use a common interface for change operations.- Author:
- Martin Jurisch
-
-
Constructor Summary
Constructors Constructor Description InsertDataElement()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPossible(ChangeableInstance instance)
Check if it is possible (concerning structural and state based correctness) to insert a new data element in the instance.static boolean
isPossible(ChangeableInstance instance, DataElement dataElement)
Check if it is possible (concerning structural and state based correctness) to insert a new data element given as a data element container object (without an id) in the instance.static boolean
isPossible(ChangeableInstance instance, DataElement dataElement, CheckReport checkReport)
Check if it is possible (concerning structural and state based correctness) to insert a new data element given as a data element container object (without an id) in the instance.static boolean
isPossible(ChangeableInstance instance, CheckReport checkReport)
Check if it is possible to insert a new data element (concerning structural and state based correctness) in the instance.static boolean
isPossible(Template template)
Check if it is possible (concerning structural aspects) to insert a new data element in the template.static boolean
isPossible(Template template, DataElement dataElement)
Check if it is possible (concerning structural aspects) to insert a new data element given as a data element container object (without an id) in the template.static boolean
isPossible(Template template, DataElement dataElement, CheckReport checkReport)
Check if it is possible (concerning structural aspects) to insert a new data element given as a data element container object (without an id) in the template.static boolean
isPossible(Template template, CheckReport checkReport)
Check if it is possible to insert a new data element (concerning structural aspects) to insert a new data element in the template.static DataElement
performOperation(SessionToken session, ChangeableInstance instance)
Insert a new data element in the instance.static DataElement
performOperation(SessionToken session, ChangeableInstance instance, UpdateManager updateManager)
Insert a new data element in the instance (with updateManager).static DataElement
performOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement)
Insert a new data element in the instance.static DataElement
performOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement, UpdateManager updateManager)
Insert a new data element in the instance.static DataElement
performOperation(SessionToken session, ChangeableTemplate template)
Insert a new data element in the template.static DataElement
performOperation(SessionToken session, ChangeableTemplate template, UpdateManager updateManager)
Insert a new data element in the template.static DataElement
performOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement)
Insert a new data element in the template.static DataElement
performOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement, UpdateManager updateManager)
Insert a new data element in the template.protected static DataElement
performOperation(SessionToken session, ChangePrimitives processGraph, UpdateManager updateManager)
Worker method to do the structural changes for both changeable templates and changeable instances.protected static DataElement
performOperation(SessionToken session, ChangePrimitives processGraph, DataElement dataElement, UpdateManager updateManager)
Worker method to do the structural changes for both changeable templates and changeable instances (with given dataElement).
-
-
-
Field Detail
-
logger
protected static final Logger logger
-
-
Method Detail
-
isPossible
public static boolean isPossible(Template template)
Check if it is possible (concerning structural aspects) to insert a new data element in the template. (At the moment it is always possible!).- Parameters:
template
- The template where the data element should be inserted.- Returns:
- True, if the insertion is possible.
-
isPossible
public static boolean isPossible(Template template, CheckReport checkReport)
Check if it is possible to insert a new data element (concerning structural aspects) to insert a new data element in the template. (At the moment it is always possible!). If it is not possible the reasons are stored in the checkReport.- Parameters:
template
- The template where the data element should be inserted.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 insertion is possible.
-
isPossible
public static boolean isPossible(Template template, DataElement dataElement)
Check if it is possible (concerning structural aspects) to insert a new data element given as a data element container object (without an id) in the template. (At the moment it is always possible!).- Parameters:
template
- The template where the data element should be inserted.dataElement
- a data element container (without an id) which should be inserted including all of its parameters- Returns:
- True, if the insertion is possible.
-
isPossible
public static boolean isPossible(Template template, DataElement dataElement, CheckReport checkReport)
Check if it is possible (concerning structural aspects) to insert a new data element given as a data element container object (without an id) in the template. (At the moment it is always possible!). If it is not possible the reasons are stored in the checkReport.- Parameters:
template
- The template where the data element should be inserted.dataElement
- a data element container (without an id) which should be inserted including all of its parameterscheckReport
- 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 insertion is possible.
-
isPossible
public static boolean isPossible(ChangeableInstance instance)
Check if it is possible (concerning structural and state based correctness) to insert a new data element in the instance. (At the moment it is always possible!).- Parameters:
instance
- The changeable instance where the data element should be inserted.- Returns:
- True, if the insertion is possible.
-
isPossible
public static boolean isPossible(ChangeableInstance instance, CheckReport checkReport)
Check if it is possible to insert a new data element (concerning structural and state based correctness) in the instance. (At the moment it is always possible!). If it is not possible the reasons are stored in the checkReport.- Parameters:
instance
- The changeable instance where the data element should be inserted.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 insertion is possible.
-
isPossible
public static boolean isPossible(ChangeableInstance instance, DataElement dataElement)
Check if it is possible (concerning structural and state based correctness) to insert a new data element given as a data element container object (without an id) in the instance. (At the moment it is always possible!).- Parameters:
instance
- The changeable instance where the data element should be inserted.dataElement
- a data element container (without an id) which should be inserted including all of its parameters- Returns:
- True, if the insertion is possible.
-
isPossible
public static boolean isPossible(ChangeableInstance instance, DataElement dataElement, CheckReport checkReport)
Check if it is possible (concerning structural and state based correctness) to insert a new data element given as a data element container object (without an id) in the instance. (At the moment it is always possible!). If it is not possible the reasons are stored in the checkReport.- Parameters:
instance
- The changeable instance where the data element should be inserted.dataElement
- a data element container (without an id) which should be inserted including all of its parameterscheckReport
- 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 insertion is possible.
-
performOperation
public static DataElement performOperation(SessionToken session, ChangeableTemplate template)
Insert a new data element in the template.- Parameters:
session
- The session which is used to check for access rights on this method.template
- The changeable template where the data element is to be inserted.- Returns:
- The newly inserted data element.
-
performOperation
public static DataElement performOperation(SessionToken session, ChangeableTemplate template, UpdateManager updateManager)
Insert a new data element in the template.- Parameters:
session
- The session which is used to check for access rights on this method.template
- The changeable template where the data element is to be inserted.updateManager
- The UpdateManager where modifications are logged, may be null- Returns:
- The newly inserted data element.
-
performOperation
public static DataElement performOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement)
Insert a new data element in the template. The method uses the attributes which are contained in the given data element object container (without an id) to create and store a data element for the given template The dummy data element container may contain the following attributes- NAME
- DESCRIPTION
- TYPE
- USER_DEFINED_TYPE
- IDENTIFIER
- VIRTUAL
- Parameters:
session
- The session which is used to check for access rights on this method.template
- The changeable template where the data element is to be inserted.dataElement
- the dummy data element container- Returns:
- The newly inserted data element.
-
performOperation
public static DataElement performOperation(SessionToken session, ChangeableTemplate template, DataElement dataElement, UpdateManager updateManager)
Insert a new data element in the template. The method uses the attributes which are contained in the given data element object container (without an id) to create and store a data element for the given template The dummy data element container may contain the following attributes- NAME
- DESCRIPTION
- TYPE
- USER_DEFINED_TYPE
- IDENTIFIER
- VIRTUAL
- Parameters:
session
- The session which is used to check for access rights on this method.template
- The changeable template where the data element is to be inserted.dataElement
- the dummy data element containerupdateManager
- the update manager for the visualisation; may be null- Returns:
- The newly inserted data element.
-
performOperation
public static DataElement performOperation(SessionToken session, ChangeableInstance instance)
Insert a new data element in the instance.- Parameters:
session
- The session which is used to check for access rights on this method.instance
- The changeable instance where the data element is to be inserted.- Returns:
- The newly inserted data element.
-
performOperation
public static DataElement performOperation(SessionToken session, ChangeableInstance instance, UpdateManager updateManager)
Insert a new data element in the instance (with updateManager).- Parameters:
session
- The session which is used to check for access rights on this method.instance
- The changeable instance where the data element is to be inserted.updateManager
- The UpdateManager where modifications are logged, may be null- Returns:
- The newly inserted data element.
-
performOperation
public static DataElement performOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement)
Insert a new data element in the instance. The method uses the attributes which are contained in the given data element object container (without an id) to create and store a data element for the given template The dummy data element container may contain the following attributes- NAME
- DESCRIPTION
- TYPE
- USER_DEFINED_TYPE
- IDENTIFIER
- VIRTUAL
- Parameters:
session
- The session which is used to check for access rights on this method.instance
- The changeable instance where the data element is to be inserted.dataElement
- the dummy data element container- Returns:
- The newly inserted data element.
-
performOperation
public static DataElement performOperation(SessionToken session, ChangeableInstance instance, DataElement dataElement, UpdateManager updateManager)
Insert a new data element in the instance. The method uses the attributes which are contained in the given data element object container (without an id) to create and store a data element for the given template The dummy data element container may contain the following attributes- NAME
- DESCRIPTION
- TYPE
- USER_DEFINED_TYPE
- IDENTIFIER
- VIRTUAL
- Parameters:
session
- The session which is used to check for access rights on this method.instance
- The changeable instance where the data element is to be inserted.dataElement
- the dummy data element containerupdateManager
- the update manager for the visualisation; may be null- Returns:
- The newly inserted data element.
-
performOperation
protected static DataElement performOperation(SessionToken session, ChangePrimitives processGraph, DataElement dataElement, UpdateManager updateManager)
Worker method to do the structural changes for both changeable templates and changeable instances (with given dataElement).- Parameters:
session
- The session which is used to check for access rights on this method.processGraph
- an instance of type ChangeableTemplate or ChangeableInstancedataElement
- the dummy data element containerupdateManager
- the update manager for the visualisation; may be null- Returns:
- The newly inserted data element.
-
performOperation
protected static DataElement performOperation(SessionToken session, ChangePrimitives processGraph, 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 ChangeableInstanceupdateManager
- the update manager for the visualisation; may be null- Returns:
- The newly inserted data element.
-
-