Thanks for the explanation!<br><br>I&#39;ve found the CR1 downloads, I&#39;ve just tried it, and it works just as I needed :). <br><br>Just one comment. In my first attempts I missed your comment about using a variable with the specific name &quot;processInstance&quot;... I&#39;m &quot;slower&quot; than I thought... But, just as a suggestion, it may be better to have a clearer way to use this special matching. Maybe using a fact property or a keyword... ? Well, I don&#39;t know anything about the ruleflow project and its complexity so take my suggestion as it is :).<br>
<br>Well, thanks again for the help and congratulations for your impressive work!<br><br>Ricardo.<br><br><div class="gmail_quote">2009/3/9 Kris Verlaenen <span dir="ltr">&lt;<a href="mailto:kris.verlaenen@cs.kuleuven.be">kris.verlaenen@cs.kuleuven.be</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">





<div bgcolor="#ffffff">
<div><font size="2" face="Arial">Ricardo,</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">This method has recently been added into 
WorkflowProcessInstance, it is on trunk and will be in CR1.  For M5, you 
could indeed use WorkflowProcessInstanceImpl ...</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Kris</font></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"><div><div></div><div class="h5">
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
  <div style="background: rgb(228, 228, 228) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b> 
  <a title="rgil@okode.com" href="mailto:rgil@okode.com" target="_blank">Ricardo Gil Alcaņiz</a> 
  </div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a title="rules-users@lists.jboss.org" href="mailto:rules-users@lists.jboss.org" target="_blank">Rules Users List</a> </div>

  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Monday, March 09, 2009 4:37 
PM</div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> [rules-users] Re: rules-users 
  Digest, Vol 28, Issue 19</div>
  <div><br></div>
  <div class="gmail_quote">
  <div>Thanks for your fast response Kris and Michal!<br><br>I tried to use your 
  solution Kris, but I&#39;ve found that 5.0.0 M5 WorkflowProcessInstance does not 
  seems to provide getVariable method. I&#39;ve found that method into 
  WorkflowProcessInstanceImpl searching in svn trunk. I must work with that 
  class or I missed something? Thanks again!<br><br>Ricardo.<br> </div>
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">---------- 
    Mensaje reenviado ----------<br>From: Kris Verlaenen &lt;<a href="mailto:Kris.Verlaenen@cs.kuleuven.be" target="_blank">Kris.Verlaenen@cs.kuleuven.be</a>&gt;<br>To: Rules 
    Users List &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<br>Date: Sun, 
    8 Mar 2009 03:56:29 +0100<br>Subject: Re: [rules-users] Drools Flow, 
    constraint parametrization<br>Ricardo,<br><br>If you need to access process 
    variables and have only simple constraint<br>expressions, I suggest you use 
    code constraints (Java or MVEL dialect),<br>as they have direct access to 
    variables (and globals).<br><br>If you want to use rule constraints anyway 
    (because your constraints can<br>become rather complex), there are a few 
    options:<br><br> - You cannot use globals to pass information used in 
    your constraints,<br>because globals are considered immutable with respect 
    to rule conditions<br><br> - You can put your data you want to access 
    in your working memory.<br>Rule constraints can then access this info just 
    like any normal rule.<br><br> - You access the variable value using the 
    special &quot;processInstance&quot;<br>rule constraint (I just added a new section in 
    the documentation to<br>explain):<br><br>Rule constraints do not have direct 
    access to variables defined inside<br>the process. It is however possible to 
    refer to the current process<br>instance inside a rule constraint, by adding 
    the process instance to the<br>working memory and matching to the process 
    instance inside your rule<br>constraint. We have added special logic to make 
    sure that a variable<br>&quot;processInstance&quot; of type WorkflowProcessInstance 
    will only match to the<br>current process instance and not to other process 
    instances in the<br>working memory. Note that you are however responsible 
    yourself to insert<br>(and possibly update) the process instance into the 
    session (for example<br>using Java code or an (on-entry or on-exit or 
    explicit) action in your<br>process). The following exampleof a rule 
    constraint will search for a<br>person with the same name as the value 
    stored in the variable &quot;name&quot; of<br>the process:<br><br>processInstance: 
    WorkflowProcessInstance()<br>Person( name == ( 
    processInstance.getVariable(&quot;name&quot;) ) )<br># add more constraints here 
    ...<br><br>Kris<br><br>Quoting Ricardo Gil Alcaņiz &lt;<a href="mailto:rgil@okode.com" target="_blank">rgil@okode.com</a>&gt;:<br><br>&gt; 
    Hi,<br>&gt;<br>&gt; I&#39;m not a new drools user but I started to test rule 
    flows (5.0M5)<br>&gt; recently<br>&gt; and I&#39;m stucked, so any clue will be 
    welcomed :). I&#39;m testing how to<br>&gt; share a<br>&gt; 
    StatefulKnowledgeSession between N rule flow instances. I&#39;m trying<br>&gt; 
    to<br>&gt; parametrize each instance with process variables at start time 
    but I<br>&gt; don&#39;t<br>&gt; know how to use them from rule constraints (in 
    event waits, splits,<br>&gt; etc.).<br>&gt; I&#39;ve read the documentation and 
    I&#39;ve found this text related to<br>&gt; constraints<br>&gt; &quot;Both rule and 
    code constraints have access to globals that are<br>&gt; defined for<br>&gt; 
    the process and can reuse imports at the process level.&quot; I tried it<br>&gt; 
    assigning (from an action) a variable value to a global variable but<br>&gt; 
    it&#39;s<br>&gt; not working for me. ŋI&#39;m missing something?<br>&gt;<br>&gt; 
    Thanks in advance!<br>&gt;<br>&gt; Ricardo.<br>&gt;<br></blockquote></div><br>
  </div></div><p>
  </p><hr>

  <p></p>_______________________________________________<br>rules-users mailing 
  list<div class="im"><br><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br></div><div class="im"><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></blockquote></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>