Ephesoft Plugin Development

Creating Sample Plugin

In order to create a new plugin, following steps need to be implemented:

Download the plugin code sample Download Now

1. Click on “File -> New -> Other…” option.
2. Type “maven” and select “Maven project” from the list shown below.
3. Check the “Create a simple project” option and click “Next”.
4. Fill in the particulars for “Artifact” i.e. details about new project. These details include

1. “Group Id”: group id for the project as per maven artifacts standards
2. “Artifact Id”: artifact id, i.e. representation name for the plugin for use in various other projects.
3. “Version”: version of the plugin.
4. “Packaging”: type of packaging to be used for the project. In our application we use “jar” packaging.
After entering the above details for the new plugin, click on “Finish”.
5. The structure shown below will be generated for the current project which includes the following:

1. “src” package: used for the storing the source code and resources used by the plugin.
2. “target” package: used for storing the target files i.e. the <b.“.class”</b> files, “.jar” files of the plugin.
3. “pom.xml” file: contains the information about the plugin.

Now start creating desired package structure for the project by right clicking on the “java” package and selecting the “new→others” option and selecting the “package”.
6. Type the hierarchical structure of the project and click on “Finish”.
7. Above operation will create a package structure shown below.
8. Create the desired files and corresponding folders for the plugin. Sample files can be found in the sample source code as well.
9. Now that the plugin is ready with all the content, right click on the project name, go to “Run As” option and from the list shown choose “Maven Build”.
10. A pop up window for editing the “Run/Debug” configuration will open up. In the “Goals” field, type “clean install”, check the “offline” and “Skip Tests” options and then click “Apply”.
11. For creating the jar file for the plugin following settings need to be taken care of:

1. Goto maven repository. Default path for the same is C:\Documents and Settings\{user-name}\.m2\repository folder.
2. Create the folder structure com\ephesoft\dcma\ephesoft\<VERSION_NUMBER> inside the repository folder.
3. Copy and paste the Ephesoft.jar inside the folder.
4. Rename Ephesoft.jar to Ephesoft-<Version_Number>.jar.
5. In the “pom.xml” file for the plugin make the following entry





6. Now that we have defined the dependencies for the plugin, we can use the existing code contained within the “ephesoft-<VERSION_NUMBER>.jar” for the desired purpose.
12. Click on “Run”, this will run the maven project and make its “jar”. A .jar file corresponding to the plugin will be created in the target folder for the same.

Advanced Implementation Steps

1. “Pre Processing” settings: In order to perform some desired work before running a plugin we can create a method in the plugin code file having “@PreProcess” annotation.
2. “Post Processing” settings: In order to perform some desired work after running a plugin we can create a method in the plugin code file having “@PostProcess” annotation.
3. We use the above settings in our application for creating a back up file for batch.xml before and after the plugin has processed which helps us defining the change a plugin has made to the “batch.xml” files for the batch being processed.
4. Sample function for the above scenario:
public void preProcess(final BatchInstanceID batchInstanceID, String ::pluginWorkflow) }

public void postProcess(final BatchInstanceID batchInstanceID, String pluginWorkflow) {

Use these settings in the new plugin in order to maintain consistency with the current conventions and workflow of the application.
5. BackUpFileService can be used to create backup xml files for the respective plugin.

Workflow Management


• Establishments:

• A batch class is made of modules, which in turn consist of plugins.
• Dependencies between modules are only a result of the dependencies that exist between plugins.
Inference: By handling the dependencies that exist between plugins, we can create the Validation framework.

• Addition of a new tab in the admin view for workflow management by the name of “Workflow Management”containing the following:

• “Plugins List”: List of plugins already present.
• “Add New Plugin” button: For adding a new plugin.
• “Dependencies” button: On being clicked it will take user to a screen where it can manage the dependencies among the plugins.
• “Help” button: On being clicked the user will be shown a pop-up message containing the information about the new plugin upload.
• “Add New plugin”: a plugin upload widget will open up. See the screenshot below
• “Browse”: a file selection window will open up.
• “Save”: this will save the plugin to the DB after validating the files.
• “Cancel”: this will cancel the operation.
• This widget will accept a .zip file for uploading.
• Contents of the zip file:

• .Jar file: The Jar for the plugin to be added.
• .Xml file: containing the plugin information.
• .Zip file must only contain these two files.
• .Zip file and .Jar file must have the same name.
• .Jar file content cannot be verified, so please make sure that they are as required.
• In order for this plugin to take effect, user needs to restart the tomcat server.
• Note:

• This Zip file after successful validation of its contents will be stored in the location specified in “<DCMA_HOME>\WEB-INF\classes\META-INF\application.properties” file under the property named “plugin_upload_folder_path”.
• The JPDL file for the uploaded plugin will be stored at <Ephesoft-Shared-Folders\workflows\plugins\<PLUGIN_NAME> . This path is configurable in the dcma-batch.properties file.

XML Structure

<?xml version=”1.0″ encoding=”UTF-8″?><plugin>








Validation on above XML

• All tags are compulsory and will have any string value, except for “is-scripting”,” is-mandatory” and “is-multivalue” tags which will have Boolean values (TRUE, FALSE).
• jar-name tag value must match the name of the jar file present in the zip file.
• If “is-scripting” tag has a value “TRUE”, only then the values of “back-up-file-name” and “script-name” tag will be taken into account.
• “plugin-property” and “dependency” tag can have multiple instances and have the values for plugin configs and dependencies respectively.


• “plugin-service-instance” and “method-name” tags must be correct as they cannot be validated. • “application-context-path” refers to the application context file name for the plugin. • For the dependencies tag:

• For a new plugin, with dependencies as

o ORDER_BEFORE : P2,P3/P4,P5,P6/P7/P8
o OR (/) operator and AND (,) operator are also supported for specifying complex dependencies.


<type-of-dependency>ORDER_BEFORE </type-of-dependency>


<type-of-dependency>ORDER_BEFORE </type-of-dependency>


<type-of-dependency>ORDER_BEFORE </type-of-dependency>



Was this article helpful to you?

Rene Hernandez