Free cookie consent management tool by TermsFeed

Modify KYC Process Selection Logic

This content applies solely to Connected KYC, which must be purchased separately from the Appian base platform. This content was written for Appian 23.3 and may not reflect the interfaces or functionality of other Appian versions.

Introduction

When a new KYC investigation is created, Connected KYC knows which default tasks need to be assigned automatically. The KYC process template selected for the investigation is based on the customer attributes.

Out of the box, Connected KYC uses the Domicile and Customer Type to determine which KYC process template to select. For example, if a user selects a hedge fund customer in Germany, Connected KYC will generate a different set of tasks and questions than if the user selects a family office customer in Hong Kong.

This page describes how to add or remove the attributes used to select the KYC process templates for an investigation. For instructions on how to modify service process templates see Managing templates.

Adding a selection attribute

If your organization wants to use an attribute other than Domicile and Customer Type, you will need to add a new attribute.

Adding a new selection attribute consists of:

  • Updating objects to store the new attribute for template selection.
  • Enabling the attribute value to be selected when setting up a KYC process template.
  • Enabling the solution to use the new attribute to select the correct template when a new investigation is created.
  • Enabling the solution to properly audit any changes made to the templates with this new attribute.

Next, we will walk through an example that shows how to add a customer's industry classification code as a new attribute.

Step 1: Update the template reference CDT

To save the new attribute value, you need to add it to the CDT for the KYC process template's CDT.

To update the template reference CDT:

  1. Add the attribute as a field to the AS_KYC_TMG_T_Template CDT.
    • Follow desired naming convention for database tables.
  2. Verify and publish the data store.
    • Open the AS KYC Template Tables data store.
    • Click Verify.
    • Click Save & Publish.

EXAMPLE

The image shows the industryClassificationCode field added to the AS_KYC_TMG_T_Template CDT.

IndustryClassificationCode.png

Step 2: Update the template audit configuration rule

The template audit configuration rule is used to track template changes that are the result of attribute changes. For example, when a user changes a template mapping from one industry classification code to another code, the change is captured in the audit history.

After adding a field to the AS_KYC_TMG_T_Template CDT, you need to update the audit configuration rule for the CDT.

To update the template audit configuration rule:

  1. Open the AS_KYC_TMG_ADT_BL_auditConfig_R_Template expression rule.
  2. Add the new field name to the list of fields.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
Audit config for 
'type!{urn:com:appian:types:AS:KYC:TMG}AS_KYC_TMG_T_Template'
*/
a!map(
  /*This rule is used to set the external mapping field values after querying the ADT process again, as these values will not be contained in the templates that are required from the DB and therefore not audited against.*/
  idField: "templateId",
  simpleFields: a!flatten(
    {
      /*"templateId", excluded since it is the primary key*/
      "templateName",
      "templateDesc",
      "dueDateCalculationUnit",
      "customerDomicile",
      "customerTypeCode",
      "isDefault",
      "industryClassificiationCode"
    }
  )

Step 3: Update the template attributes interface

When setting up the process template, users will select the new attribute value. First, you need to add the attribute to the interface so users can select it. Additionally, you need to save their selection to the database and pass the selection into related interfaces.

To update the template attributes interface:

  1. Open the AS_KYC_TMG_CPS_manageReferenceTemplate_Attributes expression rule.
  2. Add a local variable to query data for industry classification code.
    1
    2
    3
    4
    5
    6
    7
    8
    
    local!globalIndustryClasses: rule!AS_FS_QE_getGlobalIndustryClasses(
     returnType: cons!AS_CO_ENUM_QE_RETURN_TYPE_OBJECT_ARRAY,
     sort: a!sortInfo(
       field: "className",
       ascending: true
     ),
     i18nData: ri!i18nData
      )
    
  3. Add a new dropdown component input to allow the user to choose a value for the new attribute and save their selection. Copy the design used for the existing attributes.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    
     ...
     rule!AS_CO_CP_dropdownFieldForSelection(
     label: rule!AS_CO_I18N_UT_displayLabel(
          i18nData: ri!i18nData,
          bundleKey: "AS.FS.AllBundles.lbl_IndustryClassificationCode"
     ),
     placeholderLabel: rule!AS_CO_I18N_UT_displayLabel(
          i18nData: ri!i18nData,
          bundleKey: "AS.FS.AllBundles.lbl_Code"
     ),
     required: true(),
     choiceLabels: local!globalIndustryClasses.className,
     choiceValues: local!globalIndustryClasses.classCode,
     value: ri!template.industryClassificationCode,
     saveInto: { ri!template.industryClassificationCode }
      )
     ...
    

Step 4: Update template query rule

The AS_KYC_TMG_QE_getTemplates expression rule queries the database to retrieve templates. For Connected KYC to select the correct template, you need to add the new attribute to this expression rule so that it will be included in the query parameters.

To update the template query rule:

  1. Open the AS_KYC_TMG_QE_getTemplates expression rule.
  2. Add a rule input with the same name as the new field that you added to the CDT.
  3. Add a query filter where the new field equals the new rule input.
    • Note: In the following example, replace <newField> with the name of the field that you added to the CDT.
1
2
3
4
5
    a!queryFilter(
      field: "<newField>",
      operator: "=",
      value: ri!<newField>
  )

EXAMPLE

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
        a!queryFilter(
          field: "templateName",
          operator: "=",
          value: ri!templateName
        ),
        a!queryFilter(
          field: "isActive",
          operator: "=",
          value: ri!isActive
        ),
        a!queryFilter(
          field: "isDeleted",
          operator: "=",
          value: false,
          applywhen: a!defaultValue(value: ri!isActive, default: false)
        ),
        a!queryFilter(
          field: "isDefault",
          operator: "=",
          value: ri!isDefault
        ),
        a!queryFilter(
          field: "industryClassificationCode",
          operator: "=",
          value: ri!industryClassificationCode
        )

Step 5: Update the rule that retrieves the templates

The AS_KYC_BL_getTemplateByCustomerAttributes expression rule is a query that retrieves the appropriate template based on the attributes that are passed into it. For the correct template to be selected during , you will need to add the new attribute to this expression rule so that it will be included in the query parameters.

To update the template retrieval rule:

  1. Open the AS_KYC_BL_getTemplateByCustomerAttributes expression rule.
  2. Add new fields to the query arguments and update the executeWhen condition to check the new field is not blank.
  3. If no matching template is found then the default template will be selected

EXAMPLE

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
a!localVariables(
  local!templateForCustomer: rule!AS_KYC_TMG_QE_getTemplates(
    returnType: cons!AS_CO_ENUM_QE_RETURN_TYPE_SINGLE_OBJECT,
    customerTypeCode: ri!customer.customerTypeCode,
    customerDomicile: ri!customer.domicile.countryCode,
!    industryClassificationCode: ri!customer.industryClassificationCode,
    executeWhen: and(
      rule!AS_CO_UT_isNotBlank(ri!customer.customerTypeCode),
      rule!AS_CO_UT_isNotBlank(ri!customer.domicile.countryCode),
!     rule!AS_CO_UT_isNotBlank(ri!customer.industryClassificationCode)

    ),
    isActive: true()
  ),
  a!defaultValue(
    value: local!templateForCustomer,
    default: rule!AS_KYC_TMG_QE_getTemplates(
      returnType: cons!AS_CO_ENUM_QE_RETURN_TYPE_SINGLE_OBJECT,
      isActive: true(),
      isDefault: true()
    )
  )
)

Step 6: Update the template validations

The AS_KYC_UT_isDuplicateTemplateByMappingFields expression rule validates that there are no overlapping templates and that there are no blank template attributes. This ensures that each template has a unique combination of attributes and there are no duplicates. For example, there cannot be two templates with Customer Type: Insurance, Domicile: US, and Industry Classification Type: Oil & Gas.

You will need to add the new attribute to this rule to ensure that it is included in this validation.

To update the template validations rule:

  1. Open the AS_KYC_UT_isDuplicateTemplateByMappingFields expression rule.
  2. In the or() function, add a condition to check if the new field is blank. See the example below for how to add this.
  3. Under the rule!AS_CO_UT_filterCdtByMultipleFields part of the expression, add the argument for the new attribute. See the example below for how to add this.

EXAMPLE

In the example below, we added a check to see if the industry classification code is blank then added an industry classification code to filter by template values.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
a!localVariables(
  local!templatesWithoutCurrent: rule!AS_CO_UT_rejectCdtByField(
    cdt: ri!allTemplates,
    field: "templateId",
    value: ri!selectedTemplate.templateId
  ),
  if(
    or(
      rule!AS_CO_UT_isBlank(ri!selectedTemplate.customerDomicile),
      rule!AS_CO_UT_isBlank(ri!selectedTemplate.customerTypeCode),
      rule!AS_CO_UT_isBlank(
        ri!selectedTemplate.industryClassificationCode
      )
    ),
    false,
    rule!AS_CO_UT_isNotBlank(
      rule!AS_CO_UT_filterCdtByMultipleFields(
        cdt: local!templatesWithoutCurrent,
        fields: {
          "customerDomicile",
          "customerTypeCode",
          "industryClassificationCode"
        },
        values: {
          ri!selectedTemplate.customerDomicile,
          ri!selectedTemplate.customerTypeCode,
          ri!selectedTemplate.industryClassificationCode
        }
      )
    )
  )
)

When business users set up the KYC process template, they will be required to select a value for the new attribute. Additionally, when users are creating a new KYC and they select a value for the new attribute, that value will be used to determine which KYC process template to use for the questionnaire, documents, and tasks.

Removing a selection attribute

If your organization does not want to use customer type or domicile to select the KYC process template, you can remove attributes.

Note that there is no need to remove the actual field from the CDT. Leaving an unused field on the CDT will not affect anything.

Step 1: Remove the attribute from the template properties interface

Business users select attributes when they are setting up the KYC process template. You will need to remove the attribute from this interface. Additionally, you will need to update the related interfaces that receive this information.

To remove the attribute from the template properties interface:

  1. Open the AS_KYC_TMG_CPS_manageReferenceTemplate_Attributes interface.
  2. Remove the user picker component that allows users to choose a value for the old attribute.

Step 2: Update the rule that retrieves the templates

The AS_KYC_BL_getTemplateByCustomerAttributes expression rule is a query that retrieves the appropriate template based on the attributes that are passed into it. You will need to remove the old attribute to this expression rule so that it will not be included in the query parameters.

To update the templates retrieval rule:

  1. Open the AS_KYC_BL_getTemplateByCustomerAttributes expression rule.
  2. Remove the desired argument from AS_KYC_TMG_QE_getTemplates query and executeWhen.

Step 3: Update the template validations

The AS_KYC_UT_isDuplicateTemplateByMappingFields expression rule validates that there are no overlapping templates and that there are no blank template attributes.

You will need to remove the attribute from this rule so that it is no longer included in this validation.

To update the template validations:

  1. Open the AS_KYC_UT_isDuplicateTemplateByMappingFields expression rule.
  2. In the or() function, remove the condition to check if the field you are removing is blank.
  3. Under the rule!AS_CO_UT_filterCdtByMultipleFields() part of the expression, remove the parameter for the attribute you are removing.

When users set up the KYC process template, the attribute you just removed will no longer be an option for determining template selection. Additionally, when users create a new investigation, the value you just deleted will not be used to determine which KYC process template will be used for questionnaires, documents, and tasks.

Feedback