This content has been marked as final.
Show 1 reply
-
1. Re: workflow with business rule task
jsvitak Dec 23, 2013 12:18 PM (in response to kannan123)Hi,
you have to insert facts (objects) into the working memory of the session in order to evaluate them. This can be done in Java code or in a script task. See the example:
ksession.insert(fact); WorkflowProcessInstance wpi = (WorkflowProcessInstance) ksession.startProcess(processId, params); ksession.insert(wpi); ksession.fireAllRules();
By inserting the workflow process instance you can reference process variables in the rule definition.
WorkflowProcessInstanceImpl( $myVariable: variables["myVariable"])
I am not sure though how to get the global variable, try this:
kcontext.getKnowledgeRuntime().getGlobal("myGlobalName");
Hope that helps,
Jiri