The REN Server – an Overview and a Neat Trick – Part 2 of 2 February 13, 2008Posted by Duncan in PeopleTools.
This is part 2 of 2. See the companion post here.
The neatest trick I’ve heard relating to the REN Server came from Chris Heller and Larry Grey who were over for the UKOUG last year. They drew my attention to the ‘NotifyToWindow’ method of the PrcsApi class. It’s one of those little gems that’s tucked away in PeopleBooks that I’d never noticed before.
It’s a method that lets you inject HTML into the REN Server window and it sounded like an ideal method of giving users feedback on the progress of their process/report. To give it a quick try I added some code to the PORTAL_CSS App Engine (in a play environment obviously, not anywhere important) and gave it a whirl.
The code I added all went into PORTAL_CSS.CREFPERM.Step1 and was as follows:
At the top:
After the functions (about half way down):
Local PT_PRCS:API:PrcsApi &api = create PT_PRCS:API:PrcsApi();
Then, wherever I wanted to update the user of the status, I added the following:
&strl_WindowMsg = &strl_WindowMsg | "<br />Step 1/5: Portal Security Sync starting. (" | DateTimeToLocalizedString(%Datetime, "HH:mm:ss") | ")";
&nret = &api.notifyToWindow(AEPORTALCSS_AET.PROCESS_INSTANCE, &strl_WindowMsg);
I placed my messages at reasonable points in the process and ran it. The resulting REN Window looked as follows:
I’ve only output static text to the window, but there are further possibilities. Chris mentioned that in the past he has inserted the last few lines of the log file. I’d be interested to hear from anyone with good ideas on how to use this.