PrecisionLender Application Events

Overview

When pricing an opportunity in PrecisionLender, application events are sent to Andi® to notify her of changes to the opportunity. These application events can be used to determine whether a skill should run or how it should execute. You can target these Application Events within the Opportunity context in Andi® and retrieve accompanying data from the Opportunity Model.  

 

In This Article

 

Event Structure

Application Events are represented as a JSON object. Every Application Event will consist of the following structure:

eventCounter: number; // each event will have its own, unique payload.
id: string;
tenantId: string;
organizationId: string;
applicationId: string;
context: string;
currentContext?: string;
associatedViewContext?: {id: string, [prop: string]: any};
currentlyViewedContext?: { id: string; [prop: string]: any; }[];
fullContext?: string;
conversationId: string;
eventMetaData?: any;
//currently {
userEmail: string;
userFullName: string;
userId: string;
username: string
}
userId: string;
inboundChannel: ISkillChannel;
eventType: EventTypes; //e.g. Application Event
eventStartTs?: number;
eventArrivalTs?: number;
eventDepartureTs?: number;
locale:string;
applicationEventName: string; // e.g. "OpportunityCreated", "OpportunityStageChanged",
applicationEventData: any; // e.g. the opportunityModel properties for an event

 

Referencing an Application Event

Events may not appear via intellisense when you write your code.

Using a Power

To reference an application event, cast a variable using the getApplicationEvent power and then define an event variable to pass that variable with the event name

let yourVariableName = skillContext.powers.andi.event.getApplicationEvent();
let yourEventVariableName = yourVariableName && yourVariableName.applicationEventName && yourVariableName.applicationEventName.startsWith("theEventName")

Example:

let anEvent = skillContext.powers.andi.event.getApplicationEvent();
let scenarioRecalculated = anEvent && anEvent.applicationEventName && anEvent.applicationEventName.startsWith("scenarioRecalculated");

Without Using a Power

To reference an application event, cast a variable using IApplicationEvent from the skillContext. Then use that variable to define your variable with the event name. This will also allow you the ability to use intellisense to view the full IApplicationEvent shape.

let applicationEvent = skillContext.event as andiSkills.IApplicationEvent;
let yourVariableName = applicationEvent.applicationEventName && applicationEvent.applicationEventName === "theEventName"

Example:

 let event = skillContext.event as andiSkills.IApplicationEvent;
let scenarioRecalculated = event.applicationEventName && event.applicationEventName === "scenarioRecalculated";

 

Helpful Tip

If you're unsure of what event or event properties you may need to reference from the list below, follow the steps below to see the events using Developer Tools for the following web browsers:

  • In Chrome
    • Open or create an opportunity in PrecisionLender

    • Open the Developer Console in your browser

    • Select Network

    • Search and Filter on 'events'

    • Under the Headers section, expand 'Request Payload'

    • Perform the desired end user action in the opportunity in PrecisionLender.

    • All resulting events will show as their own 'event' in the request payload. Select an event to view its properties.

  • In Internet Explorer
    • Open or create an opportunity in PrecisionLender

    • Open the Developer Console in your browser

    • Select Network

    • Perform the desired end user action in the opportunity in PrecisionLender.

    • All resulting events will show with a Name/Path of 'event' in the content pane.

    • Select an 'event' in the response to view its properties in the 'Request body' tab of the Body section.

 

Application Events

Event Name & Occurrence applicationEventData (Opportunity Model Properties)
opportunityLoaded
When a user opens an existing opportunity
  • contextId: string
  • opportunity
opportunityCreated
When a user creates a new opportunity
  • contextId: string
  • opportunity
opportunityNameChanged
When a user changes the name of an opportunity.
  • contextId: string
  • opportunity
opportunitySaved
When a user saves their opportunity.
  • contextId: string
  • opportunity
opportunitySavedClick
When a user clicks 'Save' on a pop-up or the save button in the opportunity.
  • contextId: string
  • opportunity
opportunityTransferred
When a user transfers an opportunity to another user and saves the transfer.
  • contextId: string
  • opportunity
opportunityDeleted
When a user deletes an opportunity.
  • contextId: string
  • opportunity
opportunityCloseDateChanged
When a user changes the close date in the opportunity.
  • contextId: string
  • opportunity
Back to top
opportunityStageChanged
When a user changes the stage of the opportunity.
  • contextId: string
  • opportunity
opportunityRelationshipChanged
When a user changes or removes the relationship attached to an opportunity.
  • contextId: string
  • relationshipModel
opportunityNotesChanged
When a user adds or updates notes in the Notes tab of an opportunity.
  • contextId: string
  • opportunity
opportunityPrintedFullOpportunity
When a user generates the Full Opportunity printout.
  • contextId: string
  • opportunity
opportunityPrintedOpportunitySummary
When a user generates the Executive Summary printout.
  • contextId: string
  • opportunity
opportunityPrintedRelationshipImpactSummary
When a user generates the Executive Summary - Relationship Impact printout for an opportunity with an attached relationship.
  • contextId: string
  • opportunity
opportunityPrintedBorrowerSummary
When a user generates the Borrower Summary printout.
  • contextId: string
  • opportunity
opportunityPrintedOpportunityPipeline
When a user generates the Opportunity Pipeline printout.
  • contextId: string
  • opportunity
Back to top
opportunityPrintedScenarioComparison
When a user generates the Scenario Comparison printout.
  • contextId: string
  • opportunity
opportunityRecalculated
When an external change is made to an opportunity such as the addition, changing, or removal of a relationship or a change in the assumption set.
  • contextId: string
  • opportunity
opportunityRelationshipRecalculated
When a user makes a change to an opportunity with an attached relationship that results in an update to the relationship profitability, such as payoff/renewals, the addition of a loan, deposit, or other product, etc.
  • contextId: string
  • relationship
scenarioRecalculated
When a user makes a change to, addition, or removal of any product (loan, deposit, or other) for the current scenario being priced in an opportunity.
opportunityCurrentScenarioChanged
When a user makes a change to the current scenario being priced, adds a scenario to, or removes a scenario from an opportunity.
  • contextId: string
  • opportunity
scenarioAdded
When a user adds a scenario to an opportunity.
  • contextId: string
  • opportunity
  • scenario
    • id: string
scenarioRemoved
When a users selects 'Remove Scenario' in the scenario builder.
  • contextId: string
  • opportunity
  • scenario
    • id: string
Back to top
scenarioDuplicated
When a user selects 'Duplicate Scenario' in the scenario builder or the camera icon on the opportunity screen to create a new scenario.
  • contextId: string
  • opportunity
  • scenario
    • id: string
scenarioNameChanged
When a user changes the name of a scenario in an opportunity, clicks 'Duplicate Scenario' or makes a change to a field in the scenario being priced that is also included in the scenario name, such as Fees and LTV, when no custom scenario name has been added.
  • contextId: string
  • opportunity
  • scenario
    • id: string
    • name: string
scenarioEmailed
When a user selects 'Email Scenario Link' for a scenario in an opportunity.
  • contextId: string
  • opportunity
  • scenario
    • id: string
scenarioLinkCopied
When a user selects 'Copy Scenario Link' for a scenario in an opportunity.
  • contextId: string
  • opportunity
  • scenario
    • id: string
    • linkUrl: string
opportunityPipelineScenarioChanged
When a user selects 'Make Pipeline Scenario' or removes the pipeline scenario in an opportunity.
  • contextId: string
  • opportunity
scenarioCompetitorChanged
When a user indicates a scenario as competitive or changes a competitive scenario to an alternative scenario in an opportunity.
  • contextId: string
  • opportunity
  • scenario
    • competitorName: string
    • id: string
Back to top
scenarioTypeChanged
When a user changes a competitive scenario to an alternative scenario in an opportunity.
  • contextId: string
  • opportunity
  • scenario
    • id: string
scenarioDescriptionChanged
When a user adds or updates the description for a scenario in an opportunity.
  • contextId: string
  • opportunity
  • scenario
    • description: string
    • id: string
loanRecalulated
When a user updates loan information in an opportunity, including adding a loan product, to recalculate the financials.
  • accountChanges
  • contextId: string
  • engineModel
  • opportunityDetails
log-engine-change
When a user updates loan information in an opportunity, including adding a loan product, to recalculate the financials.
  • accountChanges
  • contextId: string
  • engineModel
  • opportunityDetails
loanAdded
When a loan product is added to an opportunity.
  • contextId: string
  • productFamilyId: string
  • productId: string
Back to top
commercial-loan-account-created
When a commercial loan product is added to an opportunity.
  • contextId: string
  • productFamilyId: string
  • productId: string
loanRemoved
When a loan product is removed from an opportunity.
  • contextId: string
  • loan
  • opportunity
  • scenario
    • id: string
loanNameChanged
When a user changes the name of a product on the product tab in an opportunity.
  • contextId: string
  • loan
  • opportunity
  • scenario
    • id: string
conversionLoanAdded
When a user adds the permanent loan to a loan product enabled for conversion
  • contextId: string
  • loan
  • opportunity
  • scenario
    • id: string
conversionLoanRemoved
When a user removes the permanent loan from a loan product enabled for conversion
  • contextId: string
  • loan
  • opportunity
  • scenario
    • id: string
Back to top
depositRecalculated
When a user updates deposit information in an opportunity, including adding a deposit product, to recalculate the financials.
  • accountChanges
  • contextId: string
  • engineModel
  • opportunityDetails
log-engine-change-deposit
When a user updates deposit information in an opportunity, including adding a deposit product, to recalculate the financials.
  • accountChanges
  • contextId: string
  • engineModel
  • opportunityDetails
depositAdded
When a user adds a deposit product to an opportunity
  • contextId: string
  • deposit
  • opportunity
  • scenario
    • id: string
depositRemoved
When a user removes a deposit product from an opportunity
  • contextId: string
  • deposit
  • opportunity
  • scenario
    • id: string
otherRecalculated
When a user updates information for an other product in an opportunity, including adding an other product, to recalculate the financials.
  • accountChanges
  • contextId: string
  • engineModel
  • opportunityDetails
log-engine-change-other
When a user updates information for an other product in an opportunity, including adding an other product, to recalculate the financials.
  • accountChanges
  • contextId: string
  • engineModel
  • opportunityDetails
otherAdded
When a user adds an other product to an opportunity.
  • contextId: string
  • other
  • opportunity
  • scenario
    • id: string
otherRemoved
When a user removes an other product from an opportunity.
  • contextId: string
  • other
  • opportunity
  • scenario
    • id: string
Back to top
andi-in-app-action is-helpful-yes
When a user selects 'Yes' to "Does this answer your question?" in the Andi® Window.

 no applicationEventData

andi-in-app-action is-helpful-no
When a user selects 'No' to "Does this answer your question?" in the Andi® Window.
 no applicationEventData
andi-in-app-action contact-me-learning-no
When a user selects 'No' to "I'm sorry, would you like someone to contact you?" in the Andi® Window.
 no applicationEventData
andi-in-app-action contact-me-learning-yes
When a user selects 'Yes' to "I'm sorry, would you like someone to contact you?" in the Andi® Window, which sends an email to Precisionlender Support.
 no applicationEventData
Back to top
Was this article helpful?
1 out of 1 found this helpful