<?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 Accessing ActivityExecution in Business Rules in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/accessing-activityexecution-in-business-rules/m-p/201456#M154586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can i access executionContext in Business rule.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my goal is to write some rules based on process variables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for instance &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;when context.getVariable('amount') &amp;gt; 100&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;then context.setvariable('accepetd',true)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If possible how can i do that?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 29 Nov 2014 07:21:17 GMT</pubDate>
    <dc:creator>mortezaadi</dc:creator>
    <dc:date>2014-11-29T07:21:17Z</dc:date>
    <item>
      <title>Accessing ActivityExecution in Business Rules</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-activityexecution-in-business-rules/m-p/201456#M154586</link>
      <description>Can i access executionContext in Business rule.my goal is to write some rules based on process variables.for instance when context.getVariable('amount') &amp;gt; 100then context.setvariable('accepetd',true)If possible how can i do that?</description>
      <pubDate>Sat, 29 Nov 2014 07:21:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-activityexecution-in-business-rules/m-p/201456#M154586</guid>
      <dc:creator>mortezaadi</dc:creator>
      <dc:date>2014-11-29T07:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing ActivityExecution in Business Rules</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-activityexecution-in-business-rules/m-p/201457#M154587</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;BR /&gt;&lt;SPAN&gt;The activiti user guide says:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.activiti.org/userguide/#bpmnBusinessRuleTask" rel="nofollow noopener noreferrer"&gt;http://www.activiti.org/userguide/#bpmnBusinessRuleTask&lt;/A&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt; For the input variable definition a list of process variables can be defined separated by a comma. &lt;BR /&gt;&lt;/CODE&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>Mon, 01 Dec 2014 07:56:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-activityexecution-in-business-rules/m-p/201457#M154587</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2014-12-01T07:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing ActivityExecution in Business Rules</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-activityexecution-in-business-rules/m-p/201458#M154588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yeah and its simply applying rules on those variable if the conditions meet the rule criteria.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;however you cannot write a rule for primitive variables!!. So de default behavior doesn't helpt me much.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for instance how can you say in Rule that &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;when variable x is grather than 100 then ….&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found the solution anyway i extended BusinessRuleBehaviour and put the execution Context in the knowledgebase before firing rules and now i can write a rule such as &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.activiti.engine.impl.pvm.delegate.ActivityExecution&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rule "TestExecution"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dialect "java"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; when&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execution : ActivityExecution(getVariable("v_v") == "tech")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execution.setVariable("v_v2",200);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("After Then XXX");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;end&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2014 08:05:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-activityexecution-in-business-rules/m-p/201458#M154588</guid>
      <dc:creator>mortezaadi</dc:creator>
      <dc:date>2014-12-01T08:05:21Z</dc:date>
    </item>
  </channel>
</rss>

