Search in sources :

Example 1 with ErrorWrapper

use of com.walmartlabs.concord.runtime.v2.runner.vm.ErrorWrapper in project concord by walmartlabs.

the class GroupOfStepsCompiler method compile.

@Override
public Command compile(CompilerContext context, GroupOfSteps step) {
    Command cmd = compile(context, step.getSteps());
    GroupOfStepsOptions options = Objects.requireNonNull(step.getOptions());
    WithItems withItems = options.withItems();
    if (withItems != null) {
        return WithItemsWrapper.of(cmd, withItems, options.out(), Collections.emptyMap());
    }
    Loop loop = options.loop();
    if (loop != null) {
        cmd = LoopWrapper.of(context, cmd, loop, options.out(), Collections.emptyMap());
    }
    List<Step> errorSteps = options.errorSteps();
    if (!options.errorSteps().isEmpty()) {
        cmd = new ErrorWrapper(cmd, compile(context, errorSteps));
    }
    return cmd;
}
Also used : BlockCommand(com.walmartlabs.concord.runtime.v2.runner.vm.BlockCommand) Command(com.walmartlabs.concord.svm.Command) ErrorWrapper(com.walmartlabs.concord.runtime.v2.runner.vm.ErrorWrapper)

Aggregations

BlockCommand (com.walmartlabs.concord.runtime.v2.runner.vm.BlockCommand)1 ErrorWrapper (com.walmartlabs.concord.runtime.v2.runner.vm.ErrorWrapper)1 Command (com.walmartlabs.concord.svm.Command)1