AnsweredAssumed Answered

Activiti REST start process instance is -not- asynch?

Question asked by dmill on Dec 15, 2014
Latest reply on Dec 17, 2014 by dmill
Hey guys.

I'm using activiti-rest to handle our workflow needs. One of my issues is that when I start a process instance with "runtime/process-instances" this works without problem but it will only send a response back to the client once all the tasks that can be executed are done running.
This is a huge issue as some of the tasks take a long time to complete (video encoding, etc..) and it just makes the client hang forever.
Is there a reason for this?

For full disclosure here's the process definition:


  <process id="node-pre-process" name="Generates node information">
    <startEvent id="theStart" />
    <sequenceFlow id="flow1" sourceRef="theStart" targetRef="consoleMeta"></sequenceFlow>
    <serviceTask id="consoleMeta" name="Retrieve Meta Data" activiti:type="shell" >
     <extensionElements>
      <activiti:field name="command">
          <activiti:expression>${yiiCommand}</activiti:expression>
      </activiti:field>
     <activiti:field name="arg1" stringValue="node/add-meta" />
     <activiti:field name="arg2">
          <activiti:expression>${nodeKey}</activiti:expression>
      </activiti:field>
     </extensionElements>
   </serviceTask>          
    <sequenceFlow id="flow2" sourceRef="consoleMeta" targetRef="consoleBase"></sequenceFlow>
    <serviceTask id="consoleBase" name="Generate Base Image"  activiti:type="shell" >
     <extensionElements>
      <activiti:field name="command">
          <activiti:expression>${yiiCommand}</activiti:expression>
      </activiti:field>
     <activiti:field name="arg1" stringValue="node/generate-base" />
     <activiti:field name="arg2">
          <activiti:expression>${nodeKey}</activiti:expression>
      </activiti:field>
     </extensionElements>
   </serviceTask>          
    <endEvent id="theEnd"/>
    <sequenceFlow id="flow3" sourceRef="consoleBase" targetRef="theEnd"></sequenceFlow>
  </process>

I essentially don't get a response back from activiti-rest until both of these commands are executed and done running. Weird or normal?

Outcomes