Class UpdateInstance
java.lang.Object
de.aristaflow.adept2.core.changeoperations.UpdateInstance
Change Operation to update the properties of an instance. In contrast to other
update operations, the instance update operation has the changeable
attributes explicitly in its method signature. To be able to update not only
all attributes the instance properties specify which of the given attributes
are to be updated.
Call isPossible first to check if the update is valid, then call perform
operation to execute the change.
TODO Refactor; use a common interface for change operations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPossible(Instance instance, ProcessConstants.InstanceProperty... instanceProperties) TODO change instance to instance id if we have a process repository Checks if it is valid for the given instance to update the properties given byProperties.static booleanisPossible(Instance instance, CheckReport checkReport, ProcessConstants.InstanceProperty... instanceProperties) TODO change instance to instance id if we have a process repository Checks if it is valid for the given instance to update the properties given byProperties.static voidperformOperation(ChangeableInstance instance, String newName, QualifiedAgent newSupervisorAgent, Set<ProcessModelParameter> newInputParameters, Set<ProcessModelParameter> newOutputParameters, UpdateManager updateManager, ProcessConstants.InstanceProperty... instanceProperties) Updates the given instance using those of the given attributes which are specified in instance properties.static voidperformOperation(ChangeableInstance instance, String newName, QualifiedAgent newSupervisorAgent, Set<ProcessModelParameter> newInputParameters, Set<ProcessModelParameter> newOutputParameters, ProcessConstants.InstanceProperty... instanceProperties) Updates the given instance using those of the given attributes which are specified in instance properties.
-
Field Details
-
logger
aLogger
-
-
Constructor Details
-
UpdateInstance
public UpdateInstance()
-
-
Method Details
-
isPossible
public static boolean isPossible(Instance instance, ProcessConstants.InstanceProperty... instanceProperties) TODO change instance to instance id if we have a process repository Checks if it is valid for the given instance to update the properties given byProperties. The following attributes / properties may be updated and must therefore be tested:- NAME
- SUPERVISOR_AGENT
- SUPERVISOR_ORG_POSITION
- INITIATOR_AGENT
- INITIATOR_ORG_POSITION
- INPUT_PARAMETERS
- OUTPUT_PARAMETERS
- Parameters:
instance- the instance where the method is performed oninstanceProperties- the properties which should be changed- Returns:
- true if the change of the given properties are valid
-
isPossible
public static boolean isPossible(Instance instance, CheckReport checkReport, ProcessConstants.InstanceProperty... instanceProperties) TODO change instance to instance id if we have a process repository Checks if it is valid for the given instance to update the properties given byProperties. The following attributes / properties may be updated and must therefore be tested:- NAME
- SUPERVISOR_AGENT
- SUPERVISOR_ORG_POSITION
- INITIATOR_AGENT
- INITIATOR_ORG_POSITION
- INPUT_PARAMETERS
- OUTPUT_PARAMETERS
- Parameters:
instance- the instance where the method is performed oncheckReport- 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 nullinstanceProperties- the properties which should be changed- Returns:
- true if the change of the given properties are valid
-
performOperation
public static void performOperation(ChangeableInstance instance, String newName, QualifiedAgent newSupervisorAgent, Set<ProcessModelParameter> newInputParameters, Set<ProcessModelParameter> newOutputParameters, ProcessConstants.InstanceProperty... instanceProperties) Updates the given instance using those of the given attributes which are specified in instance properties. The following properties may be updated from the given object:- NAME
- SUPERVISOR_AGENT
- SUPERVISOR_ORG_POSITION
- INITIATOR_AGENT
- INITIATOR_ORG_POSITION
- OUTPUT_PARAMETERS
- INPUT_PARAMETERS
- Parameters:
instance- the instance whose properties are updatednewName- the name of the instance (maybe null)newSupervisorAgent- the agent ID of the supervisor (maybe null)newInputParameters- the new input parameters of the instance (maybe null)newOutputParameters- the new output parameters of the instance (maybe null)instanceProperties- possible values of InstanceProperty are described above.
-
performOperation
public static void performOperation(ChangeableInstance instance, String newName, QualifiedAgent newSupervisorAgent, Set<ProcessModelParameter> newInputParameters, Set<ProcessModelParameter> newOutputParameters, UpdateManager updateManager, ProcessConstants.InstanceProperty... instanceProperties) Updates the given instance using those of the given attributes which are specified in instance properties. The following properties may be updated from the given object:- NAME
- SUPERVISOR_AGENT
- SUPERVISOR_ORG_POSITION
- INITIATOR_AGENT
- INITIATOR_ORG_POSITION
- OUTPUT_PARAMETERS
- INPUT_PARAMETERS
- Parameters:
instance- the instance whose properties are updatednewName- the name of the instance (maybe null)newSupervisorAgent- the supervisor agent (maybe null)newInputParameters- the new input parameters of the instance (maybe null)newOutputParameters- the new output parameters of the instance (maybe null)updateManager- The update manager which will be informed about process changes.instanceProperties- possible values of InstanceProperty are described above.
-