Migrating from TOM Event System to TOM.NET Event System
Migrate from your Event System to .NET by mapping TOM-based event triggers to a Subject, Type and Phase in the new TOM.NET-based Event System. You also need to rewrite your original event handler code in .NET.
Procedure
- Determine the item type that triggers your event. For example, if your event trigger is called
OnKeywordLocalizePost, the item type is Keyword. In your new event code, set your Event Subject to this value. - Determine the operation that triggers your event. For example, if your event trigger is called
OnComponentTemplateUndoCheckOutPre, the operation is Undo Check Out. In your new event code, set your Event Type to this value followed byEventArgs, for example,SaveEventArgs. However, note the following exceptions:- If the old operation is one of the following:
Assign,Restart,StartorSuspend, add the stringActivity. For example, if the original event trigger is calledOnActivityInstanceStartPost, set the Event Type toStartActivityEventArgs. - If the old operation is
Finish, check the item type. If the item type isActivityInstance, set the Event Type toFinishActivityEventArgs; if it isProcessInstance, set it toFinishProcessEventArgs. - If the old operation is
SetPublishedTo, set the Event Type toSetPublishStatusEventArgs. - If the old operation is
PasteItem, set the Event Type toMoveEventArgsorCopyEventArgs.
- If the old operation is one of the following:
- Determine the phase in which your event code is to be triggered, either Post or Pre. If your event trigger named ends in
Pre, set the Event Phase toInitiated, and if it ends inPost, set the Event Phase toProcessed.Using these steps, you would translate an event trigger ending in
SavePostinto an Event TypeSaveEventsArgsand an Event PhaseProcessed. But depending on your wishes, in some circumstances you may want to set the type toCheckInEventArgsand the phase toTransactionCommitted. Refer to the documentation about Event Handlers to find out if this combination is more appropriate for your situation.The following TOM-based Event Triggers do not have a TOM.NET equivalent:
OnSchemaGetInstanceDataPost-
This event trigger does not exist. You can approximate it by the combination of the Subject
Component, the TypeSaveEventArgsand the PhaseInitiated. -
Any event trigger with a
ResolveorRenderoperation - There are no event triggers for resolve or render operations. You can implement custom resolving and/or rendering behavior by implementing a custom Resolver and/or Renderer.
- Rewrite your original event handler code in .NET.