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
This results in an error
Unable to resolve ObjectType 'Stage'
How do I access this objectType?
I am unable to get this to work. Can anyone provide me info on how to create a sample gateway constraints example on the Guvnor oryx designer with 3 status variables.