Customizing Send Action Class - EnterWorks_Process_Exchange_(EPX) - 10.6

EnterWorks EPX Process Modeling

Product type
Software
Portfolio
Verify
Product family
EnterWorks
Product
Precisely EnterWorks > EnterWorks Process Exchange (EPX)
Version
10.6
Language
English
Product name
Precisely EnterWorks
Title
EnterWorks EPX Process Modeling
First publish date
2007
Last updated
2023-07-28
Published on
2023-09-20T04:05:11.973084

The custom send action class may be used for anything that the user wants to do as part of the send operation. This class will only be called on work items that have the Send Action Class field specified on the Custom Action tab of certain activities. It allows the user to create a custom code that can perform certain actions or tasks before sending the work item to the next activity. Customizing the send action class, for example, can override the date and time specified in the Work Item Key field set on the Delayed Send option. Instead of using the Work Item Key field in delaying the send of the work item, you can indicate the code you created in the Send Action Class field and satisfy the conditions set on that code before sending the work

item.

A sample custom code is made available for your reference if you installed the EPX documents during EPX installation. The SampleCustomSendAction.java file located in the <EPX>\examples\custom directory would be included in your EPX install. The sample program file aims to send the work item to the next activity according to the value set in the sendWaitPeriod variable located in the custom.properties file.

There are certain steps to follow before you can use the java file in the Send Action Class field:

  1. Edit the build.bat file. Change the values of the variables EPX_HOME and EXAMPLE_JDK_HOME.

Here is an example:

EPX_HOME=D:\Enterworks\EPX31

EXAMPLE_JDK_HOME=D:\jdk1.5

  1. If you want to edit the java file, you can do so by adding more conditions or tasks in it. If you do not want to edit the java file, compile the SampleCustomSendAction.java file by using the build.bat file on Windows or the build.sh file.

  2. After compiling, the custom.jar file is created. You need to include this jar file in your application server and webtools classpath.

Note: Do not forget to add a semicolon at the end of the path.

If you are using JBoss as the application server:

  • Go to your JBoss directory <EPX>\bin and edit the: EPX_JBOSS_<port>_wrapper.conf file.

In the EPX_JBOSS_<port>_wrapper.conf file, find the CLASSPATH variable and add at the end, the path of the custom.jar file. A sample path would be D:/Enterworks/EPX/examples/custom/custom.jar;

Also, add the code below at the end of the file:

<MLET CODE =

"examples.custom.SampleCustomSendAction"

ARCHIVE="custom.jar"

CODEBASE=

"D:/Enterworks/EPX/examples/ custom/">

</MLET>

  • On your Tomcat webtool go to the <EPX>\bin directory and edit the EPX_WebServices_<port>_<port>_wrapper.conf and EPX_WebTools_<port>_<port>_wrapper.conf files located in the directory.

Add the classpath:

lax.class.path=

D:/Enterworks/EPX/examples/custom/custom.jar;

  1. After adding the custom.jar file on the application server and webtools classpath, you can now use the SampleCustomSendAction.java file. In the Send Action Class field, type in examples.custom.SampleCustomSendAction.

An example would be if both the Work Item Key in the Details tab and the Send Action Class field in the Custom Action tab have valid entries, the value set in the sendWaitPeriod variable located in the custom.properties file would override the value specified in the Work Item Key.