<?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: Scope on Message within Subprocess  in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201661#M154791</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It was just my understanding.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rephrasing: what happens when the catch message event, or the receive message task, receive a message? do they persist as variable or what?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for the second part:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;what i'm trying to do is to check if parallel subprocess can receive messages and do computation on the value they get without having problems of writing on the same variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the script task (process is shown in the png of the first post) are like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;println "t1: " + execution.getVariable("mydata")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;println "t2: " + execution.getVariable("mydata")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;println "t3: " + execution.getVariable("mydata")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and the execution of the process is done via the Java u see in the first post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;now:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the subprocess has 2 parallel instances, i send a message (containing a variable name "mydata") to the first loop with value "loop 1", and to the second instance with value "loop 2", the first script task prints the values correctly "t1:loop 1" for first instance and "t1:loop 2" for the second.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Till here everything is fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then after 10 seconds the process calls the second script task which, to me, should print "t2:loop 1" for the first instance, since the first instance of the parallel process received "loop 1",&amp;nbsp; and "t2: loop 2" for the second instance. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead, it prints "t2: loop 2" for both, which seem that the catch event stored a global variable named "mydata" as global and accessible by both subprocess. in fact, the third script task prints "loop 2". instead it should have no access to that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to sum, the ouput is like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t1: loop 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t1: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;t2: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t2: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;t3: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this is why to me seemed that the message that arrives is stored as a setVariable(). but probably i miss some part.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What i need is: how can i have model/set the process in a way that the message received by the subprocess can be accessed only by the subprocess? thus have an output like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t1: loop 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t1: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;t2: loop 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t2: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;t3: &amp;lt;nothing/error&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Feb 2015 16:54:03 GMT</pubDate>
    <dc:creator>esseti</dc:creator>
    <dc:date>2015-02-18T16:54:03Z</dc:date>
    <item>
      <title>Scope on Message within Subprocess</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201659#M154789</link>
      <description>Hello all.As far as i understood setVariable() creates global variable, while seVariableLocal() creates a variable with the scope that is the partent object, so if it's within a subprocess it's not accessible from outside.Now, the receive message task (or a catch message event) seems to use setVaria</description>
      <pubDate>Mon, 16 Feb 2015 10:07:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201659#M154789</guid>
      <dc:creator>esseti</dc:creator>
      <dc:date>2015-02-16T10:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scope on Message within Subprocess</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201660#M154790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure where you got that messages are stored as variables?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, not sure what you are trying to do here. Where are you calling execution.setVariableLocal() yourself?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 16:12:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201660#M154790</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2015-02-18T16:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scope on Message within Subprocess</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201661#M154791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It was just my understanding.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rephrasing: what happens when the catch message event, or the receive message task, receive a message? do they persist as variable or what?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for the second part:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;what i'm trying to do is to check if parallel subprocess can receive messages and do computation on the value they get without having problems of writing on the same variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the script task (process is shown in the png of the first post) are like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;println "t1: " + execution.getVariable("mydata")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;println "t2: " + execution.getVariable("mydata")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;println "t3: " + execution.getVariable("mydata")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and the execution of the process is done via the Java u see in the first post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;now:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the subprocess has 2 parallel instances, i send a message (containing a variable name "mydata") to the first loop with value "loop 1", and to the second instance with value "loop 2", the first script task prints the values correctly "t1:loop 1" for first instance and "t1:loop 2" for the second.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Till here everything is fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then after 10 seconds the process calls the second script task which, to me, should print "t2:loop 1" for the first instance, since the first instance of the parallel process received "loop 1",&amp;nbsp; and "t2: loop 2" for the second instance. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead, it prints "t2: loop 2" for both, which seem that the catch event stored a global variable named "mydata" as global and accessible by both subprocess. in fact, the third script task prints "loop 2". instead it should have no access to that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to sum, the ouput is like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t1: loop 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t1: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;t2: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t2: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;t3: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this is why to me seemed that the message that arrives is stored as a setVariable(). but probably i miss some part.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What i need is: how can i have model/set the process in a way that the message received by the subprocess can be accessed only by the subprocess? thus have an output like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t1: loop 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t1: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;t2: loop 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;t2: loop 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;t3: &amp;lt;nothing/error&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Feb 2015 16:54:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201661#M154791</guid>
      <dc:creator>esseti</dc:creator>
      <dc:date>2015-02-18T16:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Scope on Message within Subprocess</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201662#M154792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&amp;gt; rephrasing: what happens when the catch message event, or the receive message task, receive a message? do they persist as variable or what?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No. They are catched on the element, and that's it. All side effects like storing something will need to be done by yourself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For your second part: variables are stored by default globally. If you need to store data locally, you need to use the execution.setVariableLocal() methods. &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 08:12:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201662#M154792</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2015-02-28T08:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Scope on Message within Subprocess</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201663#M154793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I see.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;so what's the best (easiest) way to store a variable? with a ScripTask? or what? can i create an extension of a receive task that automatically stores the variable?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a tutorial/blog/guide that you can point me at, to see how things should made.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 08:25:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201663#M154793</guid>
      <dc:creator>esseti</dc:creator>
      <dc:date>2015-03-02T08:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Scope on Message within Subprocess</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201664#M154794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use a script task for that, or an execution listener. Both are covered in the user guide.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 10:33:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201664#M154794</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2015-03-02T10:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Scope on Message within Subprocess</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201665#M154795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In javadoc for messageEventReceived(), it said:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Notifies the process engine that a message event with the name 'messageName' has been received and has been correlated to an execution with id 'executionId'. The waiting execution is notified synchronously.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Variables are set for the scope of the execution of the message event subscribed to the message name. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The scope for an intermediate message event in the main process is that of the process instance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The scope for an intermediate message event in a subprocess is that of the subprocess&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The scope for a boundary message event is that of the execution for the Activity the event is attached to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But in fact , the implementation code uses execution.setVariables() to set variables, so all are gone to the global scope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think it's a bug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2016 02:04:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scope-on-message-within-subprocess/m-p/201665#M154795</guid>
      <dc:creator>royqh1979</dc:creator>
      <dc:date>2016-11-25T02:04:38Z</dc:date>
    </item>
  </channel>
</rss>

