Mail Task - ActivitiIllegalArgumentException

Showing results for 
Search instead for 
Did you mean: 
Senior Member

Mail Task - ActivitiIllegalArgumentException


Eventually, I want to send an email notification based on Freemarker template when the workflow is finished. I know I can do it using Javascript or Java but I saw this is also possible with Activiti itself (I will allow me to use Freemarker template easily).

Unfortunately, when when I create an Alfresco Mail Task in the process definition, I get an ActivitiIllegalArgumentException error.


myProject       |  2020-02-16 11:42:34,727  ERROR [impl.interceptor.CommandContext] [http-nio-8080-exec-10] Error while closing command context
myProject       |  org.activiti.engine.ActivitiIllegalArgumentException: Field definition uses unexisting field 'mail.parameters.subject' on class org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate



This is part of my process definition:


    <serviceTask id="alfrescoMailtask1" name="Alfresco Mail Task" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
        <activiti:field name="script">
          <activiti:string><![CDATA[var mail = actions.create("mail");
        <activiti:field name="mail.parameters.subject">
        <activiti:field name="">
        <activiti:field name="mail.parameters.html">
              Hello ${male ? 'Mr.' : 'Mrs.' } ${recipientName},<br/><br/>

              As of ${now}, the process has been rejected <b>rejected</b>.<br/><br/>


              The Company.


What's wrong with it?


PS. How can I populate Freemarker model with additional variable? Is execution.setVariable('foo', 'test'); enough?

Alfresco Developer