AnsweredAssumed Answered

Optional email task CC addresses

Question asked by ericsnyder on May 15, 2013
Latest reply on May 16, 2013 by ericsnyder
I have an email task. My "To" field is required but the "CC" field is optional on my form. When I do not select any email addresses for the "CC" field then I get an exception:
<blockquote>
Caused by: org.activiti.engine.ActivitiException: Could not add  as cc recipient
   at org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior.addCc(MailActivityBehavior.java:144)
   at org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior.execute(MailActivityBehavior.java:59)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:86)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525)
</blockquote>
and later…
<!–break–>

<blockquote>
Caused by: org.apache.commons.mail.EmailException: Illegal address
   at org.apache.commons.mail.Email.createInternetAddress(Email.java:605)
   at org.apache.commons.mail.Email.addCc(Email.java:806)
   at org.apache.commons.mail.Email.addCc(Email.java:789)
   at org.apache.commons.mail.Email.addCc(Email.java:769)
   at org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior.addCc(MailActivityBehavior.java:142)
   … 126 more
Caused by: javax.mail.internet.AddressException: Illegal address in string ``''
   at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:108)
   at org.apache.commons.mail.Email.createInternetAddress(Email.java:578)
   … 130 more
</blockquote>

I have tried numerous conditionals in the JUEL (none worked) and tried having my bean return "" for the email addresses. Is there a way that I can optionally set the "CC" field in a mail task?

Outcomes