I want to send an email when task is assigned to a user kind of email notification. So I was thinking to attach a task listener create event on the usertask and select a java class file with sending an email implementation. But I don’t know what should I put in fields. I want to call function sendEmail(to, subject, text) with these parameters from that email class. How do I set these parameters in spring and call this function with these parameters. Is my approach correct??? May be there could be a better approach please help.
I thought you wanted to use a Spring bean, so myBean would be the Spring bean.
For more details you can read the docs here (http://www.flowable.org/docs/userguide/index.html#taskListeners).
Yes, the to, subject and text should be variables.
execution is a reserved keyword that you can send as input parameter and you the use a DelegateExecution instance as parameter in the sendEmail method. On a DelegateExecution you can get all the process instance variables as well, in addition to process instance id etc.