ActiveVOS Designer User’s Guide

Java-Based Custom Functions

The ActiveVOS server uses a Java framework that supports custom function extensions. This framework is a set of Java interfaces and classes made available for your use. IAeFunction and IAeFunctionContext are implemented to create the objects that are accessible to the engine at run-time. AeFunctionCallException and AeUnresolvableException are used to signal fault conditions. These types are resolved via the org.activebpel.rt.bpel package in ae_rtbpel.jar. Additionally, AeUnresolvableException extends AeException provided in ae_rt.jar.

Step One: Create a Function Context

Your first task is to create a function context, which is a new class that implements the IAeFunctionContext interface. This class exposes one public method: getFunction(String), which returns an object of a type that implements the IAeFunction interface. The method uses the String argument to indicate the local name of the function and then select that object.You may implement multiple custom functions via one function context class. getFunction() throws an AeUnresolvableException if it is unable to locate the desired function by name.

Step Two: Create the Custom Function

Your second task is to create the actual custom functions, each of which implements the IAeFunction interface. These also expose one single public method: call(IAeFunctionExecutionContext, List), which performs the function’s task, which you create. The function’s argument list (if any) is passed to the call method via the List argument. This function may optionally use the function execution IAeFunctionExecutionContext as needed. Individual custom functions should throw AeFunctionCallException, constructed to contain the root exception message, if they encounter a problem that prevents them from finishing their task.

Step Three: Package and Deploy

Once you have created your function context and function classes, and tested the classes that do the actual custom function work, you can create a jar file that can be deployed to the ActiveVOS server. Optionally you can make it available to ActiveVOS Designer for simulation.

Sample Custom Function

To help you get started with custom functions, the Active Endpoints Web site Education Center contains a Custom Function sample with all the files you need to see a working example of a custom function.

When you download and import the custom_functions project, you will have the following files:

File

Description

aecf-xmlstring.jar

Contains the class files generated from the Java source implementing the custom function

custom_xpath_xmlstring_pickList.xml

Document describing display elements for the custom functions so that they appear in Expression and Query Builders in ActiveVOS Designer.

custom_function.bpel

Process illustrating the use of sample custom functions.

custom_function.wsdl

Interface for the process

BrandYearTypeRequest.xml

Sample data for use in simulation

To use the sample files, do the following:

  1. Complete the steps described in Specifying Custom Function Simulation Setup.
  2. Complete the steps described in Adding Custom Functions to Expression and Query Builders to add the function builder XML file.
  3. Add the WSDL file to your project folder.
  4. Open the BPEL file.
  5. Add sample data, and simulate the process.