what do you mean with version of the object?<br>We usually solve that with the on-entry actions of the nodes, but the BPMN2 spec don&#39;t define those hooks to be able to execute code before and after each node.<br>Let me review the code to see how it can be done right now.<br>
If you include a script task before the workitem you can get the fact from the working memory and set a process variable before calling the work item.<br>Greetings.<br><br><div class="gmail_quote">On Fri, Apr 1, 2011 at 7:14 AM, Swindells, Thomas <span dir="ltr">&lt;<a href="mailto:TSwindells@nds.com">TSwindells@nds.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div link="blue" vlink="purple" lang="EN-GB"><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">They are new objects – or at least we don’t know which version of the object it is until the rules have run and worked it out.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt" lang="EN-US">From:</span></b><span style="font-size:10.0pt" lang="EN-US"> Mauricio Salatino [mailto:<a href="mailto:salaboy@gmail.com" target="_blank">salaboy@gmail.com</a>] <br>
<b>Sent:</b> 01 April 2011 10:45<br><b>To:</b> Rules Users List<br><b>Cc:</b> Swindells, Thomas<br><b>Subject:</b> Re: [rules-users] Setting WorkItem parameter to object in working memory</span></p></div></div><div><div></div>
<div class="h5"><p class="MsoNormal"> </p><p class="MsoNormal" style="margin-bottom:12.0pt">what about adding the same object that you are inserting in the working memory as a process parameter?<br>Are you generating new objects inside your rules and then you want to inject that inside a work item?<br>
Work Items have their own scope that should be decoupled from the knowledge session, so you need to find a way to copy the information from the working memory scope to the work item scope and the first thing that comes into my mind is to do it in the easiest way that it&#39;s to include that information in the process scope.<br>
Greetings.</p><div><p class="MsoNormal">2011/4/1 Swindells, Thomas &lt;<a href="mailto:TSwindells@nds.com" target="_blank">TSwindells@nds.com</a>&gt;</p><div><div><p class="MsoNormal">We have a process which runs some rules against items in the working memory. We then want to use one of the objects in the working memory as the input parameter to a work item.</p>
<p class="MsoNormal"> </p><p class="MsoNormal">The only way I can see to do this is to use a script step to fetch the fact from the wm (via a query or whatever) and then set a global, then have the global map into the in paramater.  This however seems very messy, scoping the variable far larger than it needs to. </p>
<p class="MsoNormal">Is there a more appropriate solution which doesn’t pollute the global variable namespace – perhaps running some code in the work items on entry action to populate the parameter directly?</p><p class="MsoNormal">
 </p><p class="MsoNormal">Thanks,</p><p class="MsoNormal"> </p><p class="MsoNormal">Thomas</p></div><p class="MsoNormal"> </p><div class="MsoNormal" style="text-align:center" align="center"><hr align="center" size="2" width="100%">
</div><p class="MsoNormal"><span style="font-size:7.5pt;color:gray"><br>**************************************************************************************<br>This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the <a href="mailto:postmaster@nds.com" target="_blank">postmaster@nds.com</a> and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.<br>
<br>NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00<br>**************************************************************************************</span></p>
</div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank">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></p></div><p class="MsoNormal"><br><br clear="all"><br>-- <br> - CTO @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com</a>  <br>
 - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><br> - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</p>
</div></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br> - CTO @ <a href="http://www.plugtree.com">http://www.plugtree.com</a>  <br> - MyJourney @ <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br>
 - Co-Founder @ <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -<br>