@Override public void setProcessVariable(long processInstanceId, String variableId, Object value) { ProcessInstanceDesc piDesc = dataService.getProcessInstanceById(processInstanceId); KieSession ksession = domainService.getSessionById(piDesc.getSessionId()); ProcessInstance processInstance = ksession.getProcessInstance(processInstanceId); ((WorkflowProcessInstance) processInstance).setVariable(variableId, value); }
@Override public Collection<String> getAvailableSignals(String businessKey, long processInstanceId) { ProcessInstanceDesc piDesc = dataService.getProcessInstanceById(processInstanceId); KieSession ksession = domainService.getSessionById(piDesc.getSessionId()); ProcessInstance processInstance = ksession.getProcessInstance(processInstanceId); Collection<String> activeSignals = new ArrayList<String>(); if (processInstance != null) { ((ProcessInstanceImpl) processInstance) .setProcess(ksession.getKieBase().getProcess(processInstance.getProcessId())); Collection<NodeInstance> activeNodes = ((WorkflowProcessInstance) processInstance).getNodeInstances(); activeSignals.addAll(ProcessInstanceHelper.collectActiveSignals(activeNodes)); } return activeSignals; }
public StatefulKnowledgeSessionSummary getSessionSummaryByName(int sessionId) { return StatefulKnowledgeSessionHelper.adapt(domainService.getSessionById(sessionId)); }