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]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to