Event Mapping is a useful feature that was introduced in PeopleTools 8.55, and we've been enhancing it ever since.
The basic concept is straightforward: Event Mapping enables you to inject custom code before or after delivered event code. There are some key benefits of Event Mapping:
·
Your Custom PeopleCode
is kept separate from delivered code
·
You have Complete access
to component buffer
A developer writes their Application Class custom code in App Designer. Note that as of 8.57, the PeopleCode Editor provides an Event Mapping button in the Application Designer toolbar as a visual indicator of custom PeopleCode programs mapped to events of a component, component page, component record, or component record field. The indicator is enabled when the PeopleCode is being viewed for one of these events. In addition, the Find Definition References tab on the output window lists the events that are mapped to custom PeopleCode programs, along with the application class. The Find Definition References tab lists references to other components where the custom PeopleCode programs of the selected application class are used.
Event Mapping configuration requires the following steps:
- Create an Application Class with mapped business logic,
- Define a Related Content Service Definition, and
- Map a component event to a Related Content Service Definition.
Mapping your custom
code is done through the Related Content Framework, which enables us to keep your code separate
from the delivered logic.
Events Support Event Mapping:-
The list has been growing ever since Event
Mapping was introduced.
Component Level
events:
·
PostBuild
·
PreBuild
·
SavePreChange
·
SavePostChange
·
WorkFlow
Component Record level
events:
·
RowDelete
·
RowInit
·
RowInsert
·
RowSelect
·
SaveEdit
·
SavePreChange
·
SavePostChange
Page level events:
·
PageActivate
Field level events:
·
FieldChange
Event mapping now also supports records
and record fields on subpages and secondary pages at any level of nesting, not
just for primary pages explicitly defined in the component. This enhancement
extends support to the page Activate event for secondary pages and to derived
work records.
Developers can use a single application class service ID for multiple configurations. This
enhancement simplifies PeopleCode development because multiple blocks of code
can be delivered in a single application class. Then, during configuration, you
can use a new event mapping parameter to selectively invoke the specific block
of code that pertains to a specific event.
Time
to Use Event Mapping
Customers that
have heavily customized their PeopleSoft applications should look seriously at
Event Mapping to isolate those customizations to provide a better PeopleSoft
life cycle. Event Mapping can even be used in concert with other
configuration features to dramatically reduce the impact of customizations.
Use the Event Mapping page to manage which content references have associated PeopleCode application package programs.
Navigation
.
Select the Event Mapping page tab.
Event Mapping References page
This example illustrates the fields and controls on the Event Mapping References page. You can find definitions for the fields and controls later on this page.
Select a Content Reference page
This example illustrates the fields and controls on the Select a Content Reference page. You can find definitions for the fields and controls later on this page.
Assigning Application Class PeopleCode to Component Events
Use the Configure Event Mapping page to map application class PeopleCode to component level, page level, and component record level events.
PeopleCode Example for Multiple Events in a Single Application Class
The following application class presents an example of how eve_execute could be implemented:
import PT_RCF:ServiceInterface;
class App_Class1 implements PT_RCF:ServiceInterface
method execute();
method eve_execute(&str As string);
end-class;
method execute
/+ Extends/implements PT_RCF:ServiceInterface.execute +/
end-method;
method eve_execute
/+ &str as String +/
/+ Extends/implements PT_RCF:ServiceInterface.eve_execute +/
/* &str variable will have the Event Map Parameter that was */
/* set in the configuration page for that particular event */
/* that is being triggered. */
Evaluate &str
When = "1"
/* Code block for PreBuild event */
When = "2"
/* Code block for PostBuild event */
When-Other
/* Code block to handle an invalid event map parameter */
End-Evaluate;
end-method;
No comments:
Post a Comment