Table of Contents

Search

  1. Preface
  2. Part 1: Using Process Developer
  3. Part 2: Creating and Modifying Processes
  4. Part 3: Functions, Events, Errors, and Correlation
  5. Part 4: Testing and Deployment
  6. Part 5: Process Central and Process Server (On-Premises)

Process Developer

Process Developer

Sample Custom Function

Sample Custom Function

The following shows a sample custom function:
package com.acme.functions; import java.util.List; import org.activebpel.rt.bpel.function.AeFunction; import org.activebpel.rt.bpel.function.AeFunctionCallException; import org.activebpel.rt.bpel.function.AeFunctionContext; import org.activebpel.rt.bpel.function.AeFunctionUnit; import org.activebpel.rt.bpel.function.AeUnresolvableException; import org.activebpel.rt.bpel.function.IAeFunction; import org.activebpel.rt.bpel.function.IAeFunctionContext; import org.activebpel.rt.bpel.function.IAeFunctionExecutionContext; @AeFunctionContext(name = "AcmeContext", namespace = "http://acme.com/functions") public class GenericFunctionContext implements IAeFunctionContext { private IAeFunction echoFunction = new EchoFunction(); private IAeFunction companyNameFunction = new CompanyNameFunction(); @Override @AeFunctionUnit(prefix = "ac", display = "ACME", hoverText = "Acme company functions", functions = { @AeFunction(syntax = "${prefix}:echo(${caret})", display = "echo(param)", hoverText = "echo function that returns the given string"), @AeFunction(syntax = "${prefix}:companyName()", display = "companyName()", hoverText = "Returns company name") }) public IAeFunction getFunction(String aFunctionName) throws AeUnresolvableException { if (aFunctionName.equals("echo")) return echoFunction; else if (aFunctionName.equals("companyName")) return companyNameFunction; return null; } private class EchoFunction implements IAeFunction { @Override public Object call(IAeFunctionExecutionContext aContext, List aArgs) throws AeFunctionCallException { if (aArgs.size() == 1) return aArgs.get(0); return null; } } private class CompanyNameFunction implements IAeFunction { @Override public Object call(IAeFunctionExecutionContext arg0, List arg1) throws AeFunctionCallException { return "acme"; } } }

0 COMMENTS

We’d like to hear from you!