NodeInstanceContainer container = (WorkflowProcessInstance) processInstance; for (int i = 0; i < nodeInstanceIds.length; i++) { for (NodeInstance subNodeInstance: container.getNodeInstances()) { if (subNodeInstance.getId() == new Long(nodeInstanceIds[i])) { if (i == nodeInstanceIds.length - 1) {