May we use setVariable()/getVariable() for a process variable which is not defined in a BPMN2 file?

Solution Unverified - Updated -


  • I can use setVariable()/getVariable() for a variable which is not defined in a BPMN2 file without issues. Is it a valid usage?
   ProcessInstance pi = ksession.startProcess("com.sample.bpmn.hello");
   long piid = pi.getId();

   WorkflowProcessInstance pi2 = (WorkflowProcessInstance)ksession.getProcessInstance(piid);
   pi2.setVariable("AAA", "4321"); // NOTE: "AAA" is not defined in BPMN file

   WorkflowProcessInstance pi3 = (WorkflowProcessInstance)ksession.getProcessInstance(piid, true);


  • Red Hat JBoss BPM Suite
    • 6.0.3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In