How to call a process from another process

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.

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>

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>

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" /> <activiti:out source="processVariables" target="processVariables" /></extensionElements></code>