[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

--------------------------------------------------------------
Hi,
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
end

rule

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




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


Stage(status1=="open")


This results in an error 

Unable to resolve ObjectType 'Stage'

How do I access this objectType?

-Sandeep
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/646499#646499]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- 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