User Tools

Site Tools

Implementing Custom Code

The first step of the process of creating custom code for EASA is to review the available interface documentation to better understand the coding requirements. Therefore, if you have not already done so, be sure to review the details of Creating Custom Objects.

Also, you should be aware of the EASA Java API documentation, which is accessed by selecting the View interface documentation link located on the Custom Code page under the Configure tab in Administrator mode. Once you have decided to create custom code for your EASA System and have reviewed the available documentation, you should be ready to next move on to writing and compiling your code.

Compiling Custom Code

When you write custom code for use within EASA, you will always need to implement one of the existing interfaces or extend one of the existing abstract classes in EASA.

For example, you will have code similar to:

public class MyAction implements CustomAction { 

Therefore, before you can compile your custom code you will need to download the EASA Java interfaces file (easa-com.jar) to compile with your code. You download this file by clicking on the Download Java interfaces link located on the Custom Code page under the Configure tab in Administrator mode, and then saving the file to your computer’s disk drive. Once you have written your custom code, you can compile using a command similar to the following:

javac -classpath easa-com.jar 

where javac is the command to run the standard Java compiler supplied by Sun Microsystems. You will now have a class file that you can now be tested as described in the following section.

Note: The Java compiler used should be for Java version 1.5 or higher.

Testing Custom Code

Once you have written and compiled your custom code, you should test your new class files before distributing them to all possible users of the new Custom Objects.

There are two forms of testing that should take place:

  1. Manual testing of your custom code prior to loading it onto your EASA Server, and
  2. testing within EASA prior to sending it out to all other users.

Manual Testing

To test your custom code outside of EASA will require you to write and compile a new test class that contains the main() method, so that it can run as a stand alone program. Once you have this test class written and compiled, you can run it from a command prompt. An example of test code for testing a Custom Scalar object is provided below:

import java.util.*;  
import com.mycompany.mypackage.MyCustomScalar; 
import com.easa.dor.DOREvaluator; 
import com.easa.dor.CustomScalar; 

public final class TestScalarDor { 
  public final static void main(final String [] args) { 
  try { 
    CustomScalar scalar = new MyCustomScalar(); 
    DOREvaluator eval = new TestEvaluator(); 
    final Object value = scalar.getValue(“myDor”); 
    if (!value.toString().equals(“100”)) { 
      throw new Exception(“Wrong Value”); 
    } catch (Exception ex) { 
private static class TestEvaluator implements DOREvaluator { 
  // return 10 for all DORs in this test. 
  public String getValue (String dor){ 
    return 10; 
  public List getValues(String dor){
    return null; 
  public String expandString(String delimiter, String dor){
    return null; 
  public Map getParameters()){ 
    return null;
  public String getObjectName()){
    return null;
  public void checkName(Object dorName) throws Exception { 

Testing in EASA

Custom Action objects can be tested in EASA without releasing them to the rest of the users on your EASA System by manually updating only your EASA Client installation. To update your client, all you need to do is place a copy of your jar file in the custom folder within your EASA Client installation. On a Windows computer the default EASA Client location would be:

C:\EASA Client\custom 

Next, you need to update the relevant properties file as described below. After updating the properties file, you can start using your custom objects within an EASAP by creating a CUSTOM ACTION under an Event Processing object in EASAP Builder. To make this new object run your custom code, you specify the full class name of your code as the value of the Class parameter of the object.

Then fill in any additional new parameter values that your custom code generates and then test changes in the EASAP as appropriate. To test the Custom Action, you will most likely need to open a test EASAP on the Testing page and then trigger the events that cause the Custom Action to be performed.

Uploading Custom Code Files

Now that you have thoroughly tested your custom code, you should be ready to allow other authors and users to make use of the new custom objects that you have created. The first step in making custom objects accessible by other others is to upload your code onto the EASA Server.

To upload your custom code, the first step is to put all your class files into a Java Archive (jar) file using the jar command as follows:

   jar -cvf MyCustomCode.jar MyCustomCode.class

Next, after putting your class files into a jar file, you upload the jar file by performing the following steps:

  1. Select Custom Code under the Configure tab in Administrator mode in EASA.
  2. Click on the Upload or remove jar files link.
  3. Under Upload Jar File, click on the Browse button and then find select, and open your jar file.
  4. Click on the Upload button.

Note: For all Custom Objects described in these pages, you should leave both “For use on Client” and “For use on Server” checked.

Your jar file has now been uploaded onto the EASA Server.

Updating Properties Files

The second step in making custom objects accessible by others is to modify the appropriate Property file in EASA. There is a separate Property file for each type of Custom Object that has been described in this section, and the files are listed in the table below.

Custom Object Property File Name
Custom Scalar
Custom List
Custom Multi-List
Custom Action
Custom GUI

Once you have identified the Property file that needs to be modified for your custom code, you edit the file by performing the following steps:

  1. Select Custom Code under the Configure tab in Administrator mode in EASA.

  2. Click on the Update property files link.

  3. Find the appropriate Property file in the table and click on its Edit button () to open the file in a text editor.

  4. Add a line in the file containing the full class name of your custom code.

  5. Save the file and exit the text editor.

By adding your class to the appropriate file, it will now show up in a pull down list in the Class Parameter of the appropriate Custom Object in EASAP Builder. Therefore, other authors will be able to select it and make use of it.

Updating the EASA Server

The final step is to update the EASA Server to fully recognize your custom code. To update the EASA Server, please perform the following steps:

  1. Select Custom Code under the Configure tab in Administrator mode in EASA.
  2. Click on the Update Server link.
  3. Click on the Update button. After updating the EASA Server, your custom code will be fully recognized by your EASA System and is now ready to be used by other users in your organization.

Page Tools