@Override public Object getProcessVariable(String name) { WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId); return process.getVariable(name); }
@Override public ProcessBag getProcessBagForInstance(long instanceId) { StatefulKnowledgeSession session = getSessionForCurrentContext(); ProcessInstance instance = session.getProcessInstance(instanceId); if (instance == null || !(instance instanceof WorkflowProcessInstance)) { throw new IllegalArgumentException("Process instance with id " + instanceId + " not found"); } return (ProcessBag) ((WorkflowProcessInstance) instance).getVariable("processBag"); }
@Override public ProcessBag getProcessBagForInstance(long instanceId) { StatefulKnowledgeSession session = getSessionForCurrentContext(); ProcessInstance instance = session.getProcessInstance(instanceId); if (instance == null || !(instance instanceof WorkflowProcessInstance)) { throw new IllegalArgumentException("Process instance with id " + instanceId + " not found"); } return (ProcessBag) ((WorkflowProcessInstance) instance).getVariable("processBag"); }
public Object getVariable(String variableName) { if (nodeInstance != null) { return nodeInstance.getVariable(variableName); } else { return ((WorkflowProcessInstance) getProcessInstance()).getVariable(variableName); } }
public Object getProcessVariable(String name) { StatefulKnowledgeSession ksession = this.getKnowledgeSession(); try{ WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId); return process.getVariable(name); } finally{ ksession.dispose(); } }