Cannot resolve identifier 'task' in service task expression
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2014 04:00 AM
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
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
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2014 02:52 AM
Hi Andrew.
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
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
