Previous Topic: Configuration: Quick Setup

Next Topic: Other Customizations

Custom Metric Definition

Of all the possible customizations, the one most commonly needed one is defining the review metrics. These define how events are sampled in order to be placed onto review queues. The only case when this step is not needed is if the required metric queues all events that triggered policy for all reviewers; this is the default metric. Customizing the metric definition is described below using a fictitious example.

An organization has two types of users and groups in the system called 'Advisors' and 'Managers'. The group hierarchy is defined with all Advisors coming in the 'ADV' group (or its subgroups) and all Managers in the 'MGR' group (or its subgroups).

Queuing for the ADV group works as follows:

Queuing for the "MGR" group works as follows:

Logically, we can define these metrics as follows:

Group

Metric Category

Metric Value

Metric Type

Metric Target

Data Target

Data Grouping

ADV

0

5

0

P

P

-

ADV

1

10

1

-

A

-

ADV

2

50

1

-

-

-

MGR

0

2

0

P

P

 

To implement these metrics, the following steps are required using an appropriate SQL interface such as SQL*Plus or TOAD:

  1. Determine the internal GroupIDM and GroupID values for the group. This is done in SQL with the following:

    SELECT GROUPIDM,GROUPID FROM WGNGROUP WHERE GROUPNAME='ADV'

  2. The stored procedure WGN_RQ_METRIC_INSERT_1 (SQL Server) or WGN_RQ.METRIC_INSERT_1 (Oracle) inserts the metric values into the table Wgn3ReviewMetrics (see step 4). Assuming that the group ADV has values 1 and 104 for GroupIDM and GroupID respectively, then the necessary parameters supplied to the procedure would be:
    1,104,0,5,0,'P','P' 
    1,104,1,10,1,null,'A'
    1,104,2,50,1,null,null
    

    Where the ordered parameters to the procedure are:

    GroupIDM,

    GroupID,

    Category (0,1,2,3),

    Value,

    ValueType (0=percentage, 1=absolute),

    MetricTarget ('A'=All,'P'=Prime,'X'=Excluded),

    DataTarget ('A'=All,'P'=Prime,'X'=Excluded),

    DataGrouping(0 or Null=no grouping, 1=grouping, defaults to NULL if not specified),

    Process (defaults to 1 if not specified)

    While there is nothing to prevent this customization issuing SQL Insert statements directly against this table, it is strongly recommended that this stored procedure is used to guard against future schema changes causing customizations to fail.

  3. Repeat for MGR group, assuming the MGR group has 1 and 105 for GroupIDM and GroupID respectively, then the necessary parameters would be:
    1,105,0,2,0,'P','P'
    
  4. Write a custom stored procedure as follows that implements these metrics and deploys them in the database. The full text of the stored procedure will look like this:

    Edit the CA-supplied customizable package body WGN_RQ_CUST (the physical source file is WGN_RQ_CUST_BODY.sql located in the Support\CustomSQLTemplates' directory on the installation image) as follows:

    Oracle

    PROCEDURE Set_Metrics
    IS
    BEGIN
    
      -- Default is to insert metric parameters for top-level group only.
      -- All other sub-groups inherit this.
    
      -- Wgn_RQ.Set_Metrics_Def_1;
    
      -- To use custom code the default call above must be commented out.
      -- Provide custom code as follows by always using the specific
      -- procedure/function calls where stated:
    
      -- purge existing metrics
      -- <<MANDATORY>>
      WGN_RQ_EXEC_DDL.Truncate_Table('Wgn3ReviewMetrics');
    
      -- insert new metrics
      -- <<OPTIONAL>>
      -- WGN_RQ.METRIC_INSERT_1(1,100,0,5,0,'P','P',
      -- <<p_DGrouping>>,<<p_Process>>);
      -- WGN_RQ.METRIC_INSERT_1(1,100,1,10,1,null,'A');
      -- WGN_RQ.METRIC_INSERT_1(1,100,2,50,1,null,null);
      -- WGN_RQ.METRIC_INSERT_1(1,101,0,2,0,'P','P');
      -- WGN_RQ.METRIC_INSERT_1(1,123,0,50,0,'P','P',1,1);
      -- WGN_RQ.METRIC_INSERT_1(1,103,0,75,0,'P','P',
      -- p_DGrouping=>1,p_Process=>1);
      -- WGN_RQ.METRIC_INSERT_1(1,118,3,75,0,'P','P');
      -- ...
      -- ... where <<p_DGrouping>> defaults to null
      -- ...   and <<p_Process>> defaults to 1 if omitted
    
      WGN_RQ.METRIC_INSERT_1(1,104,0,5,0,'P','P'); 
      WGN_RQ.METRIC_INSERT_1(1,104,1,10,1,null,'A');
      WGN_RQ.METRIC_INSERT_1(1,104,2,50,1,null,null);
      WGN_RQ.METRIC_INSERT_1(1,105,0,2,0,'P','P');
    END Set_Metrics;
    

    SQL Server

    CREATE PROC WGN_RQ_SET_METRICS_CUSTOM_1
    AS
    BEGIN
          truncate table wgn3reviewmetrics
    
          EXEC WGN_RQ_METRIC_INSERT_1 1,104,0,5,0,'P','P' 
          EXEC WGN_RQ_METRIC_INSERT_1 1,104,1,10,1,null,'A'
          EXEC WGN_RQ_METRIC_INSERT_1 1,104,2,50,1,null,null
          EXEC WGN_RQ_METRIC_INSERT_1 1,105,0,2,0,'P','P'
    END
    

More information:

Metric Definitions