use of org.jbpm.kie.services.impl.admin.ProcessNodeImpl in project jbpm by kiegroup.
the class ListNodesCommand method execute.
public List<ProcessNode> execute(Context context) {
List<ProcessNode> nodes = null;
KieSession kieSession = ((RegistryContext) context).lookup(KieSession.class);
RuleFlowProcessInstance wfp = (RuleFlowProcessInstance) kieSession.getProcessInstance(processInstanceId, true);
if (wfp == null) {
throw new ProcessInstanceNotFoundException("No process instance can be found for id " + processInstanceId);
}
String processId = wfp.getProcessId();
nodes = wfp.getRuleFlowProcess().getNodesRecursively().stream().map(n -> new ProcessNodeImpl(n.getName(), n.getId(), n.getClass().getSimpleName(), processId)).collect(Collectors.toList());
return nodes;
}
Aggregations