import { XFlowConfiguration } from "../Structure/XFlowConfiguration";
import { FormStep } from "../Steps/UI/FormStep";
import { LogStep } from "../Steps/General/LogStep";
import { MultiOutputTestStep } from "../Steps/ExampleSteps/MultiOutputTestStep";
import { FlowStepSequence, FlowStepSequenceStrategy } from "../Structure/FlowStepSequence";
import { FlowStepOutputInstructionType } from "../Structure/FlowStepOutputInstructions";
import { CandidateSequence } from "../Structure/CandidateSequence";
export function getFlowWithSteps() {
    let flow = new XFlowConfiguration();
    flow.sequences[0].addStep(new FormStep());
    flow.sequences[0].addStep(new MultiOutputTestStep());
    flow.sequences[0].addStep(new LogStep());
    return flow;
}
export function getFlowWithNoSteps() {
    let flow = new XFlowConfiguration();
    return flow;
}
export function getFlowWithEndOrError() {
    let flow = new XFlowConfiguration();
    flow.endSequence.addStep(new FormStep());
    flow.endSequence.addStep(new LogStep());
    flow.errorSequence.addStep(new FormStep());
    flow.errorSequence.addStep(new LogStep());
    return flow;
}
export function getFlowWithMultipleSequences() {
    let flow = new XFlowConfiguration();
    let primaryMultiStep = new MultiOutputTestStep();
    flow.sequences[0].addStep(new FormStep());
    flow.sequences[0].addStep(primaryMultiStep);
    flow.sequences[0].addStep(new LogStep());
    let newSeq = new FlowStepSequence();
    newSeq.name = 'Test 1';
    newSeq.desiredX = 500;
    newSeq.desiredY = 100;
    let newStep = new MultiOutputTestStep();
    let secondPathForNewStep = newStep.getOutcomeInstructions()[1];
    secondPathForNewStep.strategy = FlowStepOutputInstructionType.BRANCH;
    let candidate = new CandidateSequence(secondPathForNewStep);
    secondPathForNewStep.connectedSequenceId = candidate._id;
    newSeq.addStep(newStep);
    newSeq.addStep(new MultiOutputTestStep());
    flow.addSequence(newSeq);
    let newSeq1 = new FlowStepSequence();
    newSeq1.name = 'Test 2';
    newSeq1.desiredX = 500;
    newSeq1.desiredY = 100;
    newSeq1.strategy = FlowStepSequenceStrategy.LINK;
    newSeq1.addStep(new MultiOutputTestStep());
    flow.addSequence(newSeq1);
    // multiple output step
    let multipleStep = flow.sequences[0].steps[1];
    // set sencond path as branch and connect it to new sequence, first path is continue.
    let secondPathForMultipleStep = multipleStep.getOutcomeInstructions()[1];
    secondPathForMultipleStep.strategy = FlowStepOutputInstructionType.BRANCH;
    secondPathForMultipleStep.connectedSequenceId = newSeq._id;
    let thirdPathForMultipleStep = multipleStep.getOutcomeInstructions()[2];
    thirdPathForMultipleStep.strategy = FlowStepOutputInstructionType.BRANCH;
    thirdPathForMultipleStep.connectedSequenceId = newSeq1._id;
    return flow;
}
//# sourceMappingURL=TestDataSetup.js.map