Thursday, June 5th, 2008

Debugging Component Interfaces from PeopleCode

Within the new PeopleTools versions PeopleSoft often uses Component Interfaces in PeopleCode to adjust data. These constructions are sometimes very hard to understand. Especially if the update of data goes wrong, the error generated from the Component Interface is tucked away in an array which can only be read when debugging the proces.

There is a very simple way to get around this.


A very simple and helpfull way to get around it all is to place the CI error messages on the screen during processing. To establish this, you need to find the procedure that writes the component interface errors to the error array.

In PeopleTools 8.48 this procedure can be found in FUNCLIB_CI.CI_EXCEPTIONS FieldFormula and is called ciCreateExceptionEntry

.

Now all you have to do is add a messagebox that puts the error on the screen:

Function ciCreateExceptionEntry(&inExceptionArray As array of Record, &inMessageSetNbr, &inMessageNbr, &par1, &par2, &par3, &par4);

&Session = %Session;
&PSMessages = &Session.PSMessages;

/* track all entries in PSMessages in the ExceptionArray */
&ExceptionCount = &PSMessages.Count;
If &ExceptionCount > 0 Then
For &i = 1 To &ExceptionCount
&ExceptionRec = CreateRecord(Record.CI_EXCEPTIONS);
&MsgSetNbr = &PSMessages.Item(&i).MessageSetNumber;
&MsgNbr = &PSMessages.Item(&i).MessageNumber;
&ExceptionRec.MESSAGE_SET_NBR.Value = &MsgSetNbr;
&ExceptionRec.MESSAGE_NBR.Value = &MsgNbr;
&ExceptionRec.MESSAGE_TEXT.Value = &PSMessages.Item(&i).Text;
&ExceptionRec.MESSAGE_TEXT_WRK.Value = &PSMessages.Item(&i).Text;
&ExceptionRec.DESCRLONG.Value = &PSMessages.Item(&i).ExplainText;
If All(&MsgSetNbr, &MsgNbr) Then
&ExceptionRec.MSG_SEVERITY.Value = ciGetSeverity(&MsgSetNbr, &MsgNbr);
End-If;
/* Frank Kortekaas (Logica) – Show CI Error On Screen – Start */
MessageBox(0, “”, 0, 0, “Msg: ” | &ExceptionRec.MESSAGE_TEXT.Value);
/* Frank Kortekaas (Logica) – Show CI Error On Screen – End */
&inExceptionArray.Push(&ExceptionRec);
End-For;

&PSMessages.DeleteAll();
End-If;

(…)

Now when a CI is called and an error occurs you will get a messagebox on the screen indicating the error:

CIerrir

This will make your CI debugging life a lot easiers!

 Viewed 18878 times by 4062 visitors


Category: Technical
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses (last comment shown first)

January 7, 2009
Frank Kortekaas
avatar

Hi Chad,

can you provide me with some more information on how you’re trying to do this? Which CI do you use (and on which component), is this a vanilla PeopleSoft CI and how do you calll it?

Regards,
Frank

[Reply to this comment]


December 18, 2008
Chad Foley
avatar

Frank, I’ve added your line of code here but I’m still not getting any message boxes during ci processing errors. I’m on Tools 8.49.11 and PeopleSoft 9.0. Any ideas?

Thanks,

Chad

[Reply to this comment]