Hello
I am writing an AE with file file layout to load new position information into position data. When I run the AE through app designer it runs successfully displaying the errors in a log and ends normally. When I run it online the AE program it stops at the first error. How do I capture the errror from the component interface and continue processing the entire file layout definition. The error message is invalid value. It is a required field. Error saving component interface (91,37)
Application engine program ended normally. I realize the value is not a valid value but how do you keep the process running to capture all the error without it stopping on every error?

Views: 215

Reply to This

Replies to This Discussion

Open a file and write the error on this file. Delivered Appengines have a lot of error handling codes.When you try to save the component interfaces define error handler functions.Below is the psuedo code.

 

If Not &oDeptCf.Save() Then;
errorHandler();
throw CreateException(0, 0, "Save failed");
End-If;

Function errorHandler()
Local ApiObject &oPSMessageCollection, &oPSMessage;
Local number &i;
Local string &sErrMsgSetNum, &sErrMsgNum, &sErrMsgText, &sErrType;

&oPSMessageCollection = &oSession.PSMessages;
For &i = 1 To &oPSMessageCollection.Count
&oPSMessage = &oPSMessageCollection.Item(&i);
&sErrMsgSetNum = &oPSMessage.MessageSetNumber;
&sErrMsgNum = &oPSMessage.MessageNumber;
&sErrMsgText = &oPSMessage.Text;
&fileLog.WriteLine(&sErrType | " (" | &sErrMsgSetNum | "," | &sErrMsgNum | ") - " | &sErrMsgText);
End-For;
rem ***** Delete the Messages from the collection *****;
&oPSMessageCollection.DeleteAll();
End-Function;

 

Please contact us at g_konar@rediffmail.com or 91-9741420569 for online training

I have not found a way to do this gracefully in any CI. Invalid values cause it to fail so what I do is this for a particularly problematic field: find the table or view that field is validating against on the record and inside a condition populate it only if it passes a SQLExec validation using the value first.

For example:

SQLEXEC("SELECT 'X' FROM PS_the_validation_view WHERE the_field =:1, &the_field_value, &EXISTS);

If &EXISTS='X' then

&oPosition_Data.my_field=&the_field_value;

else

MessageBox(0, "", 0, 0, "ERROR: The Position " |&oCiPositionData.POSITION_NBR|" has an invalid value of: " |&the_field_value | " for the field the_field.");

end-if;

I wish Oracle would make a simpler way to handle an invalid value without it stopping all processing.

RSS

© 2012   Created by PSoftPros.

Badges  |  Report an Issue  |  Terms of Service