Class UpdateNode
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.UpdateNode
-
public class UpdateNode extends Object
Change Operation to update the properties of a node. 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 UpdateNode()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
autoStartEnabled(Template template, Node node)
static boolean
btnAutoStartEnabled(Template template, Node node, String nodeSAR, Map<String,Dependency> dependencies)
static boolean
isPossible(ChangeableInstance instance, Node node, ProcessConstants.NodeProperty... nodeProperties)
Checks if it is valid (concerning structural and state based correctness) for the given node to update the properties given bynodeProperties
in the instance.static boolean
isPossible(ChangeableInstance instance, Node node, CheckReport checkReport, ProcessConstants.NodeProperty... nodeProperties)
Checks if it is valid (concerning structural and state based correctness) for the given node to update the properties given bynodeProperties
in the instance.static boolean
isPossible(Template template, Node node, ProcessConstants.NodeProperty... nodeProperties)
Checks if it is valid (concerning structural correctness) for the given node to update the properties given bynodeProperties
in the template.static boolean
isPossible(Template template, Node node, CheckReport checkReport, ProcessConstants.NodeProperty... nodeProperties)
Checks if it is valid (concerning structural correctness) for the given node to update the properties given bynodeProperties
in the template.static void
performOperation(ChangeableInstance instance, Node node, UpdateManager updateManager, ProcessConstants.NodeProperty... nodeProperties)
Updates a node object in the given instance using the data in the given node.static void
performOperation(ChangeableInstance instance, Node node, ProcessConstants.NodeProperty... nodeProperties)
Updates a node object in the given instance using the data in the given node.static void
performOperation(ChangeableTemplate template, Node node, UpdateManager updateManager, ProcessConstants.NodeProperty... nodeProperties)
Updates a node object in the given template using the data in the given node.static void
performOperation(ChangeableTemplate template, Node node, ProcessConstants.NodeProperty... nodeProperties)
Updates a node object in the given template using the data in the given node.protected static void
performOperation(ChangePrimitives processGraph, Node node, UpdateManager updateManager, ProcessConstants.NodeProperty... nodeProperties)
Worker method to do the structural changes for both changeable templates and changeable instances.
-
-
-
Field Detail
-
logger
protected static final Logger logger
aLogger
-
-
Method Detail
-
isPossible
public static boolean isPossible(Template template, Node node, ProcessConstants.NodeProperty... nodeProperties)
Checks if it is valid (concerning structural correctness) for the given node to update the properties given bynodeProperties
in the template. The following attributes / properties may be updated and must therefore be tested:- NAME
- DESCRIPTION
- USER_ATTRIBUTE (checked here, updated by UpdateUserAttribute)
- SYSTEM_READ_PARAMS
- SYSTEM_WRITE_PARAMS
- Parameters:
template
- the template where the method is performed onnode
- the node which should be updatednodeProperties
- the properties which should be changed- Returns:
- true if the change of the given properties are valid
-
isPossible
public static boolean isPossible(Template template, Node node, CheckReport checkReport, ProcessConstants.NodeProperty... nodeProperties)
Checks if it is valid (concerning structural correctness) for the given node to update the properties given bynodeProperties
in the template. The following attributes / properties may be updated and must therefore be tested:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- USER_ATTRIBUTE (checked here, updated by UpdateUserAttribute)
- Parameters:
template
- the template where the method is performed onnode
- the node where the the EBP is assigned tocheckReport
- 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 nullnodeProperties
- the properties which should be changed- Returns:
- true if the change of the given properties are valid
-
isPossible
public static boolean isPossible(ChangeableInstance instance, Node node, ProcessConstants.NodeProperty... nodeProperties)
Checks if it is valid (concerning structural and state based correctness) for the given node to update the properties given bynodeProperties
in the instance. The following attributes / properties may be updated and must therefore be tested:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- USER_ATTRIBUTE (checked here, updated by UpdateUserAttribute)
- Parameters:
instance
- the changeable instance where the method is performed onnode
- the node which should be updatednodeProperties
- the properties which should be changed- Returns:
- true if the change of the given properties are valid
-
isPossible
public static boolean isPossible(ChangeableInstance instance, Node node, CheckReport checkReport, ProcessConstants.NodeProperty... nodeProperties)
Checks if it is valid (concerning structural and state based correctness) for the given node to update the properties given bynodeProperties
in the instance. The following attributes / properties may be updated and must therefore be tested:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- USER_ATTRIBUTE (checked here, updated by UpdateUserAttribute)
- Parameters:
instance
- the changeable instance where the method is performed onnode
- the node where the the EBP is assigned tocheckReport
- 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 nullnodeProperties
- the properties which should be changed- Returns:
- true if the change of the given properties are valid
-
performOperation
public static void performOperation(ChangeableTemplate template, Node node, ProcessConstants.NodeProperty... nodeProperties)
Updates 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 properties specify which attributes of the node will be updated. The following properties may be updated from the given object:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
Please useUpdateExecutableBusinessProcess
FIXME link to the conceptual description of the data-connector.- Parameters:
template
- the related templatenode
- A temporary node object, containing the new values.nodeProperties
- Possible values of NodeProperty are described above.
-
performOperation
public static void performOperation(ChangeableTemplate template, Node node, UpdateManager updateManager, ProcessConstants.NodeProperty... nodeProperties)
Updates 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 properties specify which attributes of the node will be updated in the given template. (Operation with updateManager) The following properties may be updated from the given object:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
Please useUpdateExecutableBusinessProcess
FIXME link to the conceptual description of the data-connector.- Parameters:
template
- the related templatenode
- A temporary node object, containing the new values.updateManager
- The update manager which will be informed about process changes.nodeProperties
- Possible values of NodeProperty are described above.
-
performOperation
public static void performOperation(ChangeableInstance instance, Node node, ProcessConstants.NodeProperty... nodeProperties)
Updates a node object in the given instance using the data in the given node. The given node is just used as a temporary container for the new values. The properties specify which attributes of the node will be updated. The following properties may be updated from the given object:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
Please useUpdateExecutableBusinessProcess
.
FIXME link to the conceptual description of the data-connector.- Parameters:
instance
- the related changeable instancenode
- A temporary node object, containing the new values.nodeProperties
- Possible values of NodeProperty are described above.
-
performOperation
public static void performOperation(ChangeableInstance instance, Node node, UpdateManager updateManager, ProcessConstants.NodeProperty... nodeProperties)
Updates a node object in the given instance using the data in the given node. The given node is just used as a temporary container for the new values. The properties specify which attributes of the node will be updated in the given template. (Operation with updateManager) The following properties may be updated from the given object:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
Please useUpdateExecutableBusinessProcess
.
FIXME link to the conceptual description of the data-connector.- Parameters:
instance
- the related changeable instancenode
- A temporary node object, containing the new values.updateManager
- The update manager which will be informed about process changes.nodeProperties
- Possible values of NodeProperty are described above.
-
performOperation
protected static void performOperation(ChangePrimitives processGraph, Node node, UpdateManager updateManager, ProcessConstants.NodeProperty... nodeProperties)
Worker method to do the structural changes for both changeable templates and changeable instances. This method is for internal use only since it offers the possibility to update the ExecutableBusinessProcess property and name, description and staff assignment rule properties with parameter references. For a complete assignment/deletion of an executable business process use change operation Assign/RemoveExecutableBusinessProcess instead. The following properties may be updated from the given object:- NAME
- DESCRIPTION
- STAFF_ASSIGNMENT_RULE
- EXECUTABLE_BUSINESS_PROCESS (and implicitly CONNECTOR_PARAMETER_MAPPING)
- SYSTEM_READ_PARAMS
- SYSTEM_WRITE_PARAMS
If EXECUTABLE_BUSINESS_PROCESS is set in the parameter nodeProperties andgetExecutableBusinessProcess()
of the given node returns null, the EBP and the parameter/data-connector mapping is removed from the node as well as all data-connectors which are not connected (i.e marked as disabled or connect later) with a data edge.
Setting a new ExecutableBusinessProcsess to a node:
If the property EXECUTABLE_BUSINESS_PROCESS is set, and the attribute returns a value, the returned ExecutableBusinessProcess will be used as a new EBP. This means that the old EBP is removed (like described above), and afterwards added. Changing attributes of the ExecutableBusinessProcsess of a node:
Please useUpdateExecutableBusinessProcess
.
Note: The declaration of CONNECTOR_PARAMETER_MAPPING in nodeProperties is senseless because the data parameter mapping is always changed if the EBP is changed. Therefore calling the method with the argument CONNECTOR_PARAMETER_MAPPING will produce an exception. In turn to that calling the method with EXECUTABLE_BUSINESS_PROCESS forces the user to store a correct connector mapping in the given node object. FIXME link to the conceptual description of the data-connector.- Parameters:
processGraph
- an instance of type ChangeableTemplate or ChangeableInstancenode
- A temporary node object, containing the new values.updateManager
- The update manager which will be informed about process changes.nodeProperties
- Possible values of NodeProperty are described above.
-
autoStartEnabled
public static boolean autoStartEnabled(Template template, Node node)
- Parameters:
template
-node
-- Returns:
- true, if autoStart could be set, false otherwise
-
-