<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to signal another process? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3361#M1241</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK&amp;nbsp;i guess it;s time for me to answer my own question. Please advice me if there is more trivial solution in place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i did in my mockup. Process A. start -&amp;gt; set business key variable -&amp;gt; User Task -&amp;gt; end&lt;/P&gt;&lt;P&gt;Process A has Signal "globalSignalA" defined&amp;nbsp;&lt;/P&gt;&lt;P&gt;User Task has Signal Boundary Event with signal reference to "&lt;SPAN&gt;globalSignalA&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process B : start -&amp;gt; run script (groovy code provided below) -&amp;gt; end&lt;/P&gt;&lt;P&gt;groovy script. gets RuntimeService, collects information about executions with signal subscription:&amp;nbsp;globalSignalA and calls&amp;nbsp;&lt;STRONG&gt;signalEventReceivedAsync (&lt;/STRONG&gt;watchout&lt;/P&gt;&lt;P&gt;signalEventReceived wont work). (activiti version: 5.22.0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is example of a groovy script i am running,&amp;nbsp;somebody can find it usefull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import org.activiti.engine.runtime.ExecutionQuery&lt;BR /&gt;import org.activiti.engine.task.Task&lt;BR /&gt;import org.activiti.engine.runtime.ProcessInstance&lt;BR /&gt;import org.activiti.engine.RuntimeService&lt;BR /&gt;import org.activiti.engine.runtime.ProcessInstanceQuery&lt;BR /&gt;import org.activiti.engine.runtime.Execution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RuntimeService runtimeService = processEngine.getRuntimeService();&lt;/P&gt;&lt;P&gt;ProcessInstanceQuery procInstanceQuery = runtimeService.createProcessInstanceQuery()&lt;BR /&gt;String lBusinessKey= (String) execution.getVariable('testId') &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//gimmi list of active processes by business key&lt;/P&gt;&lt;P&gt;List&amp;lt;ProcessInstance&amp;gt; instances = procInstanceQuery.processInstanceBusinessKey(lBusinessKey).active().list()&lt;BR /&gt;int x=0&lt;BR /&gt;for (ProcessInstance lProcInstance: instances)&lt;BR /&gt;{&lt;BR /&gt;x+=1&lt;BR /&gt;System.out.println('proc found: ' + lProcInstance.getName() + ', business key=' + lProcInstance.getBusinessKey())&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if (x==0)&lt;BR /&gt; System.out.println('no related active processes found!')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//gimmi executions with globalSignalA by business key&lt;/P&gt;&lt;P&gt;x=0&lt;/P&gt;&lt;P&gt;List&amp;lt;Execution&amp;gt; executions = runtimeService.createExecutionQuery()&lt;BR /&gt; .processInstanceBusinessKey(lBusinessKey, true)&lt;BR /&gt; .signalEventSubscriptionName("globalSignalA")&lt;BR /&gt; .list();&lt;BR /&gt; &lt;BR /&gt; System.out.println('list executions...') &lt;BR /&gt; for (Execution exec : executions)&lt;BR /&gt; {&lt;BR /&gt; x+=1&lt;BR /&gt; System.out.println('sending signal to ' + exec.getName() + ' processInstanceId:' + exec.getProcessInstanceId()) &lt;BR /&gt;// runtimeService.signalEventReceived("globalSignalA", exec.getId());&lt;BR /&gt; runtimeService.signalEventReceivedAsync('globalSignalA', exec.getId())&lt;BR /&gt; }&lt;BR /&gt;System.out.println('signals sent ' + x)&lt;BR /&gt;System.out.println('done')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jan 2017 11:31:26 GMT</pubDate>
    <dc:creator>vipi_voxa</dc:creator>
    <dc:date>2017-01-19T11:31:26Z</dc:date>
    <item>
      <title>How to signal another process?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3360#M1240</link>
      <description>Hello dear all,Basically i am struggling with understanding how to send and receive signals (messages) between different processes.&amp;nbsp;Could you please help me to design or give me a hints how to create&amp;nbsp;in Eclipse Activiti Designer&amp;nbsp;something like this&lt;IMG id="smileytongue" class="emoticon emoticon-smileytongue" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rocess "A": start-&amp;gt; User Task-&amp;gt; end.process</description>
      <pubDate>Thu, 19 Jan 2017 08:46:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3360#M1240</guid>
      <dc:creator>vipi_voxa</dc:creator>
      <dc:date>2017-01-19T08:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to signal another process?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3361#M1241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK&amp;nbsp;i guess it;s time for me to answer my own question. Please advice me if there is more trivial solution in place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i did in my mockup. Process A. start -&amp;gt; set business key variable -&amp;gt; User Task -&amp;gt; end&lt;/P&gt;&lt;P&gt;Process A has Signal "globalSignalA" defined&amp;nbsp;&lt;/P&gt;&lt;P&gt;User Task has Signal Boundary Event with signal reference to "&lt;SPAN&gt;globalSignalA&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process B : start -&amp;gt; run script (groovy code provided below) -&amp;gt; end&lt;/P&gt;&lt;P&gt;groovy script. gets RuntimeService, collects information about executions with signal subscription:&amp;nbsp;globalSignalA and calls&amp;nbsp;&lt;STRONG&gt;signalEventReceivedAsync (&lt;/STRONG&gt;watchout&lt;/P&gt;&lt;P&gt;signalEventReceived wont work). (activiti version: 5.22.0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is example of a groovy script i am running,&amp;nbsp;somebody can find it usefull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import org.activiti.engine.runtime.ExecutionQuery&lt;BR /&gt;import org.activiti.engine.task.Task&lt;BR /&gt;import org.activiti.engine.runtime.ProcessInstance&lt;BR /&gt;import org.activiti.engine.RuntimeService&lt;BR /&gt;import org.activiti.engine.runtime.ProcessInstanceQuery&lt;BR /&gt;import org.activiti.engine.runtime.Execution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RuntimeService runtimeService = processEngine.getRuntimeService();&lt;/P&gt;&lt;P&gt;ProcessInstanceQuery procInstanceQuery = runtimeService.createProcessInstanceQuery()&lt;BR /&gt;String lBusinessKey= (String) execution.getVariable('testId') &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//gimmi list of active processes by business key&lt;/P&gt;&lt;P&gt;List&amp;lt;ProcessInstance&amp;gt; instances = procInstanceQuery.processInstanceBusinessKey(lBusinessKey).active().list()&lt;BR /&gt;int x=0&lt;BR /&gt;for (ProcessInstance lProcInstance: instances)&lt;BR /&gt;{&lt;BR /&gt;x+=1&lt;BR /&gt;System.out.println('proc found: ' + lProcInstance.getName() + ', business key=' + lProcInstance.getBusinessKey())&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if (x==0)&lt;BR /&gt; System.out.println('no related active processes found!')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//gimmi executions with globalSignalA by business key&lt;/P&gt;&lt;P&gt;x=0&lt;/P&gt;&lt;P&gt;List&amp;lt;Execution&amp;gt; executions = runtimeService.createExecutionQuery()&lt;BR /&gt; .processInstanceBusinessKey(lBusinessKey, true)&lt;BR /&gt; .signalEventSubscriptionName("globalSignalA")&lt;BR /&gt; .list();&lt;BR /&gt; &lt;BR /&gt; System.out.println('list executions...') &lt;BR /&gt; for (Execution exec : executions)&lt;BR /&gt; {&lt;BR /&gt; x+=1&lt;BR /&gt; System.out.println('sending signal to ' + exec.getName() + ' processInstanceId:' + exec.getProcessInstanceId()) &lt;BR /&gt;// runtimeService.signalEventReceived("globalSignalA", exec.getId());&lt;BR /&gt; runtimeService.signalEventReceivedAsync('globalSignalA', exec.getId())&lt;BR /&gt; }&lt;BR /&gt;System.out.println('signals sent ' + x)&lt;BR /&gt;System.out.println('done')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 11:31:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3361#M1241</guid>
      <dc:creator>vipi_voxa</dc:creator>
      <dc:date>2017-01-19T11:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to signal another process?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3362#M1242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe I'm missing something but your code appears to get a list of process executions that have a subscription to "globalSignalA" and individually "release" these by signalling them.&lt;BR /&gt;&lt;BR /&gt;If his is truly a global signal, then setting the signal listeners to the default of "global" scope means that as soon as an intermediate send signal event is sent, all listeners will fire automatically. You really shouldnt need to write code to satisfy this use case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 17:47:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3362#M1242</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-01-19T17:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to signal another process?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3363#M1243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No-no it is probably me who is missing something. What is a signal listener - have not found one in the activiti user guide, and how to make it to listen for the (global) signal also based on business key or some other correlation id?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried signalintermediatecatchevent and signal boundary events none of them fires when the other process throws the signal. (unless i do my groovy&amp;nbsp;code).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 20:51:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3363#M1243</guid>
      <dc:creator>vipi_voxa</dc:creator>
      <dc:date>2017-01-19T20:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to signal another process?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3364#M1244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, the "real" name is an Intermediate Signal Throw event:&lt;BR /&gt;&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/12153_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;Make sure your signal definition is "global" scoped and you should be golden.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 22:05:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3364#M1244</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-01-19T22:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to signal another process?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3365#M1245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greg, Thank you for the taking a look at my question and quick responses!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well yes throwing and catching signals are working ok. But it seems not to be what i am asking for. I will try to rephrase, maybe i was not that clear at the first place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is example and output from my processes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am doing: (based on your proposed solution):&lt;/P&gt;&lt;P&gt;Process&amp;nbsp;B starts -&amp;gt; sets business key id to '2'-&amp;gt; send HT to kermit (with boundry to global signal A)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Process A starts -&amp;gt; sets business key id to '1' -&amp;gt; throws (global singal A)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I need&lt;/STRONG&gt;: Process B with business key 2, &lt;STRONG&gt;stays active&lt;/STRONG&gt; (is not receiving a signal), because it has different business identification.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i got:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Server:common-server] 10:50:42,989 [default task-27] INFO stdout - Process B (358392). Set Business key to: 2&lt;BR /&gt;[Server:common-server] 10:50:42,990 [default task-27] INFO stdout - Process B (358392). Sending H Task to mr. Kermit.&lt;BR /&gt;[Server:common-server] 10:50:50,365 [default task-28] INFO stdout - Process A (358402). Set business key to: 1&lt;BR /&gt;[Server:common-server] 10:50:50,366 [default task-28] INFO stdout - Process A (358402). Sending signal...&lt;BR /&gt;[Server:common-server] 10:50:51,070 [default task-28] INFO stdout - Process B (358392). Closing HT because signal is&lt;BR /&gt;received.&lt;BR /&gt;[Server:common-server] 10:50:51,072 [default task-28] INFO stdout - Process B (358392). By I am done.&lt;BR /&gt;[Server:common-server] 10:50:51,231 [default task-28] INFO stdout - Process A (358402). Done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to stress one more time - The main&amp;nbsp;point in my requirement is that i need to send signals only and only to related (by some correlation id) processes. (not to all processes which are waiting for global signal). Meanwhile i don't see any other ops for that only but running kinda script i gave example earlier.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 08:59:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-signal-another-process/m-p/3365#M1245</guid>
      <dc:creator>vipi_voxa</dc:creator>
      <dc:date>2017-01-23T08:59:49Z</dc:date>
    </item>
  </channel>
</rss>

