1. Home
  2. Transact
  3. Developer Documentation
  4. Custom Plugins
  5. How To Create A Custom Plugin

How To Create A Custom Plugin


  1. Install Java JDK
  2. Download Apache Maven
  3. Install Eclipse
  4. Install Maven
    • Open Eclipse
    • Go to Help -> Eclipse Marketplace
    • Search “Maven”
    • Click “Install” button on “Maven Integration for Elcipse”
    • Follow Instructions
    • Go to Window -> Preferences, and you should see Maven listed in the left panel

Creating a Custom Plugin

  1. Open Eclipse
  2. Click File -> New and select Maven Project
    • SelectMavenProject2
  3. Select Default Workspace
    • DefautWorkSpace
  4. Select quickstart Maven archtype. The Artifact ID is maven-archtype-quickstart.
    • QuickStartMaven
  5. Type the Group Id and Artifact Id. The Group Id is the package structure for your project. The Artifact Id will be the name of your project, and the final source folder of your package. More information about the Java specification for package names can be found here:
    • Group Id : com.ephesoft.customplugin
    • Artifact Id : ephesoft-custom-plugin
    • GroupIdArticatId
  6. Your Eclipse Project workspace should now look like this
    • MavenProjectWorkspace
  7. Add the Ephesoft Libraries to your Project.
    (Note: Custom script class file should not be added in any of custom jar. Adding custom script class file into any jar will create issue as default location for the custom script class file is {Ephesoft installation}JavaAppServertempDynamicCodeCompiler)

    1. Right Click on your project folder “ephesoft-custom-plugin”
    2. Select Build Path -> Configure Build Path
    3. Click on the Libraries Tab
    4. Click Add External Jars
    5. Navigate toEphesoft Installation Path “ApplicationWEB-INFlib “
    6. Select All Jar Files
    7. Click Open
    8. Click OK
  8. Create a New Interface
    1. Right Click On your Package “com.ephesoft.customplugin.ephesoft.custom_plugin”
    2. Select -> New Interface
      • Name : CustomPlugin
      • MavenNewInterface
    3. Replace the file contes with the below code
  9. [code]package com.ephesoft.customplugin.ephesoft_custom_plugin;
    import com.ephesoft.dcma.core.DCMAException;
    import;public interface CustomPlugin {
    void helloWorld(final BatchInstanceID batchInstanceID, final String pluginWorkflow) throws DCMAException;

    • MavenCustomPlugin
  10. Create a Java class to Implemaent Interface CustomPlugin
    1. Right Click On your Package “com.ephesoft.customplugin.ephesoft.custom_plugin”
    2. Select New -> Class
      • Name : CustomPluginImpl
      • MavenCustomPluginImpl
      • Replace Code with below
        • [code]package com.ephesoft.customplugin.ephesoft_custom_plugin;
          import org.springframework.util.Assert;
          import com.ephesoft.dcma.core.DCMAException;
          import com.ephesoft.dcma.core.annotation.PostProcess;
          import com.ephesoft.dcma.core.annotation.PreProcess;
          import com.ephesoft.dcma.core.component.ICommonConstants;
          import com.ephesoft.dcma.da.service.BatchClassPluginConfigService;
          import com.ephesoft.dcma.util.BackUpFileService;public class CustomPluginImpl implements CustomPlugin, ICommonConstants {private BatchClassPluginConfigService batchClassPluginConfigService;@PreProcess
          public void preProcess(final BatchInstanceID batchInstanceID, String pluginWorkflow)
          public void postProcess(final BatchInstanceID batchInstanceID, String pluginWorkflow)
          }public void helloWorld(BatchInstanceID batchInstanceID, String pluginWorkflow) throws DCMAException {
          //TODO Auto-generated method stub
          String name = “”;
          String propertyName = “”;
          name = batchClassPluginConfigService.getPluginPropertiesForBatch(batchInstanceID.getID(), “EPHESOFT_CUSTOM_PLUGIN”).get(propertyName);
          System.out.println(“**** Ephesoft Custom Plugin: Hello ” + name + ” ” + batchInstanceID.getID() + ” *****”);
          }public BatchClassPluginConfigService getBatchClassPluginService()
          return batchClassPluginConfigService;
          }public void setBatchClassPluginConfigService(BatchClassPluginConfigService batchClassPluginConfigService)
          this.batchClassPluginConfigService = batchClassPluginConfigService;
        • MavenCustomPluginImplCode
  11. Create Folder Structure for XML Resources
    1. Right Click on you Project in Project Explorer Window
    2. Selct New -> Source Folder
      •  Folder Name : src/main/resources
      • MavenSRCXML
    3. Create a META-INF folder
      1. Right Click on “src/main/resources” in your Project folder you just created
      2. Select New -> Folder
        • Folder Name : META-INF
    4. Create Sub Folder under META-INF
      1. Right Click on META-INF
      2. Select New -> Folder
        • Set Folder name to your Project Name
          • Name : ephesoft-custom-plugin
  12. Create the XMLs
    1. Right Click on “src/main/resources”
    2. Select New -> XML File
      • If XML File is not available Click Other and look for XML File
      • Name this XML the same name as your  Project
        • Name : ephesoft-custom-plugin.xml
      • Description of Properties
        • <jar-name> – This is the name of the jar file containing your plugin code, when we build the project and get a jar file, we’ll need to rename it to match this value. This should be <name of the project>.jar.
        • <plugin-name> – This is the name of the plugin that will show in the workflow. In the class, we used the name “EPHESOFT_CUSTOM_PLUGIN”, so we’ll need to put that here.
        • <plugin-service-instance> – This is the name of the bean identifier we will reference in the applicationContext.xml. My value is set to “CustomPlugin”.
        • <method-name> – This is the name of the method that will be first called when the plugin executes in the workflow.
        • <application-context-path> – This should set to the applicationContext-ephesoft-custom-plugin.xml.
        • <plugin-properties> – Here is where you indicate the properties of the plugin that will be configured in the UI. In the class, we called on one property, called “”.
      • Add Below code to ephesoft-custom-plugin.xml
      • [code]<?xml version=”1.0″ encoding=”UTF-8″?>
        <plugin-desc>Ephesoft Custom Plugin</plugin-desc>
      • MavenprojectName
    3. Right Click on the META-INF folder you Created
    4. Select New -> XML File
      • Name this file applicationContext-<NAME OF YOUR PROJECT>
        • Name : applicationContext-ephesoft-custom-plugin.xml
      • Add below code to applicationContext-ephesoft-custom-plugin.xml
        • [code]<?xml version=”1.0″ encoding=”UTF-8″?>

          <import resource=”classpath:/META-INF/ephesoft-custom-plugin/applicationContext.xml” />
        • MavenApplicationContextProjectName
    5. Right Click on the Sub Folder of META-INF (should be the name of your project “ephesoft-custom-plugin”)
    6. Select New -> XML File
      • Name : applicationContext.xml
      • Replace applicationContext.xml with below Code
      • [code]<?xml version=”1.0″ encoding=”UTF-8″?>
        <import resource=”classpath:/META-INF/applicationContext-data-access.xml”/>
        <import resource=”classpath:/META-INF/applicationContext-batch.xml”/>
        <import resource=”classpath:/META-INF/applicationContext-core.xml”/>
        <bean id=”CustomPlugin”
        class=”com.ephesoft.customplugin.ephesoft_custom_plugin.CustomPluginImpl” >
        <property name=”batchClassPluginConfigService”
        <context:component-scan base-package=”com.ephesoft.customplugin.ephesoft_custom_plugin” />
    7. You should have a folder structure that looks like below
      • MavenFolderStructure2
  13. Finishing Up
    1. We have one more XML File to modify
      • Locate the pom.xml under your project. It should already exisit
      • Replace contents with below code
      • [code]<project






































      • MavenpomXML
  14. Copy and Paste the ephesoft.jar file from EphesoftApplicationWEB-INFlib to your project “src/main/resources” Folder
  15. Compiling the Project
    1. Right Click on Project Folder
    2. Click RunAs Maven build
      1. Golas : clean install
      2. Click Apply
      3. Click OK
  16. Note After Compiling you may need to Right Click and Refresh your project to update the Folder structure
  17. Import The Plugin Into Ephesoft
    1. Locate the Created JAR file after compiling under your Project in Eclipse
      • Under target folder
      • Temporarily copy to Desktop
      • Rename Jar from “ephesoft-custom-plugin-0.0.1-SNAPSHOT.jar” To “ephesoft-custom-plugin.jar”
    2. Locate ephesoft-custom-plugin.xml under your project
      1. Temporarily copy to Desktop
    3. Zip these files together
      • Highlight both Files
      • Right Click
      • Send To -> Compressed Zip
      • ZIP name must equal same name as JAR file
        • Name :
      • MavenCompresedZip
    4. Open Ephesoft in a web browser.
    5. Go to System Configuration.
    6. Select Workflow Management.
    7. Drag and drop your created .zip file into the Import Plugin Section.
    8. Restart Ephesoft to reload in your new JAR on startup.
  18. You should now have a working custom plugin.


Was this article helpful to you? Yes 1 No 1