[rules-users] Setting WorkItem parameter to object in working memory

Swindells, Thomas TSwindells at nds.com
Fri Apr 1 06:14:57 EDT 2011


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.

From: Mauricio Salatino [mailto:salaboy at gmail.com]
Sent: 01 April 2011 10:45
To: Rules Users List
Cc: Swindells, Thomas
Subject: Re: [rules-users] Setting WorkItem parameter to object in working memory

what about adding the same object that you are inserting in the working memory as a process parameter?
Are you generating new objects inside your rules and then you want to inject that inside a work item?
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's to include that information in the process scope.
Greetings.
2011/4/1 Swindells, Thomas <TSwindells at nds.com<mailto:TSwindells at nds.com>>
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.

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.
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?

Thanks,

Thomas

________________________________

**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster at nds.com<mailto:postmaster at nds.com> 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.

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
**************************************************************************************

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org<mailto:rules-users at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users



--
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110401/5c0e638a/attachment.html 


More information about the rules-users mailing list