Previous Next JavaScript must be enabled to correctly display this content

## 1 Auto Categorization Of Spend Transactions

Scenario:

If a Spend transaction description contains keyword "Big Bazaar" then that transaction should get auto-categorized as follows:

Category → Shopping

Subcategory → Groceries

Maintenance steps:

1. Create a Category and a Subcategory as required after login as an Admin user.
2. Note the `CATEGORY_ID` column value of the newly created Category & Subcategory from the table `DIGX_SP_SPEND_CATEGORY` (Eg: 10 and 101 respectively).
3. Insert a row in table `DIGX_RL_SPEND` as below (Note the ID column value which is '10001' in this example).

   Sample script:

       insert into DIGX_RL_SPEND
               (ID, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATED_DATE,
               OBJECT_STATUS,   OBJECT_VERSION_NUMBER, NAME, DESCRIPTION, DETERMINANT_VALUE)
               values ('10001', '', sysdate , '', sysdate , '', 1,'SpendRule', 'SpendDTODesc', 'OBDX_BU');

4. Insert a row in table `DIGX_RL_CONDITION` as below:
   1. ID as any unique value
   2. RULE_ID as provided in the `DIGX_RL_SPEND` table above
   3. EXPRESSION_OBJECT value should contain the keyword as follows:

          utl_raw.cast_to_raw('{ "@class" : "
                  com.ofss.digx.app.spendanalysis.dto.rule.SpendCategorizationExpressionFactValueDTO",
                  "keyword" : "Big Bazaar" }')

   4. `OUTCOME_OBJECT` value should contain the corresponding Category & Subcategory ID as follows (Subcategory is NOT mandatory):

          utl_raw.cast_to_raw('{ "@class" : "
                com.ofss.digx.app.spendanalysis.dto.rule.SpendCategorizationOutcomeFactValueDTO",
                "category" : "10", "subCategory" : "101" }')

   5. OPERATOR value should be 'CONTAINS' (No other operators are supported out of the box

      Sample script:

          insert into
                  DIGX_RL_CONDITION (ID, RULE_ID, OPERATOR, OUTCOME_OBJECT, EXPRESSION_OBJECT, CREATED_BY,
                  CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATED_DATE, OBJECT_STATUS, OBJECT_VERSION_NUMBER,
                  DETERMINANT_VALUE)values ('103', '10001',
                  'CONTAINS', utl_raw.cast_to_raw('{"@class" :
                  "com.ofss.digx.app.spendanalysis.dto.rule.SpendCategorizationOutcomeFactValueDTO","category" :
                  "10","subCategory" :
                  "101"}'),
                  utl_raw.cast_to_raw('{"@class" :
                  "com.ofss.digx.app.spendanalysis.dto.rule.SpendCategorizationExpressionFactValueDTO","keyword" : "Big
                  Bazaar"}'), '', null, '',
                  null, '', 1, 'OBDX_BU');

5. Insert such rows in table `DIGX_RL_CONDITION` for each keyword & Category-Subcategory combination as required by the Bank.
6. Verify the following properties (select * from `DIGX_FW_CONFIG_ALL_B` where category_id = 'ruleconfig';):
   1. `IS_RULE_EVALUATION_REQUIRED` → Y
   2. `SPEND_EVALUATOR` → com.ofss.digx.app.spendanalysis.ruleengine.evaluator.SpendRuleEvaluator (out of the box Spend rule evaluator)
   3. `SPEND_RULE_NAME` → SpendRule (As per the value of NAME column in DIGX_RL_SPEND table)
   4. SPEND_DEFAULT_CATEGORY_ID → This property is used for maintaining default category, if no keyword is match from all maintained rules.

Below attached screenshot entry is required for setting default category. We need to update the entry from day one configuration screen. We have to maintain the Category ID in this configuration value.

Note:

If below entry is not maintain and no rule is matched, then no category is set against the spend transaction.

Figure 1-1 “System configuration” screen with required entry for setting default category

Description of "Figure 1-1 “System configuration” screen with required entry for setting default category"