Although its is not very difficult to start developing code modules, a convenient way to generate the starting Java code is by using the templates in the ECM Developer plug-in. There are templates for the following code module types:

  • Event Actions
  • Change Preprocessors
  • Lifecycle Action Handler
  • Document Classifier

Before you start programming the code modules make sure that you have a reference to the Content Engine API, the file Jace.jar, in you project build path. The code modules can be generated by using the File > New > Other command and next selecting the desired Java class in the ECM Developer/Action Classes category:

new_event_action_class_wizard

In the next page of the wizard the necessary information can be supplied to generate the Java class:

new_event_action_class

Now a Java class will be generated containing the following source code:

/**
 *
 */
package server;

import com.filenet.api.engine.EventActionHandler;
import com.filenet.api.events.ObjectChangeEvent;
import com.filenet.api.exception.EngineRuntimeException;
import com.filenet.api.util.Id;

/**
 * @author ecm.developer
 *
 */
public class MyEventActionHandler implements EventActionHandler {

	public void onEvent(ObjectChangeEvent event, Id subscriptionId)
			throws EngineRuntimeException {
		// TODO Auto-generated method stub

	}

}

The wizards for the other action classes work in the same way.