Class TemplateChangeServiceImpl
java.lang.Object
com.flowable.platform.service.template.TemplateChangeServiceImpl
- All Implemented Interfaces:
TemplateChangeService
@Transactional
public class TemplateChangeServiceImpl
extends Object
implements TemplateChangeService
The implementation of the the template change service able to change and deploy a change to a template or template variation at runtime with an optional
change process being triggered first.
- Author:
- Micha Kiener
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AuditService
protected String
protected final IdentityService
protected static final org.slf4j.Logger
static final String
protected final RuntimeService
protected final TaskService
protected final TemplateEngineConfiguration
protected final TemplateRepositoryService
protected static final DateTimeFormatter
Fields inherited from interface com.flowable.platform.service.template.TemplateChangeService
AUDIT_ENTRY_SUB_TYPE_TEMPLATE_VARIATION, AUDIT_ENTRY_TYPE_DEPLOYMENT, AUDIT_ENTRY_VAR_NAME_APPROVAL_USER_ID, AUDIT_ENTRY_VAR_NAME_CHANGE_USER_ID, AUDIT_ENTRY_VAR_OLD_VERSION_TIMESTAMP, PRC_VAR_NAME_APPROVED, PRC_VAR_NAME_NEW_CONTENT, PRC_VAR_NAME_NEW_CONTENT_RESOURCE, PRC_VAR_NAME_NEW_EXTERNAL_ID, PRC_VAR_NAME_TPL_DEF_ID, PRC_VAR_NAME_TRIGGERING_USER_ID, PRC_VAR_NAME_TRIGGERING_USER_NAME
-
Constructor Summary
ConstructorDescriptionTemplateChangeServiceImpl
(TemplateRepositoryService templateRepositoryService, TemplateEngineConfiguration templateEngineConfiguration, RuntimeService runtimeService, TaskService taskService, IdentityService identityService, AuditService auditService) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
completeApprovalTask
(String templateVariationId, ProcessInstance approvalPrc, UpdateTemplateVariationRequest updateRequest) protected void
deployTemplateVariationContentChange
(String templateVariationId, String tenantId, UpdateTemplateVariationRequest request) void
deployTemplateVariationContentChange
(String templateVariationId, String tenantId, String newVariationContent, String newVariationContentResource) Directly changes and deploys the variation content of the given template variation at runtime.void
deployTemplateVariationContentChange
(String templateVariationId, String tenantId, String newVariationContent, String newVariationContentResource, String externalId) Directly changes and deploys the variation content of the given template variation at runtime.findApprovalProcessInstance
(String combinedTemplateVariationKey, String tenantId) Find a running approval / change process for the specified template variation.protected TemplateVariationHolder
loadAndCheckTemplateVariation
(String templateVariationId, String tenantId, boolean throwIfNotEditable) void
setChangeApprovalProcessKey
(String changeApprovalProcessKey) protected ProcessInstance
triggerChangeAndApprovalProcess
(String templateVariationId, String tenantId, TemplateVariationModel variationModel, UpdateTemplateVariationRequest request) void
triggerTemplateVariationContentChange
(String templateVariationId, String tenantId, UpdateTemplateVariationRequest updateRequest) Changes and deploys the variation content of the given template variation at runtime.
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
VERSION_DATETIME_FORMAT
-
PRC_BUSINESS_KEY_TEMPLATE_CHANGE
- See Also:
-
changeApprovalProcessKey
-
templateRepositoryService
-
templateEngineConfiguration
-
runtimeService
-
taskService
-
identityService
-
auditService
-
-
Constructor Details
-
TemplateChangeServiceImpl
public TemplateChangeServiceImpl(TemplateRepositoryService templateRepositoryService, TemplateEngineConfiguration templateEngineConfiguration, RuntimeService runtimeService, TaskService taskService, IdentityService identityService, AuditService auditService)
-
-
Method Details
-
triggerTemplateVariationContentChange
public void triggerTemplateVariationContentChange(String templateVariationId, String tenantId, UpdateTemplateVariationRequest updateRequest) Description copied from interface:TemplateChangeService
Changes and deploys the variation content of the given template variation at runtime. This will start a change / approval process, if configured. And if that's the case, the change and deploy does not happen immediately, but will be done as part of the process. If there is no such process in place, this method will directly invokeTemplateChangeService.deployTemplateVariationContentChange(String, String, String, String)
.- Specified by:
triggerTemplateVariationContentChange
in interfaceTemplateChangeService
- Parameters:
templateVariationId
- the id of the template variation to change its variation contentupdateRequest
- the update request containing the necessary data (e.g. new variation content, etc) for the update
-
completeApprovalTask
protected void completeApprovalTask(String templateVariationId, ProcessInstance approvalPrc, UpdateTemplateVariationRequest updateRequest) -
triggerChangeAndApprovalProcess
protected ProcessInstance triggerChangeAndApprovalProcess(String templateVariationId, String tenantId, TemplateVariationModel variationModel, UpdateTemplateVariationRequest request) -
findApprovalProcessInstance
public ProcessInstance findApprovalProcessInstance(String combinedTemplateVariationKey, String tenantId) Description copied from interface:TemplateChangeService
Find a running approval / change process for the specified template variation.- Specified by:
findApprovalProcessInstance
in interfaceTemplateChangeService
- Parameters:
combinedTemplateVariationKey
- the combined id of the template and variation key (as being returned byTemplateVariationModel.getKey()
- Returns:
- the optional, running approval process, if any found, null otherwise
-
deployTemplateVariationContentChange
public void deployTemplateVariationContentChange(String templateVariationId, String tenantId, String newVariationContent, String newVariationContentResource) Description copied from interface:TemplateChangeService
Directly changes and deploys the variation content of the given template variation at runtime. This method is either invoked byTemplateChangeService.triggerTemplateVariationContentChange(String, String, UpdateTemplateVariationRequest)
or as part of the change / approval process to eventually deploy the changed content.- Specified by:
deployTemplateVariationContentChange
in interfaceTemplateChangeService
- Parameters:
templateVariationId
- the id of the template variation to change and deploy its contenttenantId
- the optional id of the tenantnewVariationContent
- the new variation content to change and deploy (can be null ifnewVariationContentResource
is passed)newVariationContentResource
- the new variation content resource to change and deploy (can be null ifnewVariationContent
is passed)
-
deployTemplateVariationContentChange
public void deployTemplateVariationContentChange(String templateVariationId, String tenantId, String newVariationContent, String newVariationContentResource, String externalId) Description copied from interface:TemplateChangeService
Directly changes and deploys the variation content of the given template variation at runtime. This method is either invoked byTemplateChangeService.triggerTemplateVariationContentChange(String, String, UpdateTemplateVariationRequest)
or as part of the change / approval process to eventually deploy the changed content.- Specified by:
deployTemplateVariationContentChange
in interfaceTemplateChangeService
- Parameters:
templateVariationId
- the ID of the template variation to change and deploy its contenttenantId
- the optional ID of the tenantnewVariationContent
- the new variation content to change and deploy (can be null ifnewVariationContentResource
is passed)newVariationContentResource
- the new variation content resource to change and deploy (can be null ifnewVariationContent
is passed)externalId
- the new external ID
-
deployTemplateVariationContentChange
protected void deployTemplateVariationContentChange(String templateVariationId, String tenantId, UpdateTemplateVariationRequest request) -
loadAndCheckTemplateVariation
protected TemplateVariationHolder loadAndCheckTemplateVariation(String templateVariationId, String tenantId, boolean throwIfNotEditable) -
getChangeApprovalProcessKey
-
setChangeApprovalProcessKey
-