"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlowBuilderRuleStepsStories = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const FlowBuilder_1 = require("../../../FlowBuilder");
const FlowConfiguration_1 = require("@appglue/common/dist/Flow/FlowConfiguration");
const RunStatementRule_1 = require("@appglue/common/dist/Flow/Steps/Rules/RunStatementRule");
const StringDataDefinition_1 = require("@appglue/common/dist/Common/Data/Definitions/StringDataDefinition");
const FlowStepSequence_1 = require("@appglue/common/dist/Flow/Structure/FlowStepSequence");
const FormStep_1 = require("@appglue/common/dist/Flow/Steps/UI/FormStep");
const BaseFlowRuleStep_1 = require("@appglue/common/dist/Flow/Steps/Rules/BaseFlowRuleStep");
const BooleanDataDefinition_1 = require("@appglue/common/dist/Common/Data/Definitions/BooleanDataDefinition");
const RunValueTable_1 = require("@appglue/common/dist/Flow/Steps/Rules/RunValueTable");
const StoryData_1 = require("../../../../CommonUI/StoryBook/StoryData");
exports.FlowBuilderRuleStepsStories = [
    new StoryData_1.StoryNode(() => {
        let flow = new FlowConfiguration_1.FlowConfiguration();
        let primarySequence = flow.sequences[0];
        primarySequence.addStep(new RunValueTable_1.RunValueTable());
        let runStatement = new RunStatementRule_1.RunStatementRule();
        let skill = new StringDataDefinition_1.StringDataDefinition();
        skill.validValues = ["JavaScript", "Python", "C", "C++", "Java"];
        runStatement.executable.executionResult = skill;
        runStatement.outcomeStrategy = BaseFlowRuleStep_1.RuleStepStrategy.Paths;
        primarySequence.addStep(runStatement);
        let secondSequence = new FlowStepSequence_1.FlowStepSequence();
        flow.addSequence(secondSequence);
        secondSequence.desiredX = 100;
        secondSequence.desiredY = 20;
        // C++
        runStatement.getOutcomeInstructions()[3].connectedSequenceId = secondSequence._id;
        runStatement = new RunStatementRule_1.RunStatementRule();
        let fullTime = new BooleanDataDefinition_1.BooleanDataDefinition("fullTime");
        runStatement.executable.executionResult = fullTime;
        runStatement.outcomeStrategy = BaseFlowRuleStep_1.RuleStepStrategy.Paths;
        secondSequence.addStep(runStatement);
        let thirdSeq = new FlowStepSequence_1.FlowStepSequence();
        flow.addSequence(thirdSeq);
        thirdSeq.desiredX = 200;
        thirdSeq.desiredY = 20;
        runStatement.getOutcomeInstructions()[1].connectedSequenceId = thirdSeq._id;
        runStatement = new RunStatementRule_1.RunStatementRule();
        let isMale = new BooleanDataDefinition_1.BooleanDataDefinition("isMale");
        runStatement.executable.executionResult = isMale;
        runStatement.outcomeName = "isMale";
        thirdSeq.addStep(runStatement);
        thirdSeq.addStep(new FormStep_1.FormStep());
        return (0, jsx_runtime_1.jsx)(FlowBuilder_1.FlowBuilder, { flow: flow });
    }, "Flow Builder", "Designer", "Rule Steps", "Default"),
];
//# sourceMappingURL=RuleSteps-stories.js.map