<?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 How to access the processExecutionID of the currently created process. in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-the-processexecutionid-of-the-currently-created/m-p/20746#M9122</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to BPMN modeling and Activiti. I started working on it. I learnt to create a process by a post call&lt;/P&gt;&lt;P&gt;"runtime/process-instances" and passing the Process definition key to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to mark the&amp;nbsp;Tasks using "runtime/tasks/" + taskId" post call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to implement an&amp;nbsp;product ordering, manufacturing and delivering process. Lets call it order management system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to map each order to the instance of the process created for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to set the variable order with the order ID while creating the process itself. like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Map&amp;lt;String, Object&amp;gt; v =new HashMap&amp;lt;String, Object&amp;gt;();&lt;BR /&gt; v.add("orderID",orderId);&lt;/P&gt;&lt;P&gt;and passing the map to the post call like below&lt;/P&gt;&lt;P&gt;/runtime/tasks/" + taskId, pojo)&lt;/P&gt;&lt;P&gt;But thats not setting the process variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other way is, I can set the process Execution Id on the order object and then I can map the process to the order object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, I don't know how to access the processExecutionId of the currently created process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be very help if the answer has some samples in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the Help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Feb 2017 16:23:29 GMT</pubDate>
    <dc:creator>imthiaz_d</dc:creator>
    <dc:date>2017-02-25T16:23:29Z</dc:date>
    <item>
      <title>How to access the processExecutionID of the currently created process.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-the-processexecutionid-of-the-currently-created/m-p/20746#M9122</link>
      <description>Hi,I am new to BPMN modeling and Activiti. I started working on it. I learnt to create a process by a post call"runtime/process-instances" and passing the Process definition key to it.I am able to mark the&amp;nbsp;Tasks using "runtime/tasks/" + taskId" post call.I am trying to implement an&amp;nbsp;product ordering,</description>
      <pubDate>Sat, 25 Feb 2017 16:23:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-access-the-processexecutionid-of-the-currently-created/m-p/20746#M9122</guid>
      <dc:creator>imthiaz_d</dc:creator>
      <dc:date>2017-02-25T16:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to access the processExecutionID of the currently created process.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-the-processexecutionid-of-the-currently-created/m-p/20747#M9123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Imthiaz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure, based on your comments whether you're doing all of this in Java or Javascript - can you give a little more detail on where you're trying to do this? Is it in Java or Javascript, or potentially all over REST?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At a brief level:&lt;BR /&gt;If you're doing this in Java, there is something called a &lt;A href="https://www.activiti.org/javadocs/org/activiti/engine/RuntimeService.html" rel="nofollow noopener noreferrer"&gt;RuntimeService&lt;/A&gt;, that has several methods to start processes. Each of these methods has an overloaded version that allows for a parameter that contains the variable utilized within the process. This &lt;A href="http://www.nurkiewicz.com/2011/01/activiti-processes-and-executions.html" rel="nofollow noopener noreferrer"&gt;blog post&lt;/A&gt; has a couple utilization examples of the RuntimeService.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're doing this in Javascript over REST, since you have access to the 'TaskId', you should be able to perform a GET &lt;EM&gt;/tasks/{taskId}&lt;/EM&gt; which will include the executionId if it has been set by that time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're doing this in the Javascript (Angular) of Activiti, these values exist inside the &lt;EM&gt;$scope&amp;nbsp;&lt;/EM&gt;variable - particularly &lt;EM&gt;$scope.task&lt;/EM&gt;&amp;nbsp;will contain the data you're looking for, depending on your location inside the app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is a start, but I can help more with a little bit more context,&lt;BR /&gt;-JEarles&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>Mon, 27 Feb 2017 20:46:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-access-the-processexecutionid-of-the-currently-created/m-p/20747#M9123</guid>
      <dc:creator>jearles</dc:creator>
      <dc:date>2017-02-27T20:46:13Z</dc:date>
    </item>
  </channel>
</rss>

