Class TemplateProcessingBuilderImpl
- java.lang.Object
-
- com.flowable.template.engine.impl.runtime.TemplateProcessingBuilderImpl
-
- All Implemented Interfaces:
TemplateProcessingBuilder
public class TemplateProcessingBuilderImpl extends Object implements TemplateProcessingBuilder
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
disableContentItemCreation
protected String
parentDeploymentId
protected Map<String,Object>
payload
protected String
templateKey
protected TemplateServiceImpl
templateService
protected String
tenantId
protected VariableContainer
variableContainer
protected boolean
variableContainerSameDeployment
protected Map<String,Object>
variant
-
Constructor Summary
Constructors Constructor Description TemplateProcessingBuilderImpl(TemplateServiceImpl templateService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemplateProcessingBuilder
disableContentItemCreation()
By default aContentItem
is created for types that support it.String
getParentDeploymentId()
Map<String,Object>
getPayload()
String
getTemplateKey()
TemplateServiceImpl
getTemplateService()
String
getTenantId()
VariableContainer
getVariableContainer()
Map<String,Object>
getVariant()
boolean
isDisableContentItemCreation()
boolean
isVariableContainerSameDeployment()
TemplateProcessingBuilder
parentDeploymentId(String parentDeploymentId)
Restricts the lookup of theTemplateDefinition
using theTemplateProcessingBuilder.templateKey(String)
to the given parent deployment.TemplateProcessingBuilder
payload(Map<String,Object> payload)
the optional payload, if the template is using placeholders to render properly (must be valid according the parameter definition)TemplateProcessingResult
process()
Processes a template referenced through its key and variant data (if set) which is then looked up within the repository and represented by aTemplateVariationModel
.void
setDisableContentItemCreation(boolean disableContentItemCreation)
void
setParentDeploymentId(String parentDeploymentId)
void
setPayload(Map<String,Object> payload)
void
setTemplateKey(String templateKey)
void
setTemplateService(TemplateServiceImpl templateService)
void
setTenantId(String tenantId)
void
setVariableContainer(VariableContainer variableContainer)
void
setVariant(Map<String,Object> variant)
TemplateProcessingBuilder
templateKey(String templateKey)
The key of the template to process.TemplateProcessingBuilder
tenantId(String tenantId)
The tenantId for looking up the template definition.TemplateProcessingBuilder
variableContainer(VariableContainer variableContainer)
An instance that has variables such as a task, process or case instance.TemplateProcessingBuilder
variableContainerSameDeployment(boolean sameDeployment)
Whether the template model for processing should be looked within the same deployment of thevariableContainer
.TemplateProcessingBuilder
variant(Map<String,Object> variant)
the variant of the template needed (according the variation definitionsTemplateModel.getVariationDefinitions()
, might be null or empty if the template only has one single variation)
-
-
-
Field Detail
-
templateService
protected TemplateServiceImpl templateService
-
templateKey
protected String templateKey
-
variableContainer
protected VariableContainer variableContainer
-
variableContainerSameDeployment
protected boolean variableContainerSameDeployment
-
disableContentItemCreation
protected boolean disableContentItemCreation
-
parentDeploymentId
protected String parentDeploymentId
-
tenantId
protected String tenantId
-
-
Constructor Detail
-
TemplateProcessingBuilderImpl
public TemplateProcessingBuilderImpl(TemplateServiceImpl templateService)
-
-
Method Detail
-
templateKey
public TemplateProcessingBuilder templateKey(String templateKey)
Description copied from interface:TemplateProcessingBuilder
The key of the template to process.- Specified by:
templateKey
in interfaceTemplateProcessingBuilder
-
variableContainer
public TemplateProcessingBuilder variableContainer(VariableContainer variableContainer)
Description copied from interface:TemplateProcessingBuilder
An instance that has variables such as a task, process or case instance. When no variant variables were set and a variable container is passed, the model is inspected to retrieve the variant variables from it. If the variant variables are set explicitely, these variables are ignored.- Specified by:
variableContainer
in interfaceTemplateProcessingBuilder
-
variableContainerSameDeployment
public TemplateProcessingBuilder variableContainerSameDeployment(boolean sameDeployment)
Description copied from interface:TemplateProcessingBuilder
Whether the template model for processing should be looked within the same deployment of thevariableContainer
. Has impact only ifvariableContainer
has been set.- Specified by:
variableContainerSameDeployment
in interfaceTemplateProcessingBuilder
-
variant
public TemplateProcessingBuilder variant(Map<String,Object> variant)
Description copied from interface:TemplateProcessingBuilder
the variant of the template needed (according the variation definitionsTemplateModel.getVariationDefinitions()
, might be null or empty if the template only has one single variation)- Specified by:
variant
in interfaceTemplateProcessingBuilder
-
payload
public TemplateProcessingBuilder payload(Map<String,Object> payload)
Description copied from interface:TemplateProcessingBuilder
the optional payload, if the template is using placeholders to render properly (must be valid according the parameter definition)- Specified by:
payload
in interfaceTemplateProcessingBuilder
-
parentDeploymentId
public TemplateProcessingBuilder parentDeploymentId(String parentDeploymentId)
Description copied from interface:TemplateProcessingBuilder
Restricts the lookup of theTemplateDefinition
using theTemplateProcessingBuilder.templateKey(String)
to the given parent deployment. This is typically needed when the template service is called for example from the process or case engine to generate a document and it needs to look up the template definition in the same deployment.- Specified by:
parentDeploymentId
in interfaceTemplateProcessingBuilder
-
tenantId
public TemplateProcessingBuilder tenantId(String tenantId)
Description copied from interface:TemplateProcessingBuilder
The tenantId for looking up the template definition. If aTemplateProcessingBuilder.variableContainer(VariableContainer)
is set, the tenant id will be taken from there, unless a tenantId was explicitely set with this method.- Specified by:
tenantId
in interfaceTemplateProcessingBuilder
-
disableContentItemCreation
public TemplateProcessingBuilder disableContentItemCreation()
Description copied from interface:TemplateProcessingBuilder
By default aContentItem
is created for types that support it. Calling this method will disable the creation of that conten item.- Specified by:
disableContentItemCreation
in interfaceTemplateProcessingBuilder
-
process
public TemplateProcessingResult process()
Description copied from interface:TemplateProcessingBuilder
Processes a template referenced through its key and variant data (if set) which is then looked up within the repository and represented by aTemplateVariationModel
. The payload is used for the placeholders within the template content and must be valid according theTemplateVariationModel.getParameters()
definition.- Specified by:
process
in interfaceTemplateProcessingBuilder
-
getTemplateService
public TemplateServiceImpl getTemplateService()
-
setTemplateService
public void setTemplateService(TemplateServiceImpl templateService)
-
getTemplateKey
public String getTemplateKey()
-
setTemplateKey
public void setTemplateKey(String templateKey)
-
getVariableContainer
public VariableContainer getVariableContainer()
-
setVariableContainer
public void setVariableContainer(VariableContainer variableContainer)
-
isVariableContainerSameDeployment
public boolean isVariableContainerSameDeployment()
-
isDisableContentItemCreation
public boolean isDisableContentItemCreation()
-
setDisableContentItemCreation
public void setDisableContentItemCreation(boolean disableContentItemCreation)
-
getParentDeploymentId
public String getParentDeploymentId()
-
setParentDeploymentId
public void setParentDeploymentId(String parentDeploymentId)
-
getTenantId
public String getTenantId()
-
setTenantId
public void setTenantId(String tenantId)
-
-