event.xml

Here is an example of an event.xml file. Use it to create a new event.xml file for your custom event handler in the META-INF directory of your jar file.

In this example, the CreateTestCaseWorkflow class will be invoked only on artifact creation and will run after the artifact creation is successfully committed. The EventTestListener will run for every single event and will run synchronously thereby having the opportunity to cancel the event.

<?xml version="1.0"?>
<!DOCTYPE event-handler
	PUBLIC "-//VA Software, Inc.//DTD Data Object 1.1//EN"
	"http://schema.vasoftware.com/sf/dtd/sf-event-handler_1_0.dtd">

<event-handler>
    <event api="6.1" mode="asynchronous">
       <type>artifact</type>
       <operation>create</operation>
       <user>admin</user>
	<handler>com.collabnet.ctf.events.CreateTestCaseWorkflow</handler>
    </event>

  <event api="6.1" mode="synchronous">
       <type>*</type>
       <operation>*</operation>
	<handler>com.collabnet.ctf.events.EventTestListener</handler>
    </event>
</event-handler>