<div> </div>
<div>Thanks Kris for your input. It would be great if you could share us on sample code snippet how to acheive this ObjectMarshallingStrategy for ProcessInstances .</div>
<div> </div>
<div>Also confirm us by using this approach the process is avialable for drools rule constraints to take decisions.</div>
<div> </div>
<div>Thanks</div>
<div>Prem<br><br></div>
<div class="gmail_quote">On Thu, Oct 8, 2009 at 4:07 PM, Kris Verlaenen <span dir="ltr"><<a href="mailto:kris.verlaenen@cs.kuleuven.be">kris.verlaenen@cs.kuleuven.be</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">This is indeed a special case. Process instances are already stored as<br>part of the session runtime state, so no need to store them again as<br>
part of the working memory. You need to register a custom<br>ObjectMarshallingStrategy for ProcessInstances in the working memory<br>that simply retrieves them from the session state.<br><br>Kris<br>
<div>
<div></div>
<div class="h5"><br>Quoting PremKumar s <<a href="mailto:premkumar.sivanandan@gmail.com">premkumar.sivanandan@gmail.com</a>>:<br><br>> Hi,<br>><br>><br>><br>> I am evaluating the drools expert with drool flow using<br>
> TimeManagement<br>> System. I am inserting the process instance into working memory of<br>> drools<br>> [session.insert(workflowProcessInstance)] So that the rules can use<br>> the<br>> process instance as part of Rule constraints to enable the rules to<br>
> make<br>> more sophisticated decisions based on the state of the current<br>> process<br>> instance.<br>><br>><br>><br>> Rule snippet<br>><br>><br>><br>> rule "Submit Time" ruleflow-group "Submit Time"<br>
> dialect "java"<br>> when<br>><br>> processInstance:WorkflowProcessInstance()<br>><br>> tkRequest:TKRequest ()<br>> tkRequestDAO:TKRequestDAO()<br>
> then<br>><br>> // check the current processInstance state as<br>> Active<br>> then do that<br>><br>> //Do custom operation, status change,<br>> persistence<br>
> update<br>><br>> end<br>><br>><br>><br>> The approach is works fine with using<br>> KnowledgeBuilder.newStatefulKnowledgeSession() that is no<br>> persistence. But<br>> once i have enabled the Persistence using<br>
> JPAKnowledgeService.newStatefulKnowledgeSession(know, null,<br>> getEnvironment()) it throws stack over flow error due the<br>> workflowProcessInstance is not serialized while trying to persist the<br>> newly<br>
> added workflowProcessInstance to working memory.<br>><br>><br>><br>> Once i have commented the<br>> session.insert(workflowProcessInstance)<br>> the stack overflow error is gone but none of my rules are not<br>
> executed.<br>><br>><br>><br>> Can some one provide guidance on how to pass this<br>> workflowProcessInstance to<br>> rule constriant with persistence JPAKnowledgeSession enabled.<br>><br>><br>
><br>> Thanks<br>><br>> Prem<br>><br><br><br><br><br></div></div>Disclaimer: <a href="http://www.kuleuven.be/cwis/email_disclaimer.htm" target="_blank">http://www.kuleuven.be/cwis/email_disclaimer.htm</a><br>
</blockquote></div><br>