Editing Code Modules

One of the features of the ECM Developer plug-in is editing of Code Modules. Code Modules are Java classes which implement the desired behavior of Event Actions, Document Lifecycle Actions and Document Classification Actions. Starting points for these classes can be generated using the code templates. With he Code Module editor of the ECM Developer plug-in you can create a new Code Module or update an existing Code Module.

Creating Code Modules

The ability to create Code Modules from scratch is one of the unique points of the ECM Developer plug-in. Because the Code Module class is a hidden class it cannot be created directly with the Enterprise Manager. It must always be created in combination with the creation of a specific action.

The following actions have to be performed to accomplish this task:

The name can still be changed, the Object Store not. Initially the editor will show an error message because the content of the Code Module is not yet set. Use the add commands of the editor to add files to the Code Module. There are two ways files can be added to the Code Module:

These commands are also available in the context menu of the files tree view. With the Remove button unwanted elements can be removed from the Code Module. The files tree can be refreshed with the Refresh commands of the context menu.

Use the Save command of the editor to create a new Code Module in the Object Store.

Now that you have a Code Module the FileNet Enterprise Manager can be used to create different actions which use this Code Module.

Importing Code Modules

In order to edit existing Code Modules on the Content Engine they have to be imported into the Eclipse workspace. The following actions have to be performed to accomplish this task:

Initially the editor will also show an error message because the content of the Code Module is not yet set. The Code Module editor will not retrieve the existing content of the Code Module on the Content Engine. Use the Add command to add content to the Code Module.

Updating Code Modules

In the process of developing Code Modules the content of the Code Module on the Content Engine will change frequently. Therefore the Code Module editor provides functionality for updating the Code Module on the Content Engine. Actions are always coupled to a specific version of the Code Module. If you want your action to use the latest version of the Code Module the action must also be modified. The Code Module editor will also take care of this. Before you update your code module make sure that either your code is build automatically or that you manual build your code to the latest version.

The following actions have to be performed to accomplish the code module updating task:

Additionally the Actions Show Code Module Actions command of the editor can be uses to show which actions are coupled to the Code Module. This will show a dialog similar to the action selection dialog.

Code Modules View

All the Code Modules which are either created by the ECM Developer plug-in or imported by the ECM Developer plug-in are shown in the Code Modules view. You can open this view using the Window > Show view >Other command. The Code Modules view is located in the Content Engine category. Selecting this view will show the following window:

Code Modules View

The toolbar and the context menu of this view also provide most of the functionality described above, such as creating, editing and updating Code Modules. One feature not yet described is the Update Remove command. This command will remove the Code Module from this view but will not remove the Code Module on the Content Engine. So this action can be undone by re-importing the Code Module into the workspace.