我尝试仅使用 BPMN 2.0 而不是使用 DelegateTask 或侦听器发送邮件。
我试过这个:
<bpmn2:serviceTask id="ServiceTask_1" name="mailService" camunda:type="mail">
<bpmn2:extensionElements>
<camunda:field name="to" stringValue="test@test.com" />
<camunda:field name="subject" expression="Hello" />
<camunda:field name="html" expression="Hello" />
</bpmn2:extensionElements>
</bpmn2:serviceTask>
但它失败了:
Caused by: org.camunda.bpm.engine.ClassLoadingException: Could not load class: org.camunda.bpm.engine.impl.bpmn.behavior.MailActivityBehavior
at org.camunda.bpm.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:85)
at org.camunda.bpm.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:147)
... 43 more
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/mail/EmailException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at org.camunda.bpm.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:65)
... 44 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.mail.EmailException
我还将 mail-1.5.0.jar、commons-emails-1.2.jar 和 commons-logging-1.jar 添加到 $CAMUNDA_HOME/server/apache-tomcat- * /lib。
我在 Tomcat 服务器上使用 Camunda 7.1.0-Final。