This is what we are trying to solve.

 

a)    A process has been started – then it reaches the workitem and the process waits there – and the thread ends.

b)    Now in a different thread after few days/or few hours – system gets some data from external application and has to update the workitem related content – we have to set it outside of the binary content of workiteminfo as we need to have a query (sql,ejb-ql)working against this set of updated data.

c)    I would like to change it through Drools Process because that’s where I have associated the JPA entities – I would not like to update it from outside.

d)    After the update has been done – may be after few/hrs – the work item will be completed/aborted based on the updated data.

e)    So should I try with “setVariable” – as such there won’t be any execution happening while updating the entity on that process instance?  

 

Any recommendation on this?

 

Thanks

Vijay

 

-----Original Message-----
From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Kris Verlaenen
Sent: Monday, November 23, 2009 7:10 PM
To: Rules Users List; Vijay K Pandey
Subject: Re: [rules-users] Drools Flow 5.1 - Update JPA Entity - while workitem is in pending state - variable persistence strategy

 

You want to change the JPA entities themselves?  Do you still have a

reference to them?  Simply changing them would probably work (or what is

it you are trying to do)?  Or you could look them up using the

getVariable() method.  In theory you could also use the setVariable()

method but that is not in the public API as you shouldn't be changing

variables in the middle of execution.

 

Kris

 

Quoting Vijay K Pandey <VPandey@mdes.ms.gov>:

 

> Hi,

> 

> In Drools Flow (5.1) , if for a work item "Wait For Completion" is

> true - what is the best way of updating the variables (JPA entities)

> configured through the Variable Persistence strategy - from a session

> (loaded through JPAKnowledgeService) while the work item is in the

> "Pending" state. These variables (JPA entities) were passed to the

> "startProcess" method of the session (StatefulKnowledgeSession) when

> the process was earlier started.

> 

> Thanks

> Vijay

> 

 

 

 

 

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

_______________________________________________

rules-users mailing list

rules-users@lists.jboss.org

https://lists.jboss.org/mailman/listinfo/rules-users