Class UpdateNodeSystemDependency
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.UpdateNodeSystemDependency
-
public class UpdateNodeSystemDependency extends Object
Change Operation to update (add/remove) the system parameters referenced by the node property. If the binding contains system data producers the change operation also updates the system data flow. 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 UpdateNodeSystemDependency()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPossible(ChangeableInstance instance, Node tempNode, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty)
Checks if the parameter binding is valid (concerning structural and state based correctness) for that property of the given container node which is referenced by the node propertynodeProperty
in the related template.static boolean
isPossible(ChangeableInstance instance, Node tempNode, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty, CheckReport checkReport)
Checks if the parameter binding is valid (concerning structural and state based correctness) for that property of the given container node which is referenced by the node propertynodeProperty
in the related template.protected static boolean
isPossible(Template templ, ChangeableInstance inst, Node tempNode, Map<String,Dependency> bindings, ProcessConstants.NodeProperty nodeProp, CheckReport cr)
Gets whether updating the node system dependencies is possible for the designated template or the designated instance.static boolean
isPossible(Template template, Node tempNode, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty)
Checks if the parameter binding is valid (concerning structural correctness) for that property of the given container node which is referenced by the node propertynodeProperty
in the related template.static boolean
isPossible(Template template, Node tempNode, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty, CheckReport checkReport)
Checks if the parameter binding is valid (concerning structural correctness) for that property of the given container node which is referenced by the node propertynodeProperty
in the related template.static void
performOperation(SessionToken session, ChangeableInstance instance, Node node, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty)
Updates the system parameters of a node object in the given template using the data in the given node.static void
performOperation(SessionToken session, ChangeableInstance instance, Node node, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty, UpdateManager updateManager)
Updates the system parameters of a node object in the given template using the data in the given node.protected static void
performOperation(SessionToken session, ChangeableTemplate cTempl, ChangeableInstance inst, Node node, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty, UpdateManager updateManager)
Worker method to do the structural changes for both changeable templates and changeable instances.static void
performOperation(SessionToken session, ChangeableTemplate template, Node node, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty)
Updates the system parameters of a node object in the given template using the data in the given node.static void
performOperation(SessionToken session, ChangeableTemplate template, Node node, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty, UpdateManager updateManager)
Updates the system parameters of a node object in the given template using the data in the given node.
-
-
-
Field Detail
-
logger
protected static final Logger logger
a Logger
-
-
Method Detail
-
isPossible
public static boolean isPossible(Template template, Node tempNode, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty)
Checks if the parameter binding is valid (concerning structural correctness) for that property of the given container node which is referenced by the node propertynodeProperty
in the related template. If the binding contains system data producers it is also checked if the corresponding system data flow can be updated. The following attributes / properties may be updated and must therefore be tested (all others cause an illegal argument exception):- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- Parameters:
template
- the template where the method is performed ontempNode
- a temporary node container which holds the information referenced by the node propertyparamBindings
- a map between parameter name and dependencynodeProperty
- the property which should be changed- Returns:
- true if the change of the given property is valid
-
isPossible
public static boolean isPossible(Template template, Node tempNode, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty, CheckReport checkReport)
Checks if the parameter binding is valid (concerning structural correctness) for that property of the given container node which is referenced by the node propertynodeProperty
in the related template. If the binding contains system data producers it is also checked if the corresponding system data flow can be updated. The following attributes / properties may be updated and must therefore be tested:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- Parameters:
template
- the template where the method is performed ontempNode
- a temporary node container which holds the information referenced by the node propertyparamBindings
- a map between parameter name and dependencynodeProperty
- the property which 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 null- Returns:
- true if the change of the given properties are valid
-
isPossible
protected static boolean isPossible(Template templ, ChangeableInstance inst, Node tempNode, Map<String,Dependency> bindings, ProcessConstants.NodeProperty nodeProp, CheckReport cr)
Gets whether updating the node system dependencies is possible for the designated template or the designated instance. This is only possible for system-data consuming properties. The designated binding has to be valid. All unnecessary system dependencies need to be removable (RemoveNodeSystemParameter
andRemoveSystemDataFlow
) and other changed system dependencies need to be updateable.- Parameters:
templ
- The template which to update. This may be the template of the designated instance. This must not benull
.inst
- The instance if updating the node system dependencies is an instance-specific change,null
for changing a template.tempNode
- The node of which the system dependencies should be updated. This is an adapted node with the designated property changed as it should be after updating the dependency.bindings
- The new parameter bindings for the designated node.nodeProp
- The property of the designated node which should be changed.cr
- An optionalCheckReport
to be filled with detailed information on why the change operation is not possible. This may benull
.- Returns:
- Whether updating the node system dependencies according to the designated parameters is possible.
-
isPossible
public static boolean isPossible(ChangeableInstance instance, Node tempNode, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty)
Checks if the parameter binding is valid (concerning structural and state based correctness) for that property of the given container node which is referenced by the node propertynodeProperty
in the related template. If the binding contains system data producers it is also checked if the corresponding system data flow can be updated. The following attributes / properties may be updated and must therefore be tested (all others cause an illegal argument exception):- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- Parameters:
instance
- the changeable instance where the method is performed ontempNode
- a temporary node container which holds the information referenced by the node propertyparamBindings
- a map between parameter name and dependencynodeProperty
- the property which should be changed- Returns:
- true if the change of the given properties are valid
-
isPossible
public static boolean isPossible(ChangeableInstance instance, Node tempNode, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty, CheckReport checkReport)
Checks if the parameter binding is valid (concerning structural and state based correctness) for that property of the given container node which is referenced by the node propertynodeProperty
in the related template. If the binding contains system data producers it is also checked if the corresponding system data flow can be updated. The following attributes / properties may be updated and must therefore be tested:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- Parameters:
instance
- the changeable instance where the method is performed ontempNode
- a temporary node container which holds the information referenced by the node propertyparamBindings
- a map between parameter name and dependencynodeProperty
- the property which 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 null- Returns:
- true if the change of the given properties are valid
-
performOperation
public static void performOperation(SessionToken session, ChangeableTemplate template, Node node, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty)
Updates the system parameters of a node object in the given template using the data in the given node. The given node is just used as a temporary container for the new values. The property specifies which attribute of the node will be updated. Since this can cause side effects in the system data flow, the parameter binding is used to update the system data flow. The following properties may be updated from the given object:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- Parameters:
session
- The session which is used to check for access rights on this method.template
- the related templatenode
- The node of which the system dependencies should be updated. This is an adapted node with the designated property changed as it should be after updating the dependency.paramBindings
- a map between parameter name and dependencynodeProperty
- Possible values of NodeProperty are described above.
-
performOperation
public static void performOperation(SessionToken session, ChangeableTemplate template, Node node, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty, UpdateManager updateManager)
Updates the system parameters of a node object in the given template using the data in the given node. The given node is just used as a temporary container for the new values. The property specifies which attribute of the node will be updated (Operation with updateManager). Since this can cause side effects in the system data flow, the parameter binding is used to update the system data flow. The following properties may be updated from the given object:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- Parameters:
session
- The session which is used to check for access rights on this method.template
- the related templatenode
- The node of which the system dependencies should be updated. This is an adapted node with the designated property changed as it should be after updating the dependency.paramBindings
- a map between parameter name and dependencynodeProperty
- possible values of NodeProperty are described above.updateManager
- The update manager which will be informed about process changes.
-
performOperation
public static void performOperation(SessionToken session, ChangeableInstance instance, Node node, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty)
Updates the system parameters of a node object in the given template using the data in the given node. The given node is just used as a temporary container for the new values. The property specifies which attribute of the node will be updated (Operation with updateManager). Since this can cause side effects in the system data flow, the parameter binding is used to update the system data flow. The following properties may be updated from the given object:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- Parameters:
session
- The session which is used to check for access rights on this method.instance
- the related changeable instancenode
- The node of which the system dependencies should be updated. This is an adapted node with the designated property changed as it should be after updating the dependency.paramBindings
- a map between parameter name and dependencynodeProperty
- possible values of NodeProperty are described above.
-
performOperation
public static void performOperation(SessionToken session, ChangeableInstance instance, Node node, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty, UpdateManager updateManager)
Updates the system parameters of a node object in the given template using the data in the given node. The given node is just used as a temporary container for the new values. The property specifies which attribute of the node will be updated (Operation with updateManager). Since this can cause side effects in the system data flow, the parameter binding is used to update the system data flow. The following properties may be updated from the given object:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- Parameters:
session
- The session which is used to check for access rights on this method.instance
- the related changeable instancenode
- The node of which the system dependencies should be updated. This is an adapted node with the designated property changed as it should be after updating the dependency.paramBindings
- a map between parameter name and dependencynodeProperty
- possible values of NodeProperty are described above.updateManager
- The update manager which will be informed about process changes.
-
performOperation
protected static void performOperation(SessionToken session, ChangeableTemplate cTempl, ChangeableInstance inst, Node node, Map<String,Dependency> paramBindings, ProcessConstants.NodeProperty nodeProperty, 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.cTempl
- The template to be changed ornull
in case the designated instance should be changed.inst
- The instance to be changed ornull
in case the designated template should be changed.node
- The node of which the system dependencies should be updated. This is an adapted node with the designated property changed as it should be after updating the dependency.paramBindings
- a map between parameter name and dependencynodeProperty
- possible values of NodeProperty are described above.updateManager
- The update manager which will be informed about process changes.
-
-