workflow - Activiti - Parent process of subprocess -


we using activiti workflow engine on scenario:

flow

<?xml version="1.0" encoding="utf-8"?> <definitions xmlns="http://www.omg.org/spec/bpmn/20100524/model" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/bpmn/20100524/di" xmlns:omgdc="http://www.omg.org/spec/dd/20100524/dc" xmlns:omgdi="http://www.omg.org/spec/dd/20100524/di" typelanguage="http://www.w3.org/2001/xmlschema" expressionlanguage="http://www.w3.org/1999/xpath" targetnamespace="http://www.activiti.org/test"> <signal id="alertsignal" name="alert" />   <process id="myprocess" name="myprocess" isexecutable="true">     <subprocess id="subprocess1" name="sub process">       <startevent id="startevent2" name="start"></startevent>       <endevent id="endevent1" name="end"></endevent>       <usertask id="verifico-id-transitorio-paciente" name="verifico-id-transitorio-paciente">         <extensionelements>           <activiti:tasklistener event="create" expression="#{interna_logica_tramite.setearpermisotarea(task)}"></activiti:tasklistener>           <activiti:tasklistener event="create" expression="#{interna_logica_tramite.setearpermisodependencia(task)}"></activiti:tasklistener>         </extensionelements>       </usertask>       <sequenceflow id="flow1" sourceref="startevent2" targetref="verifico-id-transitorio-paciente"></sequenceflow>       <sequenceflow id="flow2" sourceref="verifico-id-transitorio-paciente" targetref="parallelgateway1"></sequenceflow>       <parallelgateway id="parallelgateway1" name="parallel gateway"></parallelgateway>       <sequenceflow id="flow10" sourceref="parallelgateway1" targetref="ingreso-formulario-conmed"></sequenceflow>       <intermediatethrowevent id="signalintermediatethrowevent1" name="signalthrowevent">         <signaleventdefinition signalref="alertsignal"></signaleventdefinition>       </intermediatethrowevent>       <sequenceflow id="flow11" sourceref="parallelgateway1" targetref="signalintermediatethrowevent1"></sequenceflow>       <usertask id="ingreso-formulario-conmed" name="ingreso-formulario-conmed">         <extensionelements>           <activiti:tasklistener event="create" expression="#{interna_logica_tramite.setearpermisotarea(task)}"></activiti:tasklistener>           <activiti:tasklistener event="create" expression="#{interna_logica_tramite.setearpermisodependencia(task)}"></activiti:tasklistener>         </extensionelements>       </usertask>       <sequenceflow id="flow13" sourceref="ingreso-formulario-conmed" targetref="endevent1"></sequenceflow>     </subprocess>     <subprocess id="subprocess2" name="sub process">       <startevent id="startevent3" name="start"></startevent>       <endevent id="endevent2" name="end"></endevent>       <usertask id="ingreso-formulario-con" name="ingreso-formulario-con">         <extensionelements>           <activiti:tasklistener event="create" expression="#{interna_logica_tramite.setearpermisotarea(task)}"></activiti:tasklistener>           <activiti:tasklistener event="create" expression="#{interna_logica_tramite.setearpermisodependencia(task)}"></activiti:tasklistener>         </extensionelements>       </usertask>       <sequenceflow id="flow5" sourceref="startevent3" targetref="ingreso-formulario-con"></sequenceflow>       <sequenceflow id="flow6" sourceref="ingreso-formulario-con" targetref="endevent2"></sequenceflow>     </subprocess>     <startevent id="startevent1" name="start"></startevent>     <subprocess id="subprocess3" name="sub process">       <usertask id="modifico-formulario-conmed" name="modifico-formulario-conmed">         <extensionelements>         </extensionelements>       </usertask>       <startevent id="startevent4" name="start"></startevent>       <endevent id="endevent3" name="end"></endevent>       <sequenceflow id="flow8" sourceref="startevent4" targetref="modifico-formulario-conmed"></sequenceflow>       <sequenceflow id="flow9" sourceref="modifico-formulario-conmed" targetref="endevent3"></sequenceflow>     </subprocess>     <sequenceflow id="flow3" sourceref="startevent1" targetref="subprocess1"></sequenceflow>     <sequenceflow id="flow4" sourceref="subprocess1" targetref="subprocess2"></sequenceflow>     <endevent id="endevent4" name="end"></endevent>     <sequenceflow id="flow7" sourceref="subprocess2" targetref="endevent4"></sequenceflow>     <startevent id="signalstartevent1" name="signal start">       <signaleventdefinition signalref="alertsignal"></signaleventdefinition>     </startevent>     <sequenceflow id="flow14" sourceref="signalstartevent1" targetref="subprocess3"></sequenceflow>   </process> </definitions> 

and act_ru_execution table shows 2 subprocess's 2 independent process's no parent:

enter image description here

is possible parent process of subprocess , how gets represented on activiti's database ? because not finding relation.

is possible pass variables of main process subprocess in our scenario ?

parent process

how in servicetask:

select process instance have sub process instance given process instance. note there maximum one such process instance can result of query. runtimeservice.createprocessinstancequery().subprocessinstanceid(subprocessinstanceid).list();

in database:

act_ru_execution there 2 attributes parent_id_ , super_exec_.

  • parent_id_ id of execution in tree hierarchy in 1 process (e.g. parallel execution, ...)
  • super_exec_ id of super execution in process/subprocess relation

example of act_ru_execution table of process parallel executions , 1 sub-process: enter image description here

pass variables subprocess

manually in process definition or dynamically listener implementation.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -