Advanced Customization > Business Logic Customization > Windchill Workgroup Manager Customization > Pre Operation Customization Hooks for PDM Actions
  
Pre Operation Customization Hooks for PDM Actions
Currently pre operation hooks are supported only for checkin, checkout, rename, revise, and save as operations. Post operation hooks are not supported. The pre operation hooks are only be vetoable in nature; and would only add workflow that would not modify the persistables. The only checks are to catch the exceptions vetoed and abort the transaction. This facilitates adding a workflow that could extract properties from the persistables, and add additional validation mechanism.
You must perform following steps to implement custom pre operation hook:
1. Implement UWGMEventListener interface
2. Register the implemented event listener in <Windchill>/codebase/com/ptc/windchill/uwgm/common/delegate/application.service.xconf
UWGMEventListener
Below is the description of the UWGMEventListener API that a custom EventHandler code needs to implement.
public interface UwgmEventListener
{
/**
* API to process UwgmEvent
* Custom UwgmEventService delegate should implement this API.
*
* @param iteration : Collection of request Iterations
* @param workspace : EPMWorkspace
* @return WTCollection : Response
* @throws WTException
*/

public WTCollection processUwgmEvent(C11nRequestContext
requestContext,WTCollection iteration,EPMWorkspace workspace)
throws WTException;

}
Am example implementation of UWGMEventListener is provided in your Windchill installation at <Windchill>codebase/com/ptc/windchill/uwgm/proesrv/c11n/UwgmC11nEventListenerTest.java for reference purposes only. You are not expected to reuse this class. You need to implement your own server-side customization as per your own needs.
Registering a Custom Event Listener
You must register any custom listener (UwgmEventListener) handler in the <Windchill>/codebase/com/ptc/windchill/uwgm/common/delegate/application.service.xconf file.
Here is an example of a typical format:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Configuration SYSTEM "xconf.dtd">
<Configuration targetFile="codebase/service.properties">
<!-- UWGM Custom Services Implementation for Unit Test -->

<Service context="default"
name="com.ptc.windchill.uwgm.proesrv.c11n.UwgmEventListener">
<Option cardinality="duplicate"
requestor="java.lang.Object" selector="PRE_CHECKIN"
serviceClass="com.ptc.windchill.uwgm.proesrv.c11n.UwgmC11nEventListenerTest"/>
</Service>
</Configuration>
The following selectors are currently supported for registering custom event listeners:
PRE_CHECKIN
PRE_CHECKOUT
PRE_RENAME
PRE_SAVEAS
PRE_REVISE
You must use the xconfmanager utility to propagate changes in application.service.xconf file to the service.properties file.