<?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: start activiti with message start event in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19801#M8758</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Within the BPMN Process definition you will need to create a message definition in the process model:&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/13412_pastedImage_1.png" style="width: 620px; height: 291px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the message you will use to start the process instance.&lt;/P&gt;&lt;P&gt;Next, you need to add a "Start Message Event" in your process and subscribe to the message you created:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/13413_pastedImage_2.png" style="width: 620px; height: 530px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, in order to start the instance, you can either use the REST API:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;POST /activiti-app/api/runtime-instance&lt;/P&gt;&lt;PRE class="" style="color: black; background: #eeeeee; border: 1px dashed #666666; padding: 1.25em 1.5625em 1.125em;"&gt;&lt;CODE data-lang="json" style="color: black;"&gt;{&amp;nbsp;&amp;nbsp;&amp;nbsp; "message":"myMessage",&amp;nbsp;&amp;nbsp;&amp;nbsp; "variables": [&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "name":"myVar",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "value":"This is a variable",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; ] }&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Alternatively, if you are using the Java API use:&lt;/P&gt;&lt;PRE class="" style="color: black; background: #eeeeee; border: 1px dashed #666666; padding: 1.25em 1.5625em 1.125em;"&gt;&lt;CODE data-lang="java" style="color: black; border: 0px; font-weight: inherit;"&gt;ProcessInstance startProcessInstanceByMessage("myMessage");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are looking for a complete example using java code, take a look at&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;MessageStartEventTest.java in the Activiti source&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/activiti-5.22.0/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/message/MessageStartEventTest.java" title="https://github.com/Activiti/Activiti/blob/activiti-5.22.0/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/message/MessageStartEventTest.java" rel="nofollow noopener noreferrer"&gt;Activiti/MessageStartEventTest.java at activiti-5.22.0 · Activiti/Activiti · GitHub&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Look for "testingSingleMessageStartEvent" test.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;G&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Apr 2017 21:25:24 GMT</pubDate>
    <dc:creator>gdharley</dc:creator>
    <dc:date>2017-04-25T21:25:24Z</dc:date>
    <item>
      <title>start activiti with message start event</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19799#M8756</link>
      <description>Hi,I have a simple model bpmn (start message and two tasks &lt;IMG id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&amp;nbsp;), the problem is that i dont know how to start the flow with a message,i worked with JMS and now i can get the message and all the data that i need but how i can start the flow with my message ??? what is the secret ?? O.O jaj</description>
      <pubDate>Mon, 24 Apr 2017 22:31:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19799#M8756</guid>
      <dc:creator>arag</dc:creator>
      <dc:date>2017-04-24T22:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: start activiti with message start event</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19800#M8757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ara,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you've already done the leg-work for creating the JMS integration, the rest is just utilizing Activiti's built-in APIs to call the appropriate methods to kick off a process. The &lt;A href="https://www.activiti.org/javadocs/org/activiti/engine/RuntimeService.html" rel="nofollow noopener noreferrer"&gt;API Docs&lt;/A&gt;&amp;nbsp;list several methods similar to the one you highlighted:&lt;/P&gt;&lt;PRE class="" style="color: black; background: #eeeeee; border: 1px dashed #666666; padding: 1.25em 1.5625em 1.125em;"&gt;&lt;CODE data-lang="java" style="color: black;"&gt;startProcessInstanceByMessage(&amp;lt;params&amp;gt;)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Me personally, I like to look at &lt;A href="https://github.com/Activiti/Activiti/blob/15ab72410f151970ef264b0275232b19d6739a2e/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/message/MessageStartEventTest.java" rel="nofollow noopener noreferrer"&gt;Activiti's Tests&lt;/A&gt;&amp;nbsp;in Github to see how these things work; but basically what you're going to end up doing is: Create a named message event in the process diagram, then call it as the&amp;nbsp;&lt;EM&gt;'messageName'&amp;nbsp;&lt;/EM&gt;parameter you were asking about. The &lt;A href="https://www.activiti.org/userguide/#bpmnMessageStartEvent" rel="nofollow noopener noreferrer"&gt;User Guide&lt;/A&gt;&amp;nbsp;documentation is a pretty solid reference as to how these work and setting them up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps to bridge your knowledge here &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;BR /&gt;-JEarles&lt;BR /&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>Tue, 25 Apr 2017 20:53:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19800#M8757</guid>
      <dc:creator>jearles</dc:creator>
      <dc:date>2017-04-25T20:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: start activiti with message start event</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19801#M8758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Within the BPMN Process definition you will need to create a message definition in the process model:&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/13412_pastedImage_1.png" style="width: 620px; height: 291px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the message you will use to start the process instance.&lt;/P&gt;&lt;P&gt;Next, you need to add a "Start Message Event" in your process and subscribe to the message you created:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/13413_pastedImage_2.png" style="width: 620px; height: 530px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, in order to start the instance, you can either use the REST API:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;POST /activiti-app/api/runtime-instance&lt;/P&gt;&lt;PRE class="" style="color: black; background: #eeeeee; border: 1px dashed #666666; padding: 1.25em 1.5625em 1.125em;"&gt;&lt;CODE data-lang="json" style="color: black;"&gt;{&amp;nbsp;&amp;nbsp;&amp;nbsp; "message":"myMessage",&amp;nbsp;&amp;nbsp;&amp;nbsp; "variables": [&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "name":"myVar",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "value":"This is a variable",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; ] }&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Alternatively, if you are using the Java API use:&lt;/P&gt;&lt;PRE class="" style="color: black; background: #eeeeee; border: 1px dashed #666666; padding: 1.25em 1.5625em 1.125em;"&gt;&lt;CODE data-lang="java" style="color: black; border: 0px; font-weight: inherit;"&gt;ProcessInstance startProcessInstanceByMessage("myMessage");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are looking for a complete example using java code, take a look at&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;MessageStartEventTest.java in the Activiti source&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/activiti-5.22.0/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/message/MessageStartEventTest.java" title="https://github.com/Activiti/Activiti/blob/activiti-5.22.0/modules/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/message/MessageStartEventTest.java" rel="nofollow noopener noreferrer"&gt;Activiti/MessageStartEventTest.java at activiti-5.22.0 · Activiti/Activiti · GitHub&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Look for "testingSingleMessageStartEvent" test.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;G&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 21:25:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19801#M8758</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-04-25T21:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: start activiti with message start event</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19802#M8759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!!! you save my life &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2017 13:14:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19802#M8759</guid>
      <dc:creator>arag</dc:creator>
      <dc:date>2017-04-26T13:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: start activiti with message start event</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19803#M8760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great i will try to download the example... Thanks!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2017 13:15:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/start-activiti-with-message-start-event/m-p/19803#M8760</guid>
      <dc:creator>arag</dc:creator>
      <dc:date>2017-04-26T13:15:13Z</dc:date>
    </item>
  </channel>
</rss>

