<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Accessing Process variable in ProcessInfo</title><link>https://community.appian.com/discussions/f/process/10747/accessing-process-variable-in-processinfo</link><description>Hi all, 
 I am using a!startProcess in a Web API. 
 In the process model, I have a Write to Data Store Entity service that saves the output to a process variable. 
 However, when I access the process variable in a!startProcess onSuccess through fv!processInfo</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Accessing Process variable in ProcessInfo</title><link>https://community.appian.com/thread/68661?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 01:31:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:70d2b2f6-fb1f-4e77-8cf9-50664317d39d</guid><dc:creator>karthip0001</dc:creator><description>&lt;p&gt;Hi Kondativ, I see &amp;nbsp;EXACTLY WHY you did this in BOLD LETTERS... :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Accessing Process variable in ProcessInfo</title><link>https://community.appian.com/thread/46922?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 06:18:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:866902ef-c35d-4757-a227-3a6c2cb3fc7f</guid><dc:creator>kondetiv</dc:creator><description>&lt;h1&gt;jraquino (johnraphaela0001) &amp;nbsp;&lt;strong&gt;It&amp;rsquo;s my pleasure. I would love to do that for you...&lt;/strong&gt;&lt;/h1&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Accessing Process variable in ProcessInfo</title><link>https://community.appian.com/thread/46920?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 06:03:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:618af455-e71b-4ffd-99bb-9912c9c30ca7</guid><dc:creator>aloks0189</dc:creator><description> Welcome :)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Accessing Process variable in ProcessInfo</title><link>https://community.appian.com/thread/46919?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 05:49:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fbdfa7d9-9abd-43d8-94bd-aecf9cf53d91</guid><dc:creator>jraaquino</dc:creator><description>Thanks for helping me out. &lt;br /&gt;
I didn&amp;#39;t get the updated value of the pv because activity chaining is not enabled in my process model.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Accessing Process variable in ProcessInfo</title><link>https://community.appian.com/thread/46915?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 04:35:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:37425788-2549-4099-9caf-2b95dd6fb34a</guid><dc:creator>aloks0189</dc:creator><description>&lt;p&gt;Hi jraquino (johnraphaela0001) as per my understanding, when you use a!startProcess(), this initiates an instance of a process Asynchronously, that means it won&amp;#39;t wait till the completion of the entire process, hence your ID field is getting Blank/Empty/null&lt;/p&gt;
&lt;p&gt;As per the documentation, this follows activity-chaining, completing only when the activity chain is complete or broken. This returns the process variables as of the completion of activity chaining through the processInfo.pv output.&lt;/p&gt;
&lt;p&gt;So as per your requirement, you need to start the process Synchronously so that you can get the ID returned as the response, so here i can suggest 2 ways to handle this scenario.&lt;/p&gt;
&lt;p&gt;1. Expose this Process model as Service, then try invoking this service using&amp;nbsp;&lt;a href="https://forum.appian.com/suite/tempo/records/item/lMBCLGOdlMUpdGVqW3dQaIKmclBmvvNEj8vu_cjb7T-5YiPr4Fu8ly5Yj1s09uenE4RYzA8zKyx7eiUhuKjLnN5vWmMZe7gc4wlExtc2Lgi9qRl9A/view/summary"&gt;Synchronous Process Model Web Service&lt;/a&gt;&amp;nbsp;&lt;strong&gt;Shared Component,&amp;nbsp;&lt;/strong&gt;this will return the complete process data including the process Variables.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. If you don&amp;#39;t want to expose the Process as Service(Mention in Point-1), then try Chaining the nodes till Write to Data Store Entity Node, of the process model, and check whether are you getting the process Variable value or not, if no, then you can design a complex Process model to achieve this, where you will have AND gateway, followed by a XOR, which will check whether&amp;nbsp;&lt;em&gt;fv!processInfo.pv.myCDT.id &lt;/em&gt;is empty or not, if yes then keep on looping till, this do not gets the value, and the other flow of AND will be going towards the Write to Data Store Entity Node.&lt;/p&gt;
&lt;p&gt;Once the XOR condition Satisfies, you can show the desired response on the screen to the End USER.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But i feel, it&amp;#39;s(Approach-2) a very Complex, Iterative &amp;amp; Time Taking approach and may cause performance issue as well.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So i feel, going for the 1st Option will be the better choice.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope this will help you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Accessing Process variable in ProcessInfo</title><link>https://community.appian.com/thread/46914?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 04:07:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:580acb35-3b0b-45c2-9846-2ff897ff22f0</guid><dc:creator>kondetiv</dc:creator><description>&lt;p&gt;@&lt;a class="internal-link view-user-profile" href="/members/johnraphaela0001"&gt;jraquino&lt;/a&gt;&amp;nbsp;I guess in your process model somewhere you are using write to data store entity smart service. Go to node outputs and save the CDT back. If you do this your primary key/id will be updated. You can access the same using&amp;nbsp;&lt;em&gt;fv!processInfo.pv. Keep in mind activity-chaining is complete.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This smart service follows&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/17.2/Configuring_Activity-Chaining.html"&gt;activity-chaining&lt;/a&gt;, completing only when the activity chain is complete or&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/17.2/Configuring_Activity-Chaining.html#Breaking_a_Chain"&gt;broken&lt;/a&gt;. The smart service then returns the process variables as of the completion of activity chaining through the&amp;nbsp;&lt;code&gt;processInfo.pv&amp;nbsp;&lt;/code&gt;output.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>