==== Purpose of the component ====
The main process should be able to be finished from the subprocess. Therefor a decision is taken in the subprocess (via XOR gateway), whether the main process should be finished or continued (again via XOR gateway) after the subprocess is finished.
==== Which Actionhandlers do I need? ====
Two handler are used at the decision point **in the subprocess**:
1. A process variable is set with the [[en:software:tim:actionhandler:processvariablesetter|ProcessVariableSetter]] on node enter. A different contetn is set for every decision.
**handler class:**
com.dooris.bpm.actionhandler.ProcessVariableSetter
**parameter for continuing the process:**
name=endProcess;value=Yes;
**parameter for finishing the process:**
name=endProcess;value=No;
{{ :software:tim:bausteine:sp_stops_hp_1.png?300}}{{ :software:tim:bausteine:sp_stops_hp_2.png?300}}
2. On node-leave the set variable is send to the mainprocess with the help of the [[en:software:tim:actionhandler:writebackprocessvariablehandler|WriteBackProcessVariableHandler ]].
**Handlerklasse:**
com.dooris.bpm.actionhandler.WriteBackProcessVariableHandler
**Parameter:**
includedVariables=endProcess;
----
**In the main process** a XOR decision is needed right after the subprocess, so that the variable from the subprocess can be checked. Depending on the variable the decision is made, which way the process should take. Therefor the [[en:software:tim:actionhandler:variabledecisionhandler|VariableDecisionHandler]] is used in a XOR.
{{ :software:tim:bausteine:sp_stops_hp_3.png?300}}
com.dooris.bpm.actionhandler.VariableDecisionHandler
**Parameter**
^Name^Value|
|defaultTransition|No|
|processVariable|endProcess|
The "defaultTransition" statement is optional. It determines, which way is taken, if no manual decision is made.\\
\\
Now the IDs have to be assigned to the outputs, so that the process can take the respective way. The IDs correspond to content ("Yes" or "No"), given in the subprocess, of the variable "endProcess" (see above).
**outputs**
^Name^ID|
|No|No|
|Yes|Yes|
After that the process can be deployed and started.
iGrafX Prozesse:\\
**mainprocess** {{:software:tim:bausteine:hp_wiki_43_igx.zip|hp_wiki_43_igx.zip}} \\
**subprocess** {{:software:tim:bausteine:sp_wiki_43_igx.zip|sp_wiki_43_igx.zip}}
\\