Class AddNodeSystemParameter
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.AddNodeSystemParameter
-
public class AddNodeSystemParameter extends Object
Change operation for adding a system parameter to a node. TODO Refactor; use a common interface for change operations.
-
-
Constructor Summary
Constructors Constructor Description AddNodeSystemParameter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPossible(Instance instance, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter)
Check if it is possible (concerning structural correctness and state based correctness) to add the given system parameter to the given node.static boolean
isPossible(Instance instance, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter, CheckReport checkReport)
Check if it is possible (concerning structural correctness and state based correctness) to add the given system parameter to the given node.static boolean
isPossible(Instance instance, int nodeId, Node node, ActivityConstants.AccessType type, ProcessModelParameter parameter, CheckReport checkReport)
Check whether it is possible (concerning structural and state-based correctness) to add the designated system parameter to the designated node.static boolean
isPossible(Template template, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter)
Check if it is possible (concerning structural correctness) to add the given system parameter to the given node.static boolean
isPossible(Template template, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter, CheckReport checkReport)
Check if it is possible (concerning structural correctness) to add the given system parameter to the given node.static boolean
isPossible(Template template, int nodeId, Node node, ActivityConstants.AccessType type, ProcessModelParameter parameter, CheckReport checkReport)
Check whether it is possible (concerning structural correctness) to add the designated system parameter to the designated node.static boolean
parameterReferenceExists(Object object, Method[] methods, String parameterName)
static void
performOperation(SessionToken session, ChangeableInstance instance, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter)
Adds the given system parameter to the given node in the given instance.static void
performOperation(SessionToken session, ChangeableInstance instance, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter, UpdateManager updateManager)
Adds the given system parameter to the given node in the given instance.static void
performOperation(SessionToken session, ChangeableTemplate template, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter)
Adds the given system parameter to the given node in the given template.static void
performOperation(SessionToken session, ChangeableTemplate template, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter, UpdateManager updateManager)
Adds the given system parameter to the given node in the given template.protected static void
performOperation(SessionToken session, ChangePrimitives processGraph, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter, UpdateManager updateManager)
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, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter)
Check if it is possible (concerning structural correctness) to add the given system parameter to the given node.- Parameters:
template
- The corresponding templatenodeID
- the node where the system parameter should be added.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter object- Returns:
- True, if possible.
-
isPossible
public static boolean isPossible(Template template, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter, CheckReport checkReport)
Check if it is possible (concerning structural correctness) to add the given system parameter to the given node. If it is not possible the reasons are stored in the checkReport.- Parameters:
template
- The corresponding templatenodeID
- the node where the system parameter should be added.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter objectcheckReport
- 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 possible.
-
isPossible
public static boolean isPossible(Template template, int nodeId, Node node, ActivityConstants.AccessType type, ProcessModelParameter parameter, CheckReport checkReport)
Check whether it is possible (concerning structural correctness) to add the designated system parameter to the designated node. If it is not possible the reasons are stored in thecheckReport
.- Parameters:
template
- The corresponding template which has the node.nodeId
- The ID of the node to which the system parameter should be added.node
- The node to which the system parameter should be added. This may be an adapted node with a (new or changed) string property value consuming the value of the designated parameter. In this case the designated node is obviously different fromTemplate.getNode(int)
since it already contains the changes as if the system parameter exists.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter objectcheckReport
- 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 possible.
-
parameterReferenceExists
public static boolean parameterReferenceExists(Object object, Method[] methods, String parameterName)
- Parameters:
object
-methods
-parameterName
-- Returns:
- True, if any method of the given methods called on the given object returns a string which contains a parameter reference for the given parameter name.
-
isPossible
public static boolean isPossible(Instance instance, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter)
Check if it is possible (concerning structural correctness and state based correctness) to add the given system parameter to the given node.- Parameters:
instance
- The related changeable instance.nodeID
- the node where the system parameter should be added.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter object- Returns:
- True, if possible.
-
isPossible
public static boolean isPossible(Instance instance, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter, CheckReport checkReport)
Check if it is possible (concerning structural correctness and state based correctness) to add the given system parameter to the given node. If it is not possible the reasons are stored in the checkReport.- Parameters:
instance
- The related changeable instance.nodeID
- the node where the system parameter should be added.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter objectcheckReport
- 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 possible.
-
isPossible
public static boolean isPossible(Instance instance, int nodeId, Node node, ActivityConstants.AccessType type, ProcessModelParameter parameter, CheckReport checkReport)
Check whether it is possible (concerning structural and state-based correctness) to add the designated system parameter to the designated node. If it is not possible the reasons are stored in thecheckReport
.- Parameters:
instance
- The related changeable instance.nodeId
- The ID of the node to which the system parameter should be added.node
- The node to which the system parameter should be added. This may be an adapted node with a (new or changed) string property value consuming the value of the designated parameter. In this case the designated node is obviously different fromTemplate.getNode(int)
since it already contains the changes as if the system parameter exists.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter objectcheckReport
- 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 possible.
-
performOperation
public static void performOperation(SessionToken session, ChangeableTemplate template, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter)
Adds the given system parameter to the given node in the given template.- Parameters:
session
- The session which is used to check for access rights on this method.template
- The related changeable template.nodeID
- the node where the system parameter should be added.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter object
-
performOperation
public static void performOperation(SessionToken session, ChangeableTemplate template, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter, UpdateManager updateManager)
Adds the given system parameter to the given node in the given template. (Operation with updateManager)- Parameters:
session
- The session which is used to check for access rights on this method.template
- The related changeable template.nodeID
- the node where the system parameter should be added.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter objectupdateManager
- The UpdateManager where modifications are logged, may be null
-
performOperation
public static void performOperation(SessionToken session, ChangeableInstance instance, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter)
Adds the given system parameter to the given node in the given instance.- Parameters:
session
- The session which is used to check for access rights on this method.instance
- The related changeable instance.nodeID
- the node where the system parameter should be added.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter object
-
performOperation
public static void performOperation(SessionToken session, ChangeableInstance instance, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter, UpdateManager updateManager)
Adds the given system parameter to the given node in the given instance. (Operation with updateManager)- Parameters:
session
- The session which is used to check for access rights on this method.instance
- The related changeable instance.nodeID
- the node where the system parameter should be added.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter objectupdateManager
- the manager which is responsible for the graphical adaptation of the template (maybe null)
-
performOperation
protected static void performOperation(SessionToken session, ChangePrimitives processGraph, int nodeID, ActivityConstants.AccessType type, ProcessModelParameter parameter, 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 ChangeableInstancenodeID
- the node where the system parameter should be added.type
- the access type SYSTEM_READ or SYSTEM_WRITEparameter
- the system parameter objectupdateManager
- the manager which is responsible for the graphical adaptation of the template (maybe null)
-
-