Hierarchy

  • TagPowers

Index

Methods

Methods

Static sendTags

  • Sends a collection of field tags and/or summary tags to the application

    example

    This example is a basic field tag

    import { FieldTag, TagPowers } from "@andi/powers";
    import { FieldTagTypes, ISkillContext, ISkillActivity } from "andiskills";
    import { CommercialLoanAccount } from "andiskills/lib/external/precisionLender/opportunity/OpportunityModels";
    
    // this is main execution of the skill which is called after the andi
    // skills platforms determines if it should run
    export async function run(skillContext: ISkillContext) : Promise<ISkillActivity> {
        const event = skillContext.powers.andi.event.getApplicationEvent(skillContext);
        const data = event.applicationEventData;
    
        const cla: CommercialLoanAccount = data.engineModel.commercialLoanAccounts.find((cla) => {
            return cla.id === data.contextId;
        });
    
        const fieldTag: FieldTag = {
            fields: ["amount"],
            text: "Congratulations you are pricing a loan",
            tagType: FieldTagTypes.Info,
            key: "uniqueTemplateKey",
            //Andi should only load this field tag if the amount hasn't changed
            loadWhen: [{
                query: { name: "getRawAmount", args: [] },
                comparator: "==",
                value: cla.amount,
                type: "number"
            }]
        };
    
        return TagPowers.sendTags([fieldTag]);
    }

    Parameters

    Returns ISkillActivity

Generated using TypeDoc