Deploying extensions
Purpose
To deploy an extension so that it can be used within the Erudine Behaviour Engine. This exercise covers a topic that is required in previous exercises. These exercises provide the information needed to follow the instructions detailed in this exercise. It is suggested that you do not complete this exercise in isolation.
Theory
Since the process for deploying extensions is the same for every plug-in, this process is described in this section and referred to within the remaining exercises.
When deploying an extension you will need to complete the following high-level steps:
- Build the extension into a Java-standard Java Archive file (JAR). This can be done in various ways, including using an export function within an IDE or dynamically using an Ant script. This guide will use Eclipse's export facility to create its JAR files.
- Save the JAR file into a location where the Erudine Behaviour Engine will be able to find it. This means that you will save it in the location that you defined when you set the ERUDINE_PATH environment variable.
- Register the package contained within the JAR file, within the Erudine Behaviour Engine, by modifying the erudine.config file. The property that is used depends upon the type of extension that is being deployed and includes the following:
| Extension Type | Property |
| Action plug-in | erudine.plugIn.externalActionPlugInPackages |
| Function | erudine.plugIn.externalFunctionPackages |
| Justification plug-in | erudine.plugIn.externalJustificationPlugInPackages |
| View plug-in | erudine.plugIn.externalViewPlugInPackages |
Using the properties in the table, you can either add a new package or extend an existing property.
Add a new property If the required property does not already exist, then it should be added using the following configuration file text: erudine.plugIn.externalActionPlugInPackages=my.new.package
Extend an existing property If the property has already been registered, then extend the property as follows:
erudine.plugIn.externalActionPlugInPackages=my.old.package,my.new.package
In this exercise, you will learn how to build an extension, save the JAR file into an appropriate location and modify the erudine.config file to register the package contained within the JAR file.
Actions
To deploy an extension:
- Identify the Java file that contains the extension.
The Java file will be different for each extension and will be specified within the relevant exercise. - Open Eclipse.
- Expand the Training folder to display its contents.
- Expand the src/java folder.
- Expand the package that contains the required Java file.
- Right click on the required Java file and select Export from the context menu.
- Select Java > JAR file as the export destination and click Next > .
- Enter the name of the Java class and '.jar' as the export destination.
For example, if your class is HelloWorldViewPlugIn , then enter HelloWorldViewPlugIn.jar as the export destination. - Click Finish .
The JAR file is created and saved in the root directory of the Eclipse workspace.
If your Eclipse workspace is C:\Documents and Settings\<user.name>\Training Workspace , then the JAR file will be placed in that directory.
You are now ready to add the location in which the JAR file has just been saved to the ERUDINE_PATH environment variable. - If you have not previously added the location of the JAR file to the ERUDINE_PATH variable, then follow the steps in Setting the ERUDINE_PATH to add a new location to the environment variable.
- Open My Computer.
- Locate the erudine.config file, which is saved in the following location if you installed the Erudine Behaviour Engine using the default installation options:
- C:\Program Files\Erudine\erudine.config in a Windows environment.
- /opt/erudine/erudine.config in Unix-based environments.
- Open the erudine.config file using a text editor.
You are now ready to register the package contained within the JAR file, within the Erudine Behaviour Engine. - Modify the erudine.config file by either adding a new property or extending an existing property.
See the Register the package text within the Theory section of this exercise for information on how to do this. - Save the erudine.config file and close the text editor.
Platform: all
EBE Version: 2.4
Category: Development Training Guide
Author: Patrick Peisker