Custom template for email task crashing workflows

I have a custom template for a service task that takes several inputs (sender, recipient, subject, body etc), with the subject and body using camunda’s built-in velocity template. The problem is when a user only inputs a token ${token} in one of the velocity fields with no other text and a process variable with that name does not exist, the workflow crashes with a ProcessEngineException, but if the input is preceded by other text, for example “text ${token}” as opposed to “${token}” the workflow runs fine and will simply send an email saying “text ${token}”.

Here is a snippet of the json for the custom template:

Here is the a snippet of the stack trace for the ProcessEngineException in camunda:

Hello @dzou422 ,

this looks like a ServiceCall or Listener tries to call a Bean registered as „test“. Search the template for this.

I hope this helps

Jonathan

1 Like

I had input “${test}” as the content of the email body in the custom template, which is set up as a velocity script input.

Hello @dzou422 ,

to me it looks like this could cause the problem. Do you have a process variable „test“ declared at the time you enter the activity with the template?

Jonathan