JBoss Community

How to read external parameters from within a process?

created by Umar Ashfaq in jBPM - View the full discussion

Here's my code that starts a process:

StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();  
Map<String, Object> params = new HashMap<String, Object>();
params.put("doctorsDecision", "L1"); ksession.startProcess("MyProcess", params);

And here's how I expect this variable to be available in MyProcess. This is the Action of one of my script tasks in MyProcess:

System.out.println("doctorsDecision: "+doctorsDecision); 

Is this the right way to access external variables from within a process?

 

P.S.

 

When I run my application, the process definition is never added to knowledge base because jBPM doesn't seem to recognize doctorsDecision variable. How can I tell jBPM that this variable is external and it's value will be provided on runtime? I am using BPMN2 files.

Reply to this message by going to Community

Start a new discussion in jBPM at Community