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="4.3" mode="asynchronous">
       <type>artifact</type>
       <operation>create</operation>
       <user>admin</user>
	<handler>com.vasoftware.sf.plugin.CreateTestCaseWorkflow</handler>
    </event>

  <event api="4.3" mode="synchronous">
       <type>*</type>
       <operation>*</operation>
	<handler>com.vasoftware.sf.plugin.EventTestListener</handler>
    </event>
</event-handler>