/** * Creates a new step in this flow, with the specified name, that follows the * current step in sequence. * * @param stepName * the name of the step to be created * @return the newly created step * @throws ElementAlreadyInModel * if a step with the specified name already exists in the use case */ public StepPart step(String stepName) { Objects.requireNonNull(stepName); FlowPart flowPart = stepPart.getFlowPart(); FlowStep trailingStepInFlow = createTrailingStepInFlow(stepName, flowPart); StepPart trailingStepInFlowPart = new StepPart(trailingStepInFlow, stepPart.getUseCasePart(), flowPart); return trailingStepInFlowPart; }