<commit_before>import mAction = module("designer/logic/Action")

export class FormTrigger {
    private formId: string;
    private triggerName: string;
    private action: mAction.Action;
    constructor(formId: string, triggerName: string) {
        //this.action = 
        this.formId = formId;
        this.triggerName = triggerName;
    }
    get FormId() {
        return this.formId;
    }
    set FormId(formId: string) {
        this.formId = formId;
    }
    get TriggerName() {
        return this.triggerName;
    }
    set TriggerName(triggerName: string) {
        this.triggerName = triggerName;
    }
    get Action() {
        return this.action;
    }
    set Action(action: mAction.Action) {
        this.action = action;
    }
    public toXML() {
        var xml = "<trigger form-id='" + this.formId + "' event='" + this.triggerName + "'>\n";
        xml += this.action.toXML();
        xml += "</trigger>\n"
        return xml;
    }
}<commit_msg>Form trigger xml export<commit_after>import mAction = module("designer/logic/Action")

export class FormTrigger {
    private formId: string;
    private triggerName: string;
    private actions: mAction.Action[];
    constructor(formId: string, triggerName: string) {
        this.actions = [];
        this.formId = formId;
        this.triggerName = triggerName;
    }
    get FormId() {
        return this.formId;
    }
    set FormId(formId: string) {
        this.formId = formId;
    }
    get TriggerName() {
        return this.triggerName;
    }
    set TriggerName(triggerName: string) {
        this.triggerName = triggerName;
    }
    get Actions() {
        return this.actions;
    }
    set Actions(actions: mAction.Action[]) {
        this.actions = actions;
    }
    public addAction(action: mAction.Action) {
        this.actions.push(action);
    }
    public toXML() {
        var xml = "<trigger form-id='" + this.formId + "' event='" + this.triggerName + "'>\n";
        var seqCount = 0;
        for (var i = 0; i < this.actions.length - 1; i++) {
            if (this.actions.length - 1 == 1) {
                xml += this.actions[i].toXML();
                break;
            }
            if (this.actions.length - i - 2 == 1) {
                xml += "<seq>\n";
                xml += "<first-operator>\n";
                xml += this.actions[i].toXML();
                xml += "</first-operator>\n";
                xml += "<second-operator>\n";
                xml += this.actions[i + 1].toXML();
                xml += "</second-operator>\n";
                xml += "</seq>\n";
                break;
            }
            else {
                xml += "<seq>\n";
                xml += "<first-operator>\n";
                xml += this.actions[i].toXML();
                xml += "</first-operator>\n";
                xml += "<second-operator>\n";
                seqCount++;
            }
        }
        for (var i = 0; i < seqCount; i++) {
            xml += "</second-operator>\n";
            xml += "</seq>\n";
        }
        xml += "</trigger>\n"
        return xml;
    }
}
{'fraction_non_alphanumeric': 0.1462705844365515, 'fraction_numerical': 0.0029060381013884403, 'mean_word_length': 1.6343537414965987, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 24}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1370734', 'n_tokens_mistral': 932, 'n_tokens_neox': 900, 'n_words': 203}