As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
ProcessInstanceQuery pq = runtimeService.createProcessInstanceQuery().processInstanceId(pid); ProcessInstance pi = pq.singleResult();
<br><definitions id="definitions"<br> xmlns="<a href="http://www.omg.org/spec/BPMN/20100524/MODEL" rel="nofollow noopener noreferrer">http://www.omg.org/spec/BPMN/20100524/MODEL</a>" xmlns:activiti="<a href="http://activiti.org/bpmn" rel="nofollow noopener noreferrer">http://activiti.org/bpmn</a>"<br> targetNamespace="Examples"><br><br> <process id="helloProcess"><br><br> <startEvent id="start" /><br> <sequenceFlow id="flow1" sourceRef="start" targetRef="collect1" /><br><br> <userTask id="collect1"> <br> </userTask><br><br> <sequenceFlow id="flow2" sourceRef="collect1" targetRef="end" /><br><br> <endEvent id="end" /><br><br> </process><br><br></definitions><br>
<br>ProcessInstance pi = runtimeService.startProcessInstanceByKey("helloProcess");<br><br>String taskId = taskService.createTaskQuery().singleResult().getId()<br>taskService.complete(taskId);<br><br>pi.isEnded()<br>
<br>HistoricProcessInstance hpi = historyService.createHistoricProcessInstanceQuery().processInstanceId(pid).finished().singleResult()<br>
<br>ProcessInstanceQuery pi = runtimeService.createProcessInstanceQuery().processInstanceId(pid).singleResult();<br>
But for the real use I have no idea…