cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a process from another process

agiledevpro
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to figure out how to call a process from another. I also need the result of the first process to be sent to the second one.
I've read something about call activiti, but I have no idea on how to use it.

Please help

3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi

http://www.activiti.org/userguide/#bpmnSubprocessAndCallActivity
jUnit test example in activiti source:
org.activiti.examples.bpmn.callactivity.CallActivityTest

Regards
Martin

agiledevpro
Champ in-the-making
Champ in-the-making
Hi, thank you for your answer!

I have managed to call a process from my main process, but I'm having problem calling my sub process with my process variables in my main process. I get an error saying that:
<code>
org.activiti.engine.impl.bpmn.behavior.ScriptTaskActivityBehavior - Exception while executing subprocess : problem evaluating script: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: processVariables for class: Script3
</code>

I call my subprocess using a callActivity in my main process:
<code>
<callActivity id="callSubProcess" calledElement="subprocess">
   <extensionElements>
    <activiti:in source="processVariables" target="${processVariables}" />
   </extensionElements>
  </callActivity>
</code>

And the process variables are defined in my main process and sub process like this:
<code>
<extensionElements>
   <activiti:in source="processVariables" target="${processVariables}" />
  </extensionElements>
</code>

Help please, what am I missing?

agiledevpro
Champ in-the-making
Champ in-the-making
Hi, managed to solve my problem.

The solution was to specify both in and out source/target in my main process like this:
<code>
<extensionElements>
   <activiti:in source="processVariables" target="processVariables" />
                        <activitiSmiley Surprisedut source="processVariables" target="processVariables" />
</extensionElements>
</code>

and in my sub process:
<code>
<extensionElements>
   <activiti:in source="processVariables" target="processVariables" />
</extensionElements>
</code>