Advanced Customization > Business Logic Customization > Customizing Workflow Administration > Customizing Workflow Events on an Object > Creating a customized event on an object
  
Creating a customized event on an object
The following is an example of how to create a customized workflow event (wt.workflow.engine.WfCustomEvent) on an object. In this example, the customized event is MY_EVENT.
1. Add the following entry to <Windchill>/src/wt/workflow/engine/WfCustomEventTypeResource.java :
@RBEntry("MY_EVENT")
public static final String MY_EVENT = "MY_EVENT";
2. Add the following entry to <Windchill>/src/wt/workflow/robots/synchEventResource.java :
@RBEntry("MY_EVENT")
public static final String PRIVATE_CONSTANT_39 =
"*/wt.workflow.engine.WfCustomEventTypeResource/MY_EVENT";
* 
Declare the user defined event as a new variable. For example, if the total number of resources available in the synchEventResource.java file are 39, declare MY_EVENT as the 40th variable.
public static final String PRIVATE_CONSTANT_<next_count>=“*/<Classpath>/<Custom_Event>”;
3. Rebuild the resources by running the following in the Windchill shell:
ant -f bin/tools.xml class -Dclass.includes=wt/workflow/robots/synchEventResource.java
ant -f bin/tools.xml class -Dclass.includes=wt/workflow/engine/WfCustomEventTypeResource.java
4. Rebuild the client JARs (see “Rebuilding Client JARs” in Best Practices for Customizing Files Supplied by PTC).
ant -f codebase/MakeJar.xml custUpdate
5. Clear the Java Plug-in cache on your client machines.
6. Restart the Method Server.
7. Use the Workflow Process Editor to design a workflow template with a Synchronization robot, as shown below:
In the Synchronization robot properties window:
a. Select object event
b. Make sure MY_EVENT is listed in Event dropdown list.
c. Choose MY_EVENT
d. Write appropriate expressions in the initial and routing expressions.
For more information on the Workflow Process Editor, see the Windchill Business Administrator's Guide.