Saturday, October 8, 2016

Event Mapping Framework - Hello World and Quirks

Ever since PeopleTools 8.55 was released last year, I have heard fantastic things about the new Event Mapping Framework. I also saw great demos while attending various sessions at Oracle OpenWorld 2016. Although, I know the concept of Event Mapping Framework in theory, I never got a chance to use this functionality. So, I decided to create a simple 'Hello World' example to understand the mechanics.

Step 1: Create a custom App Package

This is the event that we will be mapping to a Component PeopleCode. There is nothing fancy in the event, just a basic 'Hello World' message using MessageBox function.


Step 2: Create a Related Content Service

Navigator > PeopleTools > Portal > Related Content Service > Define Related Content Service


Step 3: Map Related Content Service to Component Event

Navigator > PeopleTools > Portal > Related Content Service > Manage Related Content Service > Event Mapping (Tab) > 'Map the event of the Application pages' hyperlink

Let us add this event to the USERMAINT - 'User Profiles' Component. For this example, let us map our related content service as the 'Post Process' event on the Component PostBuild PeopleCode. This is the same example component which Jim Marion used during his Tips and Techniques session at Oracle OpenWorld this year. I doubt the link will work for long, so grab Jim's slide deck as soon as you can!



Results:

Here we can see that our custom event gets executed as per the Event Mapping Framework configuration. Great!


Quirk:

Now, if we use our custom event and try to execute it as part of another component, say URL_TABLE (PeopleTools > Utilities > Administration > URLs), we will find that it will not get executed. Isn't it a little baffling? Because, even if we perform exactly the same steps as described above, somehow it would appear that something is missing!


After some trial and error, I figured that any custom events mapped to a Component (or Component Record) PeopleCode event via 'Event Mapping Framework' will get executed only if there is some code already associated with the actual Component (or Component Record) PeopleCode.

E.g.: URL_TABLE.GBL.PostBuild (Component PeopleCode) does not contain any code. So, any events mapped to this PeopleCode will not be executed.


Is this working as designed? I really hope not! I hope that it is a bug (or unintended feature) that will be fixed/enhanced in the future releases. Otherwise, it may not be as easy to use the Event Mapping Framework as we expect it to be. Particularly, if we are looking at this framework as an option to reduce customizations.

Updated on December 19th, 2016:
This quirk is no longer a problem as of PeopleTools 8.55.11 release.

Demo of the quirk:


Other resources on Event Mapping Framework:
Chris Malek's Blog
psadmin.io Blog
Jim Marion - Tips and Techniques - OOW16 (may only be available for a limited time)
PeopleSoft Mods by Colton Fisher
PeopleBooks - Mapping Application Class PeopleCode to Component Events