他のすべてのコンポーネントに対する関数の実装方法

Oracle BPEL Process ManagerOracle Mediatorおよびヒューマン・ワークフローの関数では、oracle.fabric.common.xml.xpath.IXPathFunctionインタフェース(fabric-runtime.jarファイルで定義)またはjavax.xml.xpath.XPathFunctionを実装する必要があります。

他のすべてのコンポーネントに対する関数を実装するには:

  1. XPath関数用のoracle.fabric.common.xml.xpath.IXPathFunctionインタフェースを実装します。IXPathFunctionインタフェースには、call(context, args)という1つのメソッドがあります。次の例は、このメソッドのシグネチャを示しています。
     package oracle.fabric.common.xml.xpath;
     public interface IXPathFunction
     {
        /** Call this function.
        *
        *  @param context The context at the point in the
        *         expression when the function is called.
        *  @param args List of arguments provided during
        *         the call of the function.
        */
        public Object call(IXPathContext context, List args) throws
     XPathFunctionException;
     }
    

    説明:

    • context: 関数をコールした時点の式内のコンテキスト。

    • args: 関数のコール時に指定する引数のリスト。

    次の例では、getNodeValue(arg1)という関数が実装され、値w3c nodeを取得します。

    package com.collaxa.cube.xml.xpath.dom.functions;
     import oracle.fabric.common.xml.xpath.IXPathFunction;
     import oracle.fabric.common.xml.xpath.IXPathFunction
     . . .
    
     public class GetNodeValue implements IXPathFunction {
        Object call(IXPathContext context, List args) throws XPathFunctionException
     {
            org.w3c.dom.Node node = (org.w3c.dom.Node) args.get(0);
            return node.getNodeValue()
        }
     }