Class UpdateTemplate
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.UpdateTemplate
-
public class UpdateTemplate extends Object
Change Operation to update the properties of a template. In contrast to other update operations, the template update operation has the changeable attributes explicitly in its method signature. To be able to update not only all attributes the template 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.- Author:
- jurisch
-
-
Constructor Summary
Constructors Constructor Description UpdateTemplate()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPossible(UUID templateID, ProcessConstants.TemplateProperty... templateProperties)
Checks if it is valid for the template with the given id to update the properties given byProperties
.static boolean
isPossible(UUID templateID, CheckReport checkReport, ProcessConstants.TemplateProperty... templateProperties)
Checks if it is valid for the template with the given id to update the properties given byProperties
.static void
performOperation(ChangeableTemplate template, String newName, String newInstanceNameTemplate, QualifiedAgent newSupervisorAgent, Set<ProcessModelParameter> newInputParameters, Set<ProcessModelParameter> newOutputParameters, UpdateManager updateManager, ProcessConstants.TemplateProperty... templateProperties)
Updates the given template using those of the given attributes which are specified in template properties.static void
performOperation(ChangeableTemplate template, String newName, String newInstanceNameTemplate, QualifiedAgent newSupervisorAgent, Set<ProcessModelParameter> newInputParameters, Set<ProcessModelParameter> newOutputParameters, ProcessConstants.TemplateProperty... templateProperties)
Updates the given template using those of the given attributes which are specified in template properties.
-
-
-
Field Detail
-
logger
protected static final Logger logger
aLogger
-
-
Method Detail
-
isPossible
public static boolean isPossible(UUID templateID, ProcessConstants.TemplateProperty... templateProperties)
Checks if it is valid for the template with the given id to update the properties given byProperties
. The following attributes / properties may be updated and must therefore be tested:- NAME
- SUPERVISOR_AGENT
- SUPERVISOR_ORG_POSITION
- OUTPUT_PARAMETERS
- INPUT_PARAMETERS
- Parameters:
templateID
- the id of the template where the method is performed ontemplateProperties
- the properties which should be changed- Returns:
- true if the change of the given properties are valid
-
isPossible
public static boolean isPossible(UUID templateID, CheckReport checkReport, ProcessConstants.TemplateProperty... templateProperties)
Checks if it is valid for the template with the given id to update the properties given byProperties
. The following attributes / properties may be updated and must therefore be tested:- NAME
- SUPERVISOR_AGENT
- SUPERVISOR_ORG_POSITION
- OUTPUT_PARAMETERS
- INPUT_PARAMETERS
- Parameters:
templateID
- the id of the template 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 nulltemplateProperties
- the properties which should be changed- Returns:
- true if the change of the given properties are valid
-
performOperation
public static void performOperation(ChangeableTemplate template, String newName, String newInstanceNameTemplate, QualifiedAgent newSupervisorAgent, Set<ProcessModelParameter> newInputParameters, Set<ProcessModelParameter> newOutputParameters, ProcessConstants.TemplateProperty... templateProperties)
Updates the given template using those of the given attributes which are specified in template properties. The following properties may be updated from the given object:- NAME
- SUPERVISOR_AGENT
- SUPERVISOR_ORG_POSITION
- OUTPUT_PARAMETERS
- INPUT_PARAMETERS
- Parameters:
template
- the template whose properties are updatednewName
- the name of the template (maybe null)newInstanceNameTemplate
- The pattern for an instance name of this template.newSupervisorAgent
- the supervisor agent (maybe null)newInputParameters
- the new input parameters of the template (maybe null)newOutputParameters
- the new output parameters of the template (maybe null)templateProperties
- Possible values of TemplateProperty are described above.
-
performOperation
public static void performOperation(ChangeableTemplate template, String newName, String newInstanceNameTemplate, QualifiedAgent newSupervisorAgent, Set<ProcessModelParameter> newInputParameters, Set<ProcessModelParameter> newOutputParameters, UpdateManager updateManager, ProcessConstants.TemplateProperty... templateProperties)
Updates the given template using those of the given attributes which are specified in template properties. (Operation with updateManager) The following properties may be updated from the given object:- NAME
- SUPERVISOR_AGENT
- SUPERVISOR_ORG_POSITION
- OUTPUT_PARAMETERS
- INPUT_PARAMETERS
- Parameters:
template
- The template whose properties are updatednewName
- The name of the template (maybe null)newInstanceNameTemplate
- The pattern for an instance name of this template.newSupervisorAgent
- The supervisor agent (maybe null)newInputParameters
- The new input parameters of the template (maybe null)newOutputParameters
- The new output parameters of the template (maybe null)updateManager
- The update manager which will be informed about process changes.templateProperties
- Possible values of TemplateProperty are described above.
-
-