/** * look up the workflow step state for the step context, from the root workflow * * @param stepctx * @param initial * @return */ public static WorkflowStepState lookupContext(final String stepctx, final WorkflowState initial) { final String[] parts = stepctx.split("/"); // descend workflow steps to find correct step WorkflowState current = initial; WorkflowStepState currentStep = null; for (int i = 0; i < parts.length; i++) { final String part = parts[i]; final WorkflowStepState workflowStepState = current.getSteps().get(Integer.parseInt(part) - 1); currentStep = workflowStepState; if (i < parts.length - 1) { current = currentStep.getSubWorkflow(); } } return currentStep; }