Identifying Applicant Type

Location: mosip-config repository

Applicant-type MVEL script usages in MOSIP modules :

Module Name

Before LTS





Registration Client



This MVEL script is used to determine the type of applicant based on the captured demographic data during the registration process.

β†’ Set of rules to determine the type of applicant is written as an MVEL script.

β†’ Applicant Data required for the evaluation passed as β€œidentity” map to the MVEL context.

β†’ def getApplicantType() method MUST be defined in the script. The string returned from this method should be a valid applicant type code or error code (KER-MSD-151, KER-MSD-147)

applicant_type_code - Must be one of the values in the apptyp_code column in β€œmaster.applicant_valid_document" table.

INVALID_QUERY_EXCEPTION("KER-MSD-147", "Invalid query passed for applicant type"),	INVALID_DATE_DOB_EXCEED_EXCEPTION("KER-MSD-151", "DOB cannot exceed current date");

"KER-MSD-147" - returned when any of the demographics that are required for the script to return a code are empty (As per default script, it throws this exception if gender or residenceStatus or age is not filled / empty).

"KER-MSD-151" - returned when the DOB exceeds the current date.

β†’ Data in the β€œidentity” map are key-value pairs. The Key is the field id in the id-schema.

β†’ For the fields which are based on dynamic field values. For Ex: gender

β€œidentity” map will have 2 mappings, genderCode, and gender. where the

identity.genderCode = β€œFLE”

identity.gender = β€œFemale”

β†’ Age group configuration is also passed in the MVEL context as below

{ β€œageGroups” : {'INFANT':'0-5','MINOR':'6-17','ADULT':'18-200'} } and will be accessible as below in the script.

ageGroups.INFANT = β€œ0-5”

ageGroups.MINOR = β€œ6-17”

ageGroups.ADULT = β€œ18-200”

Sample MVEL script is defined here

Note: In Pre-registration and Registration-Client, applicant-type code is used to control the list of documents to be collected during the registration process.

The applicant_type_code returned from this mvel script will be then used to fetch the required documents from master.applicant_valid_document table.

For example, if the script returns applicant_type_code as β€œ001”, all those entries in the applicant_valid_document table with app_typ_code as β€œ001” will be picked and shown in the respective document dropdowns.

Attaching the sample csv file below which lists down the required entries for master.applicant_valid_document table.

We can upload this default data from Admin Portal through Bulk Upload feature.

The steps to be followed are mentioned below:

  1. Login to Admin Portal.

  2. Navigate to Bulk Upload β†’ Master Data.

  3. Select the Insert operation, select the table name (ApplicantValidDocument) from the dropdown and upload the csv file.

  4. Click on Upload, which saves the uploaded data to the server DB.

Attaching screenshot for reference:

Last updated

Copyright Β© 2021 MOSIP. This work is licensed under a Creative Commons Attribution (CC-BY-4.0) International License unless otherwise noted.