public class ProcessTemplateCmd extends AbstractNeedsTemplateDefinitionCmd implements Command<TemplateProcessingResult>
Modifier and Type | Field and Description |
---|---|
protected TemplateProcessingBuilderImpl |
templateProcessingBuilder |
Constructor and Description |
---|
ProcessTemplateCmd(TemplateProcessingBuilderImpl templateProcessingBuilder) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkPayloadParameters(TemplateHolder template,
Map<String,Object> payload)
Checks the payload to contain at least the mandatory parameter values according the template variation model.
|
protected String |
composeVariationKey(TemplateModel templateModel,
Map<String,Object> variant)
Creates the variation key which is a combination of all variant values or 'none' for none-existing ones to compose a single and unique variation key.
|
protected String |
composeVariationKey(TemplateModel templateModel,
Map<String,Object> variant,
boolean forceDefault)
Creates the variation key which is a combination of all variant values or 'none' for none-existing ones to compose a single and unique variation key.
|
TemplateProcessingResult |
execute(CommandContext commandContext) |
protected TemplateVariationDefinition |
findTemplateVariationDefinition(TemplateRepositoryService templateRepositoryService,
String templateKey,
String parentDeploymentId,
String variationKey,
String tenantId) |
protected ExpressionManager |
getExpressionManager(VariableContainer variableContainer) |
protected TemplateVariationDefinition |
getTemplateVariationDefinition(TemplateEngineConfiguration templateEngineConfiguration,
TemplateModel templateModel,
String tenantIdToUse) |
TemplateProcessingResult |
processTemplate(CommandContext commandContext,
TemplateHolder template,
Map<String,Object> payload) |
createTemplateDefinitionQuery, getTemplateDefinition
protected TemplateProcessingBuilderImpl templateProcessingBuilder
public ProcessTemplateCmd(TemplateProcessingBuilderImpl templateProcessingBuilder)
public TemplateProcessingResult execute(CommandContext commandContext)
execute
in interface Command<TemplateProcessingResult>
protected TemplateVariationDefinition getTemplateVariationDefinition(TemplateEngineConfiguration templateEngineConfiguration, TemplateModel templateModel, String tenantIdToUse)
protected TemplateVariationDefinition findTemplateVariationDefinition(TemplateRepositoryService templateRepositoryService, String templateKey, String parentDeploymentId, String variationKey, String tenantId)
protected String composeVariationKey(TemplateModel templateModel, Map<String,Object> variant)
templateModel
- the template definition model used to get the available and necessary variation keysvariant
- the variant holding variation values to compose the key fromprotected String composeVariationKey(TemplateModel templateModel, Map<String,Object> variant, boolean forceDefault)
templateModel
- the template definition model used to get the available and necessary variation keysvariant
- the variant holding variation values to compose the key fromforceDefault
- forces the use of default values if truepublic TemplateProcessingResult processTemplate(CommandContext commandContext, TemplateHolder template, Map<String,Object> payload)
protected void checkPayloadParameters(TemplateHolder template, Map<String,Object> payload)
template
- the template information where the parameters are describedpayload
- the payload with the necessary parameter values to be checkedFlowableIllegalArgumentException
- is thrown if at least one mandatory parameter is missingprotected ExpressionManager getExpressionManager(VariableContainer variableContainer)