AnsweredAssumed Answered

I want to make 'cc' as optional in mail task

Question asked by sandeep.upatange on Jun 14, 2016
Latest reply on Dec 21, 2016 by cjose
I want to make "cc" as optional in mail task, If no value passed to "cc" it is throwing below error.
Can any one tell me how to solve it.

My Mail Task code :

<serviceTask id="submitrequestmail" name="User Submit Request Mail" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to">
          <activiti:expression><![CDATA[${to}]]></activiti:expression>
        </activiti:field>
        <activiti:field name="from">
          <activiti:expression><![CDATA[${from}]]></activiti:expression>
        </activiti:field>
        <activiti:field name="subject">
          <activiti:expression><![CDATA[Your request with number ${requestNo} submitted successfully.]]></activiti:expression>
        </activiti:field>
        <activiti:field name="cc">
          <activiti:expression><![CDATA[${cc}]]></activiti:expression>
        </activiti:field>
        <activiti:field name="html">
          <activiti:expression><![CDATA[<html>
               <body>
                 Dear ${user},<br/><br/>
                 Your request with number ${requestNo} submitted successfully.<br/><br/>                
               </body>
              </html>]]></activiti:expression>
        </activiti:field>
      </extensionElements>
    </serviceTask>

Error:
<code>
org.activiti.engine.ActivitiException: Unknown property used in expression: ${cc}
   at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:53) ~[activiti-engine-5.19.0.2.jar:5.19.0.2]
   at org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior.getStringFromField(MailActivityBehavior.java:336) ~[activiti-engine-5.19.0.2.jar:5.19.0.2]
   at org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior.execute(MailActivityBehavior.java:80) ~[activiti-engine-


Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'cc'
   at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83) ~[activiti-engine-5.19.0.2.jar:5.19.0.2]
   at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50) ~[activiti-engine-5.19.0.2.jar:5.19.0.2]
   at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26) ~[activiti-engine-5.19.0.2.jar:5.19.0.2]
   at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114) ~[activiti-engine-5.19.0.2.jar:5.19.0.2]
   at org.activiti.engine.impl.delegate.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:33) ~[activiti-engine-5.19.0.2.jar:5.19.0.2]
<code>

Outcomes