Class TemplateChangeServiceImpl

  • All Implemented Interfaces:
    TemplateChangeService

    @Transactional
    public class TemplateChangeServiceImpl
    extends java.lang.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 Detail

      • LOG

        protected static final org.slf4j.Logger LOG
      • VERSION_DATETIME_FORMAT

        protected static final java.time.format.DateTimeFormatter VERSION_DATETIME_FORMAT
      • PRC_BUSINESS_KEY_TEMPLATE_CHANGE

        public static final java.lang.String PRC_BUSINESS_KEY_TEMPLATE_CHANGE
        See Also:
        Constant Field Values
      • changeApprovalProcessKey

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

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

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

        protected final org.flowable.engine.IdentityService identityService
    • Constructor Detail

      • 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 Detail

      • completeApprovalTask

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

        protected org.flowable.engine.runtime.ProcessInstance triggerChangeAndApprovalProcess​(java.lang.String templateVariationId,
                                                                                              java.lang.String tenantId,
                                                                                              TemplateVariationModel variationModel,
                                                                                              java.lang.String newVariationContent,
                                                                                              java.lang.String newVariationContentResource)
      • findApprovalProcessInstance

        public org.flowable.engine.runtime.ProcessInstance findApprovalProcessInstance​(java.lang.String combinedTemplateVariationKey,
                                                                                       java.lang.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​(java.lang.String templateVariationId,
                                                         java.lang.String tenantId,
                                                         java.lang.String newVariationContent,
                                                         java.lang.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)
      • loadAndCheckTemplateVariation

        protected TemplateVariationHolder loadAndCheckTemplateVariation​(java.lang.String templateVariationId,
                                                                        java.lang.String tenantId,
                                                                        boolean throwIfNotEditable)
      • getChangeApprovalProcessKey

        public java.lang.String getChangeApprovalProcessKey()
      • setChangeApprovalProcessKey

        public void setChangeApprovalProcessKey​(java.lang.String changeApprovalProcessKey)