Component interface failure due to incorrect data

1.8k views Asked by At

I have created a PeopleTools Application Engine program to insert/update employee National ID data in the PS_PERS_NID table. I am using a PeopleTools File Layout definition to insert data into a staging table and then using an Application Engine Do Select to read data from a stating table and load through a PeopleTools Component Interface (CI) definition via PeopleCode. When the data is clean it works fine. I have written a query in the exception peoplecode to update the data in the staging table with processing status and Error message.

When I tested it with an invalid SSN, it returns message Error changing value, and causes the application engine to fail. I have all peoplecode in a try-catch block that gets created by default.

Can someone please provide sample logic code through I can capture error message in staging record without abending the process.

3

There are 3 answers

2
Based On

In the Application Engine Definition, does your Step have the 'On Error' option set to 'Abort'?

Set it to 'Ignore' or 'Suppress' and handle the error in peoplecode.

Check the 'Setting up properties' section in the Application Engine PeopleBooks for more info on these options.

0
angel On

I adopted this method to resolve this situation:

  1. Create new fields to capture the error text in the staging record.

  2. Before calling the Component interface code, check if the provided SSN value is valid or not. I used the delivered function check_nid. If the value does not fulfil the criteria, mark the row as an "Error" row and capture the error text in the staging field.

  3. Ignore the "Error" row.

0
ZeusT On

The problem here is that your session is in an errored state and it is trying to continue processing. You need to clean up your session messages before continuing. When you create the CI, make sure you set interactive to false, else you have to check for messages every time you set a value. Then after your 'save' call, check for messages, report them, and clear them.