Hi,

 

      I am evaluating the drools expert with drool flow using TimeManagement System. I am inserting the process instance into working memory of drools [session.insert(workflowProcessInstance)]  So that the rules can use the process instance as part of Rule constraints to enable the rules to make more sophisticated decisions based on the state of the current process instance.

 

Rule snippet

 

rule "Submit Time"  ruleflow-group "Submit Time"
       dialect "java"
       when

               processInstance:WorkflowProcessInstance()

               tkRequest:TKRequest ()
               tkRequestDAO:TKRequestDAO()
       then

                    // check the current processInstance state as Active then do that

                       //Do custom operation, status change, persistence update  

       end

 

       The approach is works fine with using KnowledgeBuilder.newStatefulKnowledgeSession() that is no persistence.  But once i have enabled the Persistence using JPAKnowledgeService.newStatefulKnowledgeSession(know, null, getEnvironment())  it throws stack over flow error due the workflowProcessInstance is not serialized while trying to persist the newly added workflowProcessInstance  to working memory.

 

           Once i have commented the session.insert(workflowProcessInstance) the stack overflow error is gone but none of my rules are not executed. 

 

Can some one provide guidance on how to pass this workflowProcessInstance to rule constriant with persistence JPAKnowledgeSession enabled.

 

Thanks

Prem