Hi Team,

I have a Policy Number of pattern :- AB-1234567-PAD, and Product Code as last 3 
characters (PAD) of Policy number. With my code, I am now successfully 
extracting the Product Code (PAD) for given format of policy number. But, now, 
I need to check the extracted Product Code(PAD) with list of Product codes 
available. Currently, I am using STRINGLIST which has list of product codes. 
But, I don't know how to check the extracted Product Code matches with List of 
available Product codes.

Below is my code:

PACKAGE uima.ruta.example;

Document{->RETAINTYPE(SPACE)};

DECLARE Annotation ProdCode;

"(?i)\\b(?=.*\\d)[1]{0,1}[A-Z0-9]{2}[\\s |-]{0,2}[A-Z0-9]{7}[\\s 
|-]{0,2}([A-Z]{3})\\b"->1 = ProdCode;//<-Previously ProdCode was replaced with 
EntityType to get last 3 chars of given REGEX

STRINGLIST CustomSL = {"PLB","PAD"};

ProdCode{INLIST(CustomSL)->MARK(EntityType)};//<- Requesting your help here!

Ex 1:

Input : The policy number is 1A-AB12345-PAD.

Exp OP : PAD

Ex 2:

Input : The policy number is 1A-AB12345-PAN.

Exp OP : Entity should not be recognized since PAN does not exist in given 
STRINGLIST

Note:
I am a Pega developer and new to RUTA.

Please share your thoughts and kindly do the needful.

Thanks
Vamsi

Reply via email to