title: How to get and set Local Variable List for a process in JBPM 6?
body: <p>Is there a way to get and set the global/local variable list through code in JBPM 6?</p>
  
  <p>I saw the documentation for JBPM version 3 like below:</p>
  
  <pre><code>ProcessInstance processInstance = ...;
  ContextInstance contextInstance = (ContextInstance) processInstance.getInstance(ContextInstance.class);
  </code></pre>
  
  <p>But this seems deprecated, and gives me an error.</p>
  
  <p>Additionally, I can set the variables through the bpmn editor using</p>
  
  <pre><code>kcontext.setVariable("isApproved", false);
  </code></pre>
  
  <p>But I'm not quite sure how to do retrieve this <code>kcontext</code> variable in code. I went through the getter methods for both an <code>KieSession</code> object and a <code>ProcessInstance</code> object, but no luck. </p>
  
  <p><strong>Update</strong>:
  I can access these local variables through the <code>params</code> map object which is passed to the <code>ksession.startProcess(...)</code> method. Is this the only way to get/set local/global variable lists?</p>
  
  <p>Thanks!</p>