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
Fields Modifier and Type Field Description protected AuditService
auditService
protected String
changeApprovalProcessKey
protected IdentityService
identityService
protected static org.slf4j.Logger
LOG
static String
PRC_BUSINESS_KEY_TEMPLATE_CHANGE
protected RuntimeService
runtimeService
protected TaskService
taskService
protected TemplateEngineConfiguration
templateEngineConfiguration
protected TemplateRepositoryService
templateRepositoryService
protected static DateTimeFormatter
VERSION_DATETIME_FORMAT
-
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
Constructors Constructor Description TemplateChangeServiceImpl(TemplateRepositoryService templateRepositoryService, TemplateEngineConfiguration templateEngineConfiguration, RuntimeService runtimeService, TaskService taskService, IdentityService identityService, AuditService auditService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.ProcessInstance
findApprovalProcessInstance(String combinedTemplateVariationKey, String tenantId)
Find a running approval / change process for the specified template variation.String
getChangeApprovalProcessKey()
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 Detail
-
LOG
protected static final org.slf4j.Logger LOG
-
VERSION_DATETIME_FORMAT
protected static final DateTimeFormatter VERSION_DATETIME_FORMAT
-
PRC_BUSINESS_KEY_TEMPLATE_CHANGE
public static final String PRC_BUSINESS_KEY_TEMPLATE_CHANGE
- See Also:
- Constant Field Values
-
changeApprovalProcessKey
@Value("${flowable.template.changeApprovalProcessKey:TM_P01_templateChangeApprovalProcess}") protected String changeApprovalProcessKey
-
templateRepositoryService
protected final TemplateRepositoryService templateRepositoryService
-
templateEngineConfiguration
protected final TemplateEngineConfiguration templateEngineConfiguration
-
runtimeService
protected final RuntimeService runtimeService
-
taskService
protected final TaskService taskService
-
identityService
protected final IdentityService identityService
-
auditService
protected final AuditService auditService
-
-
Constructor Detail
-
TemplateChangeServiceImpl
public TemplateChangeServiceImpl(TemplateRepositoryService templateRepositoryService, TemplateEngineConfiguration templateEngineConfiguration, RuntimeService runtimeService, TaskService taskService, IdentityService identityService, AuditService auditService)
-
-
Method Detail
-
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
public String getChangeApprovalProcessKey()
-
setChangeApprovalProcessKey
public void setChangeApprovalProcessKey(String changeApprovalProcessKey)
-
-