<?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 consume a token programmatically in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-consume-a-token-programmatically/m-p/175478#M128608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It does sound like something is rather wrong in the modeling here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the loop A-&amp;gt;B-&amp;gt;A causes two B's then it is modeled wrong. So instead of trying to hack around it, a better question would be what the use case is and how to model it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Jun 2014 10:32:38 GMT</pubDate>
    <dc:creator>jbarrez</dc:creator>
    <dc:date>2014-06-02T10:32:38Z</dc:date>
    <item>
      <title>How to consume a token programmatically</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-consume-a-token-programmatically/m-p/175475#M128605</link>
      <description>Hi,We have some processes with user activities that can run back to past activities, thus creating something like a loop (A-&amp;gt;B-&amp;gt;A). The B-&amp;gt;A flow originates on an B´s non-terminating boundary event, so when 'A' flows to 'B' (again) we end with 2 tokens on B.I'd like to know if there is some</description>
      <pubDate>Tue, 27 May 2014 00:50:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-consume-a-token-programmatically/m-p/175475#M128605</guid>
      <dc:creator>gualberto</dc:creator>
      <dc:date>2014-05-27T00:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to consume a token programmatically</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-consume-a-token-programmatically/m-p/175476#M128606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can implement your own behavior and consume token there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp; /**&lt;BR /&gt;&amp;nbsp;&amp;nbsp; * Default way of leaving a BPMN 2.0 activity: evaluate the conditions on the&lt;BR /&gt;&amp;nbsp;&amp;nbsp; * outgoing sequence flow and take those that evaluate to true.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; */&lt;BR /&gt;&amp;nbsp; protected void leave(ActivityExecution execution) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bpmnActivityBehavior.performDefaultOutgoingBehavior(execution);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;You should change this default behavior.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would prefer to describe this functionality&amp;nbsp; in the process diagram. - More readable and not so complicated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 06:43:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-consume-a-token-programmatically/m-p/175476#M128606</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2014-05-27T06:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to consume a token programmatically</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-consume-a-token-programmatically/m-p/175477#M128607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Martin, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was trying to obtain that behavior using your suggestion (changing the element's behavior), then I got through &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org/activiti/engine/impl/bpmn/behavior/BoundaryEventActivityBehavior.java&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hoping that I would be able to kill the token "left behind" the boundary event upon the event's execution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Surprisingly I found that exists a boolean variable (named interrupting) that does exactly what I wanted inside the BoundaryEventActivityBehavior's execute method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, debugging the engine I found out that no matter what value i set on the boundary event's "cancelActivity" property , that variable is never set to true. (I forced that value hard-coding it and the behavior was what I expected).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I started searching where is the source of that value (false) on that variable (interrupting) and found out that it comes from org\activiti\editor\language\json\converter\BoundaryEventJsonConverter.java (line 91), where the BPMN model is being parsed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code is copied below ( I was testing with a timer boundary event at first ) :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;boundaryEvent.setCancelActivity(getPropertyValueAsBoolean(PROPERTY_CANCEL_ACTIVITY, elementNode));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Clearly the value is being set based on the property PROPERTY_CANCEL_ACTIVITY="cancelActivity" of that elementNode variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The thing I found very strange is that no matter which value I set on the timer boundary event at the bpmn20.xml file, it never is present on that elementNode, which seems to be a json representation of the boundary element, right from the jackson's output (all other attributes from the XML file seems to be present). That way, the getPropertyValueAsBoolean call always resolves to false (its default for not found properties), letting the boundary event interrupted variable never be "true", thus, never working as I expect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is that some kind of flaw on the parsing process? why there is that "cancelActivity" option on the timer boundary event since it (seems that) is never used?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fellipe.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 21:28:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-consume-a-token-programmatically/m-p/175477#M128607</guid>
      <dc:creator>hendrix</dc:creator>
      <dc:date>2014-05-30T21:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to consume a token programmatically</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-consume-a-token-programmatically/m-p/175478#M128608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It does sound like something is rather wrong in the modeling here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the loop A-&amp;gt;B-&amp;gt;A causes two B's then it is modeled wrong. So instead of trying to hack around it, a better question would be what the use case is and how to model it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2014 10:32:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-consume-a-token-programmatically/m-p/175478#M128608</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-06-02T10:32:38Z</dc:date>
    </item>
  </channel>
</rss>

