/** * If this is a leaf step, total count will be 1 * If this step is a step macro, total count will equal the number of (direct or indirect) leaf step descendants * * @return the total number of steps represented by this StepToken */ public int getTotalStepCountWithDescendants() { int descendantCount = isStepMacro() ? 0 : 1; for ( StepToken c : childSteps) { descendantCount += c.getTotalStepCountWithDescendants(); } return descendantCount; }
public void printStepStart(StepToken step, int depth) { StringBuilder depthPadding = getDepthPadding(depth); int stepLengthChars = getStepLengthCharCount() - depthPadding.length(); String terminator = step.isStepMacro() ? "%n" : "|\r"; printStepWithoutEndState(step, depthPadding, stepLengthChars, terminator); if ( ! step.isStepMacro()) { StepProgressRunnable progress = new ShowStepProgressConsoleTask(depthPadding, stepLengthChars, step); startProgressTask(progress, PROGRESS_CURSOR_FRAME_RATE); } }
public void accept(TokenVisitor tokenVisitor) { tokenVisitor.startVisit(this); if ( isStepMacro()) { childSteps.forEach(c -> c.accept(tokenVisitor)); } tokenVisitor.endVisit(this); }
public void printStepStart(StepToken step, int depth) { StringBuilder depthPadding = getDepthPadding(depth); int stepLengthChars = getStepLengthCharCount() - depthPadding.length(); if ( step.isStepMacro() ) { printStepWithoutEndState(step, depthPadding, stepLengthChars, "%n"); } else { startProgressTask(step, depthPadding, stepLengthChars); } }
public void printStepEnd(StepToken step, int depth) { cancelStepAnimation(); if ( ! step.isStepMacro() ) { StringBuilder depthPadding = getDepthPadding(depth); int stepLengthChars = getStepLengthCharCount() - depthPadding.length(); printCompletedStep(step, depthPadding, stepLengthChars); } }
/** * @param stepInvokerProvider container for StepInvoker to run the steps * @param step details of the step to be executed * @param stepCatalogue *@param skip is true the step will be skipped if found @return the exit state of the executed step */ private StepEndState processStep(ExecutionToken executionToken, StepInvokerProvider stepInvokerProvider, StepToken step, StepCatalogue stepCatalogue, boolean skip) { log.trace("Starting to process step " + (step.isStepMacro() ? "macro " : "") + step); executionListenerSupport.notifyStepStarted(executionToken, step); StepEndState endState; if ( step.isStepMacro() ) { endState = runSteps(executionToken, stepInvokerProvider, step.getChildSteps(), stepCatalogue, skip); } else { endState = processHandlerStep(executionToken, stepInvokerProvider, step, stepCatalogue, skip); } step.setEndState(endState); executionListenerSupport.notifyStepCompleted(executionToken, step); return endState; }