16.2 Action Validation Framework
The action validator framework allows you to perform the validation based on the configuration made in the KDD_ACTION_VLDTN table.
The action validator framework allows you to perform the validation based on the configuration made in the KDD_ACTION_VLDTN table.
- If you want to set a validation rule where you want to exclude
the comments action (CA8) when Send Email Action is taken ,
then for “Send Email Action”(CA921), set the below
configuration entries in the KDD_ACTION_VLDTN table:
Table 16-1 KDD_ACTION_VLDTN table
ACTION_CD VLDTN_TYPE VLDTN_CONFIG_DATA VLDTN_FLD_MSG VLDTN_ORDER ACTV_FL CA921 EXCLUDE CA8 (null) (null) Y When this validation rule is executed, an error message will display.
- If you want to a set a validation rule where Case Owner and Case
Assignee values should not be the same, then for “Set Case
Owner” (CA938) and “Set Case Assignee” (CA939), set below
JAVASCRIPT validator in KDD_ACTION_VLDTN table:
Table 16-2 KDD_ACTION_VLDTN table
ACTION_CD VLDTN_TYPE VLDTN_CONFIG_DATA VLDTN_FLD_MSG VLDTN_ORDER ACTV_FL CA938 JAVASCRIPT validateOwnerAssignee RENDERE.CM_TA_OWNRASSGN_NTSM 1 (null) CA939 JAVASCRIPT validateOwnerAssignee RENDERE.CM_TA_OWNRASSGN_NTSM 1 (null) When this validation rule is executed, an error message will be displayed.
KDD_ACTION_VLDTN Table
Table 16-3 KDD_ACTION_VLDTN table
Column Name | Primary Key | Column Type | Nullable |
---|---|---|---|
ACTION_CD | Y | VARCHAR2 (20 CHAR) | No |
VLDTN_TYPE | Y | VARCHAR2 (50 CHAR) | No |
VLDTN_CONFIG_DATA | Y | VARCHAR2 (4000 CHAR) | No |
VLDTN_FLD_MSG | VARCHAR2 (1000 CHAR) | Yes | |
VLDTN_ORDER | NUMBER(10) | Yes | |
ACTV_FL | VARCHAR2 (1 CHAR) | Yes |
- ACTION_CD: This is the Action code for which validation will be performed.
- VLDTN_TYPE: Indicates the Validation Type. Below are the possible
values
- EXCLUDE: Exclude Action validator
- INCLUDE: Include Mandatory Action validator
- QUERY: Query-based validator
- JAVASCRIPT: JavaScript-based client-side validator
- VLDTN_CONFIG_DATA: Indicates the configuration for
thevalidator.
- For ExcludeType:
Action codes which are mutually exclusive for this action must be provided. Multiple action codes need to be provided in separate rows with type as EXCLUDE.
- For IncludeType:
Action codes which are mandatorily inclusive for this action must be provided. Multiple action codes need to be provided in separate rows with type as INCLUDE.
- For QueryType:
Query needs to be provided in the VLDTN_CONFIG_DATA column. The query should be such that in case of failure should return false and in case of success should return true. Both request and session attributes are supported. You can specify them using the below notation:
Request Attributes: @@AttributeName@@ Session Attributes: ##AttributeName##
Below is list of seeded parameters to Query Validator:
- actionCode (Action Code for which the validation is been performed)
- ReviewId (Case ID on which the action is performed)
- setDDActnVal (Set Due DateValue)
- clearDDActnVal (Clear Due DateValue)
- setCAActnVal (Case AssigneeValue)
- setCOActnVal (Case OwnerValue)
- autoAssgnActnVal (Auto Assignmentvalue)
- emailFromIdActnVal (Email FromValue)
- emailSubjTextActnVal (Email SubjectValue)
- emailToIdActnVal (Email To Value)
- emailBodyTextActnVal (Email BodyValue)
- commentsStdActnVal (Standard Comments value under CommentsAction)
- addlnCommentsActnVal (Textual Comments value under Comments Action)
- attachCommentsStdActnVal (Standard Comments value under AttachmentAction)
- attachAddlnCommentsActnVal (Textual Comments value under Attachment Action)
- attachFileNameActnVal (File Name under AttachmentAction)
- closedCasesAvail (Indicates if any of the selected cases are in a closed status)
- pmfActionsAvail (Indicates if any PMF action is selected or not)
- For JAVASCRIPT Type:
JavaScript method name should be provided in VLDTN_CONFIG_DATA column. The method can be defined in any custom JS file. Follow the steps mentioned in Adding a custom JS file in ECM.
This method should have two inputs one is the actionCode for which this validator is defined and another input is the userEnteredValueMap which contains below attributes that holds user entered values on the Take Action page:
- setDDActnVal (Set Due DateValue)
- clearDDActnVal (Clear Due Date)
- setCAActnVal (Case AssigneeValue)
- setCOActnVal (Case OwnerValue)
- autoAssgnActnVal (Auto AssignmentValue)
- emailFromIdActnVal (Email FromValue)
- emailSubjTextActnVal (Email SubjectValue)
- emailToIdActnVal (Email To Value)
- emailBodyTextActnVal (Email BodyValue)
- commentsStdActnVal (Standard Comments value under CommentsAction)
- addlnCommentsActnVal (Textual Comments value under Comments Action)
- attachCommentsStdActnVal (Standard Comments value under AttachmentAction)
- attachAddlnCommentsActnVal (Textual Comments value under Attachment Action)
- attachFileNameActnVal (File Name under AttachmentAction)
The method should return true if the validation is successful or false if the validation fails.
- Copy the custom JS file to<<deployedarea>>/ojff/js/appCommon
- Go to <<deployedarea>>/ojff/js/appCommon/viewModels/aai-ecm.js. In aai-ecm.js add entry foryour js file in the define block. For example, if your custom JS file name is customValidator.js, then add as shown below.
- VLDTN_FLD_MSG: This is used to specify a particular message constant to be shown in case of validation failure. If no message is configured default message will be shown. Default Messages are as below:
<ACTION NAME1> is not permitted along with <ACTION_NAME2>
Include Validator:
<ACTION NAME1> must be mandatorily taken along with <ACTION_NAME2> Query Validator:Query validation failed for <ACTION NAME1> JavaScript Validator:
Validation failed for <METHOD_NAME>
- VLDTN_ORDER: Numeric Sequence indicating the order of the validator within aparticular action code.
- ACTV_FL: Flag to identify whether the mentioned action validator
is active or not.
Note:
After making the changes in the table, restart the server.