[jboss-user] [jBPM] - Share drools fact declaration between rules

sandeep rao do-not-reply at jboss.com
Thu Jan 12 10:45:09 EST 2012

sandeep rao [https://community.jboss.org/people/sandeepraopk] created the discussion

"Share drools fact declaration between rules"

To view the discussion, visit: https://community.jboss.org/message/646499#646499

I am trying to get a sample of JBPM process design to work with constraints coded in drools. I am trying to evaluate my condition based on a process parameter.

So, I inserted processInstance into the working memory by adding a script task before my Gateway.
Here i added this code to onEntryAction: (This defines an instance of Stage that i want to access in my constraint)

import org.drools.runtime.process.WorkflowProcessInstance

global WorkflowProcessInstance processInstance;

declare Stage
    status1 : String
    status2 : String
    status3 : String


        processInstance : WorkflowProcessInstance()
    Stage stage=new Stage();
    stage.setStatus1( processInstance.getVariable("status1") );
    stage.setStatus2( processInstance.getVariable("status2") );
    stage.setStatus3( processInstance.getVariable("status3") );
        insert (stage);

In the condition Expression section of the outgoinglink of my gateway I added


This results in an error 

Unable to resolve ObjectType 'Stage'

How do I access this objectType?


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120112/4086d498/attachment.html 

More information about the jboss-user mailing list