cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot resolve identifier 'task' in service task expression

andrew987654321
Champ in-the-making
Champ in-the-making
I have a service task that uses an expression to call a spring method.
It works fine when I use   #{activitiService.sendEmail(execution)}
but fails when I use    #{activitiService.sendEmail(task)}

I want to store an email template in a variable on the task definition, and fill in the template with process values in the sendMail() method.

Why does it work with execution, but not task?
I have tried to write an Execution listener expression on the start event, but that fails with the same error.

Thanks,
Andrew
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Andrew.


task: The DelegateTask that holds additional information about the current Task. Note: Only works in expressions evaluated from task listeners.
task is not evaluated in the service task.
If you want to specify template in the process definition use extensionElements (similar as activiti is using).
If you want to define template in the process instance variable just put it as a parameter into activitiService.sendmail method.

Regards
Martin