Search in sources :

Example 1 with BranchStep

use of com.twinsoft.convertigo.beans.steps.BranchStep in project convertigo by convertigo.

the class StepWithExpressions method getStepCopyToExecute.

private Step getStepCopyToExecute(Step step) throws EngineException {
    Step stepToExecute = getStepCopy(step);
    if (stepToExecute != null) {
        stepToExecute.parent = this;
        stepToExecute.transactionContextMaintainer = ((this.parent instanceof ParallelStep) ? this : transactionContextMaintainer);
        stepToExecute.xpathApi = xpathApi;
        stepToExecute.httpState = ((stepToExecute instanceof BranchStep) ? sequence.getNewHttpState() : this.httpState);
        stepToExecute.executedSteps.putAll(executedSteps);
        if (Engine.logBeans.isTraceEnabled())
            Engine.logBeans.trace("(StepWithExpression) " + step + " [" + step.hashCode() + "] has been copied into " + stepToExecute + " [" + stepToExecute.hashCode() + "]");
    }
    return stepToExecute;
}
Also used : ParallelStep(com.twinsoft.convertigo.beans.steps.ParallelStep) BranchStep(com.twinsoft.convertigo.beans.steps.BranchStep) ParallelStep(com.twinsoft.convertigo.beans.steps.ParallelStep) BranchStep(com.twinsoft.convertigo.beans.steps.BranchStep)

Example 2 with BranchStep

use of com.twinsoft.convertigo.beans.steps.BranchStep in project convertigo by convertigo.

the class Sequence method executeNextStep.

private void executeNextStep(Step step, org.mozilla.javascript.Context javascriptContext, Scriptable scope) throws EngineException {
    Step stepToExecute = getStepCopyToExecute(step);
    if (stepToExecute != null) {
        stepToExecute.parent = this;
        stepToExecute.transactionContextMaintainer = this;
        stepToExecute.xpathApi = xpathApi;
        stepToExecute.httpState = ((stepToExecute instanceof BranchStep) ? getNewHttpState() : getStepHttpState());
        stepToExecute.executedSteps.putAll(executedSteps);
        if (Engine.logBeans.isTraceEnabled())
            Engine.logBeans.trace("(Sequence) " + step + " [" + step.hashCode() + "] has been copied into " + stepToExecute + " [" + stepToExecute.hashCode() + "]");
        stepToExecute.checkSymbols();
        if (stepToExecute.execute(javascriptContext, scope)) {
            synchronized (this) {
                childrenSteps.put(stepToExecute.executeTimeID, Long.valueOf(stepToExecute.priority));
                executedSteps.putAll(stepToExecute.executedSteps);
            }
        } else {
            stepToExecute.cleanCopy();
        }
    }
    currentChildStep++;
}
Also used : BranchStep(com.twinsoft.convertigo.beans.steps.BranchStep) BranchStep(com.twinsoft.convertigo.beans.steps.BranchStep) XMLCopyStep(com.twinsoft.convertigo.beans.steps.XMLCopyStep)

Aggregations

BranchStep (com.twinsoft.convertigo.beans.steps.BranchStep)2 ParallelStep (com.twinsoft.convertigo.beans.steps.ParallelStep)1 XMLCopyStep (com.twinsoft.convertigo.beans.steps.XMLCopyStep)1