AnsweredAssumed Answered

can not start process instance without any exceptions

Question asked by on Jun 25, 2013
Latest reply on Jun 26, 2013 by
Hi~I have a bean that use for starting my process instance with the process variable, I use activiti 5.12 and activiti-cdi.
the code is quite sample:

   public void startProcess(PurchaseOrder po) {
      System.out.println("————-Process begin————");
      businessProcess.setVariable("po", po);
      System.out.println("————-set process variables done————");
      System.out.println("————-Process started————");

the system out msg use for my debug.

everything is perfect using the following bpmn:

<process id="myProcess" name="My process" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
    <userTask id="usertask1" name="User Task"></userTask>
    <sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="usertask2"></sequenceFlow>
    <userTask id="usertask2" name="User Task"></userTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow3" sourceRef="usertask2" targetRef="endevent1"></sequenceFlow>

but when i change the "usertask1" to a email task, the process instance was not deployed. the system out msg remain in —set process variables done—– but not —-Process started—— and also , there is no exceptions.

the email task is also not special :  <serviceTask id="mailtask1" name="Send email if received" activiti:type="mail">

I go on debug.

I set the email task as Asynchronous, the process instance will work, but seems the mail did not sent out successfully

and if I change the email task to a service task, it is no problem.

my engine configuration:

public ProcessEngine getProcessEngine() {
      CdiJtaProcessEngineConfiguration processEngineConfiguration = new CdiJtaProcessEngineConfiguration();
      processEngine = processEngineConfiguration.buildProcessEngine();
      return processEngine;

Looking forward for the help~ Thank you.