Context queries allow skill writers to define how their field tag and summary tag (collectively referred to as tag) skills should interact with the application, in the current viewState, without having to write JavaScript to execute in the browser based on engagement events.

ContextQueries are defined as an object, where each object contains the following key/value parameters

  • name: defined as a string, is the name of the query (see list below)
  • args: defined as an array of any data type of objects, contain the arguments needed for the query.

The queries are stored as part of the Condition for when the tag should load.

QueryDefinitions : object

Kind: global namespace

QueryDefinitions.getPropertyFromCommercialLoanAccount : ContextQuery

This context query will get property values from current commercial loan account and works with field and summary tags.

Kind: static property of QueryDefinitions
Properties

Name Type Description
name string getPropertyFromCommercialLoanAccount
args Array.<any> For more detailed information and a list of fields refer to getPropertyFromCommercialLoanAccount

Example

// This is an example with a Summary tag that will load when the commercial
// loan amount is greater than 100,000
 
const query: ContextQuery = {
    name: "getPropertyFromCommercialLoanAccount",
    args: ["dto.amount"]
};

 const condition: Condition = {
     query: query,
     comparator: ">",
     value: 100000,
     type: "number"
};

const tag: SummaryTag = {
    key: "sample-tag",
    text: "Sample Tag",
    tagType: FieldTagTypes.Info,
    loadWhen: [condition]
};

Example

// This is an example with a Summary tag that will load when the commercial
// loan pricing date is greater then 01/01/2020
 
const query: ContextQuery = {
    name: "getPropertyFromCommercialLoanAccount",
    args: ["dto.calculated.pricingDate"]
};

 const condition: Condition = {
     query: query,
     comparator: ">",
     value: '01/01/2020',
     type: "object"
};

const tag: SummaryTag = {
    key: "sample-tag",
    text: "Sample Tag",
    tagType: FieldTagTypes.Info,
    loadWhen: [condition]
};

QueryDefinitions.getPropertyFromOpportunity : ContextQuery

This context query will get property values from Opportunity and works with field and summary tags.

Kind: static property of QueryDefinitions
Properties

Name Type Description
name string getPropertyFromOpportunity
args Array.<any> For more detailed information and a list of fields refer to getPropertyFromOpportunity

Example

// This is an example with a Summary tag that will load when the
// opportunity name equals VIP
 
const query: ContextQuery = {
    name: "getPropertyFromOpportunity",
    args: ["dto.name"]
};

 const condition: Condition = {
     query: query,
     comparator: "==",
     value: "VIP",
     type: "string"
};

const tag: SummaryTag = {
    key: "sample-tag",
    text: "Sample Tag",
    tagType: FieldTagTypes.Info,
    loadWhen: [condition]
};

Example

// This is an example with a Summary tag that will load when the 
// opportunity has an ROA > 10000
 
const query: ContextQuery = {
    name: "getPropertyFromOpportunity",
    args: ["dto.financialStatement.ROA"]
};

 const condition: Condition = {
     query: query,
     comparator: ">",
     value: 10000,
     type: "number"
};

const tag: SummaryTag = {
    key: "sample-tag",
    text: "Sample Tag",
    tagType: FieldTagTypes.Info,
    loadWhen: [condition]
};

QueryDefinitions.getPropertyFromCurrentScenario : ContextQuery

This context query will get property values from Current Scenario and works with field and summary tags.

Kind: static property of QueryDefinitions
Properties

Name Type Description
name string getPropertyFromCurrentScenario
args Array.<any> For more detailed information and a list of fields refer to getPropertyFromCurrentScenario

Example

// This is an example with a Summary tag that will load when the current
// scenario name is VIP
 
const query: ContextQuery = {
    name: "getPropertyFromCurrentScenario",
    args: ["dto.name"]
};

 const condition: Condition = {
     query: query,
     comparator: "==",
     value: "VIP",
     type: "string"
};

const tag: SummaryTag = {
    key: "sample-tag",
    text: "Sample Tag",
    tagType: FieldTagTypes.Info,
    loadWhen: [condition]
};

Example

// This is an example with a Summary tag that will load when the 
// Current Scenario's all loans financial statement has an ROA > 10000
 
const query: ContextQuery = {
    name: "getPropertyFromCurrentScenario",
    args: [dto.allLoansFinancialStatement.ROA"]
};

 const condition: Condition = {
     query: query,
     comparator: ">",
     value: 10000,
     type: "number"
};

const tag: SummaryTag = {
    key: "sample-tag",
    text: "Sample Tag",
    tagType: FieldTagTypes.Info,
    loadWhen: [condition]
};

QueryDefinitions.getPropertyFromSpecificCommercialLoanAccount : ContextQuery

This context query will get property values for a specific commercial loan account and works with field and summary tags.

Kind: static property of QueryDefinitions
Properties

Name Type Description
name string getPropertyFromSpecificCommercialLoanAccount
args Array.<any> [idOrName, propertyName] For more detailed information and a list of fields refer to getPropertyFromCommercialLoanAccount

Example

// This is an example with a Summary tag that will load when the latest commercial
// loan amount is greater than 100,000
 
// Can be the commercial loan id, latest to get the latest by create date
// or the name of the commercial loan
const idOrName: string = "latest";
const propertyName: string = "dto.amount";

const query: ContextQuery = {
    name: "getPropertyFromSpecificCommercialLoanAccount",
    args: [idOrName, propertyName]
};

 const condition: Condition = {
     query: query,
     comparator: ">",
     value: 100000,
     type: "number"
};

const tag: SummaryTag = {
    key: "sample-tag",
    text: "Sample Tag",
    tagType: FieldTagTypes.Info,
    loadWhen: [condition]
};

Example

// This is an example with a Summary tag that will load when the latest commercial
// loan pricing date is greater then 01/01/2020
 
// Can be the commercial loan id, latest to get the latest by create date
// or the name of the commercial loan
const idOrName: string = "latest";
const propertyName: string = "dto.calculated.pricingDate";

const query: ContextQuery = {
    name: "getPropertyFromSpecificCommercialLoanAccount",
    args: [idOrName, propertyName]
};

 const condition: Condition = {
     query: query,
     comparator: ">",
     value: '01/01/2020',
     type: "object"
};

const tag: SummaryTag = {
    key: "sample-tag",
    text: "Sample Tag",
    tagType: FieldTagTypes.Info,
    loadWhen: [condition]
};

QueryDefinitions.getPropertyFromDepositAccount : ContextQuery

This context query will get property values for a specific Deposit account and works with field and summary tags.

Kind: static property of QueryDefinitions
Properties

Name Type Description
name string getPropertyFromDepositAccount
args Array.<any> [idOrName, propertyName] For more detailed information and a list of fields refer to getPropertyFromDepositAccount

Example

// This is an example with a Summary tag that will load when the Deposit
// Product Name is "Certificate of Deposit" and the ROA > 100000.
 
// Can be the deposit id or the product name
const idOrName: string = "Certificate of Deposit";
const propertyName: string = "dto.financialStatement.ROA";

const query: ContextQuery = {
    name: "getPropertyFromDepositAccount",
    args: [idOrName, propertyName]
};

 const condition: Condition = {
     query: query,
     comparator: ">",
     value: 100000,
     type: "number"
};

const tag: SummaryTag = {
    key: "sample-tag",
    text: "Sample Tag",
    tagType: FieldTagTypes.Info,
    loadWhen: [condition]
};                 

QueryDefinitions.getPropertyFromOtherAccount : ContextQuery

This context query will get property values for a specific Other account and works with field and summary tags.

Kind: static property of QueryDefinitions
Properties

Name Type Description
name string getPropertyFromOtherAccount
args Array.<any> [idOrName, propertyName] For more detailed information and a list of fields refer to getPropertyFromOtherAccount

Example

// This is an example with a Summary tag that will load when the Other Account 
// Name is "Wealth Management" and net Income is greater than 100000.
 
// Can be the other account id or the it's name.
const idOrName: string = "Wealth Management";
const propertyName: string = "dto.financialStatement.netIncome";

const query: ContextQuery = {
    name: "getPropertyFromOtherAccount",
    args: [idOrName, propertyName]
};

 const condition: Condition = {
     query: query,
     comparator: ">",
     value: 100000,
     type: "number"
};

const tag: SummaryTag = {
    key: "sample-tag",
    text: "Sample Tag",
    tagType: FieldTagTypes.Info,
    loadWhen: [condition]
};