Hi,
We have a elements template for email, and it has body which is of type string.
Sometimes based on email conversation the body is exceeding 4000 chars which is causing the service task that uses elements template to fail when it is big since camunda is treating these as input variables.
Can I change the property type from String to Json? Does element template support json properties
I saw only Text type in camunda’s documentation apart from string type - Defining templates | Camunda Platform 8 Docs
{
“label”: “Body”,
“value”: “${body}”,
“type”: “String”,
“binding”: {
“type”: “camunda:inputParameter”,
“name”: “body”
},
“constraints”: {
“pattern”: {
“value”: “^(?!\s*$).+”,
“message”: “A Body is required”
}
}
},
cpbpm
August 25, 2022, 1:43am
2
You can use Text instead of String. There is a similar issue discussed here about character limit.
Thank you Stephen, finally I used Extensions instead of inputParameters (also possible to declare in Camunda Modeler template, but length is not limited as String variable). And similary as you proposed I have implemented Execution Listener (or Java Delegate) method where I am able to read the Extensions and work with them - render FreeMarker code and then store it as a File for example.
How to read Extension properties:
public class MyJavaDelegate implements JavaDelegate {
@Override
p…
{
“label”: “Template”,
“description”: “By the way, you can use freemarker templates ${…} here”,
“value”: “Hello ${firstName}!”,
“type”: “Text”,
“binding”: {
“type”: “camunda:inputParameter”,
“name”: “messageBody”,
“scriptFormat”: “freemarker”
},
“constraints”: {
“notEmpty”: true
}
}
Text and String carries the same constraint from template perspective and looks like Json is not supported in the template, any other suggestions?