import { eventBus, ElsaPlugin } from "../services";
import { ActivityDesignDisplayContext, EventTypes, SyntaxNames } from "../models";
import { parseJson } from "../utils/utils";

export class DynamicOutcomesPlugin implements ElsaPlugin {
    constructor() {
        eventBus.on(EventTypes.ActivityDesignDisplaying, this.onActivityDesignDisplaying);
    }

    onActivityDesignDisplaying = (context: ActivityDesignDisplayContext) => {
        const propValuesAsOutcomes = context.activityDescriptor.inputProperties.filter(prop => prop.considerValuesAsOutcomes);
        
        if (propValuesAsOutcomes.length > 0)
        {