Documentation Center

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

  1. 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.
  2. 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 by EventArgs, for example, SaveEventArgs. However, note the following exceptions:
    • If the old operation is one of the following: Assign, Restart, Start or Suspend, add the string Activity. For example, if the original event trigger is called OnActivityInstanceStartPost, set the Event Type to StartActivityEventArgs.
    • If the old operation is Finish, check the item type. If the item type is ActivityInstance, set the Event Type to FinishActivityEventArgs; if it is ProcessInstance, set it to FinishProcessEventArgs.
    • If the old operation is SetPublishedTo, set the Event Type to SetPublishStatusEventArgs.
    • If the old operation is PasteItem, set the Event Type to MoveEventArgs or CopyEventArgs.
  3. 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 to Initiated, and if it ends in Post, set the Event Phase to Processed.

    Using these steps, you would translate an event trigger ending in SavePost into an Event Type SaveEventsArgs and an Event Phase Processed. But depending on your wishes, in some circumstances you may want to set the type to CheckInEventArgs and the phase to TransactionCommitted. 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 Type SaveEventArgs and the Phase Initiated.
    Any event trigger with a Resolve or Render operation
    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.
  4. Rewrite your original event handler code in .NET.