@Override public Object getProcessVariable(String name) { WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId); return process.getVariable(name); }
@Override public int getNodeInstancesSize() { return ((WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId)).getNodeInstances().size(); }
@Override public void setProcessVariable(String name, Object value) { WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId); process.setVariable(name, value); }
@Override public int getProcessState() { WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId); return process.getState(); }
public int getProcessState() { StatefulKnowledgeSession ksession = this.getKnowledgeSession(); try { WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId); return process.getState(); } finally { ksession.dispose(); } }
@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"); }
private Collection<Long> getSubFlows(ProcessInstance processInstance) { Collection<Long> result = new HashSet<Long>(); if (processInstance == null) { return result; } WorkflowProcessInstance wp = (WorkflowProcessInstance) processInstance; for (NodeInstance n : wp.getNodeInstances()) { if (n instanceof SubProcessNodeInstance) { SubProcessNodeInstance spn = (SubProcessNodeInstance) n; result.add(spn.getProcessInstanceId()); } } return result; }
public void setVariable(String variableName, Object value) { if (nodeInstance != null) { nodeInstance.setVariable(variableName, value); } else { ((WorkflowProcessInstance) getProcessInstance()).setVariable(variableName, value); } }
@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"); }
private Collection<Long> getSubFlows(ProcessInstance processInstance) { Collection<Long> result = new HashSet<Long>(); if (processInstance == null) { return result; } WorkflowProcessInstance wp = (WorkflowProcessInstance) processInstance; for (NodeInstance n : wp.getNodeInstances()) { if (n instanceof SubProcessNodeInstance) { SubProcessNodeInstance spn = (SubProcessNodeInstance) n; result.add(spn.getProcessInstanceId()); } } return result; }
public void setProcessVariable(String name, Object value) { StatefulKnowledgeSession ksession = this.getKnowledgeSession(); WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId); process.setVariable(name, value); ksession.dispose(); }
public Object getVariable(String variableName) { if (nodeInstance != null) { return nodeInstance.getVariable(variableName); } else { return ((WorkflowProcessInstance) getProcessInstance()).getVariable(variableName); } }
public int getNodeInstancesSize() { StatefulKnowledgeSession ksession = this.getKnowledgeSession(); try{ return ((WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId)).getNodeInstances().size(); } finally{ ksession.dispose(); } }
public Object getProcessVariable(String name) { StatefulKnowledgeSession ksession = this.getKnowledgeSession(); try{ WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId); return process.getVariable(name); } finally{ ksession.dispose(); } }
@Override public String getCurrentNodeName() { WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId); long nodeId = process.getNodeInstances().iterator().next().getNodeId(); return ((WorkflowProcess) this.kbase.getProcess(this.processId)).getNode(nodeId).getName(); }
public String getCurrentNodeName() { StatefulKnowledgeSession ksession = this.getKnowledgeSession(); try{ WorkflowProcessInstance process = (WorkflowProcessInstance) ksession.getProcessInstance(this.processInstanceId); long nodeId = process.getNodeInstances().iterator().next().getNodeId(); return ((WorkflowProcess) this.kbase.getProcess(this.processId)).getNode(nodeId).getName(); } finally{ ksession.dispose(); } }