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 Details

    • 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:
    • changeApprovalProcessKey

      @Value("${flowable.template.changeApprovalProcessKey:TM_P01_templateChangeApprovalProcess}") protected String changeApprovalProcessKey
    • templateRepositoryService

      protected final TemplateRepositoryService templateRepositoryService
    • templateEngineConfiguration

      protected final TemplateEngineConfiguration templateEngineConfiguration
    • runtimeService

      protected final org.flowable.engine.RuntimeService runtimeService
    • taskService

      protected final org.flowable.engine.TaskService taskService
    • identityService

      protected final org.flowable.engine.IdentityService identityService
    • auditService

      protected final AuditService auditService
  • Constructor Details

    • TemplateChangeServiceImpl

      public TemplateChangeServiceImpl(TemplateRepositoryService templateRepositoryService, TemplateEngineConfiguration templateEngineConfiguration, org.flowable.engine.RuntimeService runtimeService, org.flowable.engine.TaskService taskService, org.flowable.engine.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 invoke TemplateChangeService.deployTemplateVariationContentChange(String, String, String, String).
      Specified by:
      triggerTemplateVariationContentChange in interface TemplateChangeService
      Parameters:
      templateVariationId - the id of the template variation to change its variation content
      updateRequest - the update request containing the necessary data (e.g. new variation content, etc) for the update
    • completeApprovalTask

      protected void completeApprovalTask(String templateVariationId, org.flowable.engine.runtime.ProcessInstance approvalPrc, UpdateTemplateVariationRequest updateRequest)
    • triggerChangeAndApprovalProcess

      protected org.flowable.engine.runtime.ProcessInstance triggerChangeAndApprovalProcess(String templateVariationId, String tenantId, TemplateVariationModel variationModel, UpdateTemplateVariationRequest request)
    • findApprovalProcessInstance

      public org.flowable.engine.runtime.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 interface TemplateChangeService
      Parameters:
      combinedTemplateVariationKey - the combined id of the template and variation key (as being returned by TemplateVariationModel.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 by TemplateChangeService.triggerTemplateVariationContentChange(String, String, UpdateTemplateVariationRequest) or as part of the change / approval process to eventually deploy the changed content.
      Specified by:
      deployTemplateVariationContentChange in interface TemplateChangeService
      Parameters:
      templateVariationId - the id of the template variation to change and deploy its content
      tenantId - the optional id of the tenant
      newVariationContent - the new variation content to change and deploy (can be null if newVariationContentResource is passed)
      newVariationContentResource - the new variation content resource to change and deploy (can be null if newVariationContent 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 by TemplateChangeService.triggerTemplateVariationContentChange(String, String, UpdateTemplateVariationRequest) or as part of the change / approval process to eventually deploy the changed content.
      Specified by:
      deployTemplateVariationContentChange in interface TemplateChangeService
      Parameters:
      templateVariationId - the ID of the template variation to change and deploy its content
      tenantId - the optional ID of the tenant
      newVariationContent - the new variation content to change and deploy (can be null if newVariationContentResource is passed)
      newVariationContentResource - the new variation content resource to change and deploy (can be null if newVariationContent 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)