Informatica ActiveVOS
- Informatica ActiveVOS 9.2.4.6
- All Products
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"; } } }