cancel
Showing results for 
Search instead for 
Did you mean: 

Check the Data length for the fields in the mapping

Former Member
0 Kudos

Hi,

I need to check for the data length of the below fields in mapping. And if any of the field lengh does not match with the given length then I discard the data and trigger a mail

X1_LENGTH = 9

EMail_LENGTH = 100

PrjDesc_LENGTH = 50

Regards,

Varun

Accepted Solutions (0)

Answers (4)

Answers (4)

varun_k
Contributor
0 Kudos

I had created a UDF to check the Length of the fields

int fieldlen = Integer.parseInt(fieldlength);

if ( field.length() > fieldlen )

varun_k
Contributor
0 Kudos

Hi,

Can anyone please provide a UDF to Check the Length of the particular field. For eg: for field ABC the max length should be 10. otherwise discard

Regards,

Varun

Former Member
0 Kudos

Hi Varun,

For checking the length and discarding the field, you may dont need a UDF. You can do with graphical mapping also like if --> field length --> greater than consatnt --> then do something --> else ignore.

I hope you already seen the advice of michal.

Regards,

---Satish

MichalKrawczyk
Active Contributor
0 Kudos

hi,

don't check it in a mapping - check it in an adapter module (or enhanced receiver determination)

and then you can easily route it to a mail receiver if not ok

if you do it in a mapping you cannot change the receiver without a BPM

Regards,

Michal Krawczyk

Former Member
0 Kudos

HI,

Use of Extended Receiver Determination based on the validation field could be easy option...where you need to opt the Business system for mail or for processing the data further.

Thanks

Swarup

Former Member
0 Kudos

Hi,

You can use following approach:

- Create UDF for length analysis and raise exception if length is not accurate Use lenght() method of string.

CheckLength(Field, Length)

{

If Field.lenght() >= Length then raise mapping exception

}

Use Alert to capture this and send mail.

- Use Enum while defining datatype to reject data at source (in adapter engine). Again use Alerts to send mail.

Regards,

Gourav

varun_k
Contributor
0 Kudos

Hi Gaurav,

Thanks for your reply. If I am rasing exception and triggering alerts from the UDF at Mapping level. I am getting Multiple Alerts as Mails. I need only 1 alert per message if its failing instead of multiple alerts

Regards,

Varun

Former Member
0 Kudos

Hi Varun!

In RWB Alert Configuration you can check the box "suppress multiple alerts for this rule" for your rule. This should stop "mail bombing" if all the mails are within the same alert rule..

Regards,

Volker