How to set process variable ?

Solution Unverified - Updated -


We are trying to set process variable like as:

WorkflowProcessInstance wfpi = (WorkflowProcessInstance) pi;
wfpi.setVariable( "Variable", "1234" );

but it fails with below error:

Exception in thread "main" java.lang.RuntimeException: Process instance 3[com.sample.bpmn.hello] is disconnected.
    at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(
    at org.jbpm.process.instance.impl.ProcessInstanceImpl.getContextInstance(
    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.setVariable(
    at com.sample.ProcessMainSetVariable.main(


  • Red Hat JBoss BRMS
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In