import { DataUtilities } from "../../Common/DataUtilities";
import { StateManager } from "../../CommonUI/StateManagement/StateManager";
export var FlowStepOutputInstructionType;
(function (FlowStepOutputInstructionType) {
    FlowStepOutputInstructionType["END_FLOW"] = "End flow";
    FlowStepOutputInstructionType["THROW_EXCEPTION"] = "End in error";
    FlowStepOutputInstructionType["CONTINUE"] = "Continue";
    FlowStepOutputInstructionType["BRANCH"] = "Link to new sequence";
})(FlowStepOutputInstructionType || (FlowStepOutputInstructionType = {}));
export class FlowStepOutputInstructions {
    constructor(pathName, stepId) {
        this._strategy = FlowStepOutputInstructionType.BRANCH;
        this.errorMessage = "step error";
        this.candidateStackX = -1;
        this.candidateStackY = -1;
        this.pathName = pathName;
        this.stepId = stepId;
        this.connectedSequenceId = DataUtilities.generateUniqueId();
    }
    get strategy() {
        return this._strategy;
    }
    set strategy(value) {
        this._strategy = value;
        if (value !== FlowStepOutputInstructionType.BRANCH)
            this.connectedSequenceId = DataUtilities.generateUniqueId();
        // trigger refresh
        StateManager.changed(this);
    }
    getElementId() {
        return this.stepId + "-" + this.pathName.replace(/\s/g, "");
    }
}
//# sourceMappingURL=FlowStepOutputInstructions.js.map