The rules load objects from the database, and also create new ones. One of the 
instances is the one we want to work on later - this we can get with a query.
The script task is the way we are looking at the moment, it would be nice if we 
could skip that out and just directly map the parameter to be the value 
returned by query directly.

Thanks for the help,

Thomas

From: Mauricio Salatino [mailto:[email protected]]
Sent: 01 April 2011 11:18
To: Swindells, Thomas
Cc: Rules Users List
Subject: Re: [rules-users] Setting WorkItem parameter to object in working 
memory

what do you mean with version of the object?
We usually solve that with the on-entry actions of the nodes, but the BPMN2 
spec don't define those hooks to be able to execute code before and after each 
node.
Let me review the code to see how it can be done right now.
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.
Greetings.
On Fri, Apr 1, 2011 at 7:14 AM, Swindells, Thomas 
<[email protected]<mailto:[email protected]>> wrote:
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:[email protected]<mailto:[email protected]>]
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 <[email protected]<mailto:[email protected]>>
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 
[email protected]<mailto:[email protected]> 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
[email protected]<mailto:[email protected]>
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 -



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

 - Salatino "Salaboy" Mauricio -
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to