You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by va...@apache.org on 2007/10/10 22:17:18 UTC

svn commit: r583602 - in /ode/trunk: ./ extensions/ extensions/e4x/ extensions/e4x/src/ extensions/e4x/src/main/ extensions/e4x/src/main/java/ extensions/e4x/src/main/java/org/ extensions/e4x/src/main/java/org/apache/ extensions/e4x/src/main/java/org/a...

Author: vanto
Date: Wed Oct 10 13:17:15 2007
New Revision: 583602

URL: http://svn.apache.org/viewvc?rev=583602&view=rev
Log:
Initial checkin: E4X Extension (experimental)

Added:
    ode/trunk/extensions/
    ode/trunk/extensions/e4x/
    ode/trunk/extensions/e4x/src/
    ode/trunk/extensions/e4x/src/main/
    ode/trunk/extensions/e4x/src/main/java/
    ode/trunk/extensions/e4x/src/main/java/org/
    ode/trunk/extensions/e4x/src/main/java/org/apache/
    ode/trunk/extensions/e4x/src/main/java/org/apache/ode/
    ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/
    ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/
    ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/ExtensionContextWrapper.java
    ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/JSExtensionBundle.java
    ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/JSExtensionOperation.java
    ode/trunk/extensions/e4x/src/test/
    ode/trunk/extensions/e4x/src/test/java/
    ode/trunk/extensions/e4x/src/test/java/org/
    ode/trunk/extensions/e4x/src/test/java/org/apache/
    ode/trunk/extensions/e4x/src/test/java/org/apache/ode/
    ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/
    ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/
    ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/JSBPELTest.java
    ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/JSOperationTest.java
    ode/trunk/extensions/e4x/src/test/resources/
    ode/trunk/extensions/e4x/src/test/resources/bpel/
    ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/
    ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/TestE4X.bpel
    ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/TestE4X.wsdl
    ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/deploy.xml
    ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/test.properties
Modified:
    ode/trunk/Rakefile

Modified: ode/trunk/Rakefile
URL: http://svn.apache.org/viewvc/ode/trunk/Rakefile?rev=583602&r1=583601&r2=583602&view=diff
==============================================================================
--- ode/trunk/Rakefile (original)
+++ ode/trunk/Rakefile Wed Oct 10 13:17:15 2007
@@ -456,6 +456,21 @@
 
 end
 
+  define "ode-extensions" do
+    define "extensions" do
+	  desc "E4X Assign Extension"
+	  define "e4x" do
+	    compile.with "rhino:js:jar:1.6R7", projects("ode:bpel-api", "ode:bpel-obj", "ode:utils")
+		test.with "rhino:js:jar:1.6R7", projects("ode:bpel-api", "ode:bpel-obj", "ode:jacob", "ode:bpel-schemas",
+		      "ode:bpel-scripts", "ode:scheduler-simple", "ode:bpel-test", "ode:utils", "ode:bpel-compiler",
+			  "ode:bpel-dao", "ode:bpel-runtime", "ode:bpel-store", "ode:il-common", "ode:dao-jpa"),
+		      COMMONS.collections, COMMONS.lang, COMMONS.logging, DERBY, JAVAX.connector,
+		      JAVAX.stream, JAVAX.transaction, JAXEN, HSQLDB, LOG4J, SAXON, XERCES, XMLBEANS, XALAN,
+			  DERBY, Java::JUnit::JUNIT_REQUIRES, JAVAX.persistence, OPENJPA, WSDL4J, JAVAX.transaction
+      end
+	end
+  end
+
 define "apache-ode" do
   [:version, :group, :manifest, :meta_inf].each { |prop| send "#{prop}=", project("ode").send(prop) }
 

Added: ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/ExtensionContextWrapper.java
URL: http://svn.apache.org/viewvc/ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/ExtensionContextWrapper.java?rev=583602&view=auto
==============================================================================
--- ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/ExtensionContextWrapper.java (added)
+++ ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/ExtensionContextWrapper.java Wed Oct 10 13:17:15 2007
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.extension.e4x;
+
+import java.io.StringWriter;
+
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.eapi.ExtensionContext;
+import org.mozilla.javascript.Context;
+import org.mozilla.javascript.Function;
+import org.mozilla.javascript.Scriptable;
+import org.mozilla.javascript.ScriptableObject;
+import org.mozilla.javascript.xml.XMLObject;
+import org.mozilla.javascript.xmlimpl.XMLLibImpl;
+import org.w3c.dom.Node;
+
+/**
+ * Scriptable wrapper for the <code>ExtensionContext</code>. This
+ * is needed for a transparent transformation between org.w3c.dom.Node 
+ * and Rhino's XML implementation.
+ * 
+ * Currently only 
+ * <pre>Node readVariable(String)</pre> and <pre>void writeVariable(String, Node)</pre>
+ * are implemented. 
+ * 
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public class ExtensionContextWrapper extends ScriptableObject {
+	private static final long serialVersionUID = 1L;
+
+	private ExtensionContext _ectx;
+	private Context _sctx;
+	
+	public ExtensionContextWrapper() {
+		super();
+	}
+
+	public ExtensionContextWrapper(ExtensionContext ectx, Context sctx) {
+		super();
+		_ectx = ectx;
+		_sctx = sctx;
+	}
+	
+	public String getClassName() {
+		return "ExtensionContext";
+	}
+
+	public static Scriptable jsConstructor(Context cx, Object[] args,
+			Function ctorObj,
+			boolean inNewExpr)
+	{
+		if (args.length == 2 && (args[0] instanceof ExtensionContext) && (args[1] instanceof Context)) {
+			return new ExtensionContextWrapper((ExtensionContext)args[0], (Context)args[1]);
+		} else {
+			throw new IllegalArgumentException();
+		}
+	}
+	
+	public void jsFunction_writeVariable(String varName, XMLObject node) throws FaultException {
+		Node n = js2node(node);
+		_ectx.writeVariable(varName, n);
+	}
+
+	public XMLObject jsFunction_readVariable(String varName) throws FaultException, TransformerException {
+		Node n = _ectx.readVariable(varName);
+		return node2js(n);
+	}
+
+	private Node js2node(final XMLObject xml) {
+		return XMLLibImpl.toDomNode(xml);
+	}
+	
+	public XMLObject node2js(Node n) throws TransformerException {
+		Scriptable parentScope = getParentScope();
+		return (XMLObject) _sctx.newObject(parentScope, "XML", new Object[] {Context.javaToJS(domToString(n), parentScope)});
+	}
+	
+	public static String domToString(Node n) throws TransformerException {
+		TransformerFactory xformFactory	= TransformerFactory.newInstance();
+		Transformer idTransform = xformFactory.newTransformer();
+		idTransform.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+		Source input = new DOMSource(n);
+		StringWriter sw = new StringWriter();
+		Result output = new StreamResult(sw);
+		idTransform.transform(input, output);
+		return sw.toString();
+	}
+}

Added: ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/JSExtensionBundle.java
URL: http://svn.apache.org/viewvc/ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/JSExtensionBundle.java?rev=583602&view=auto
==============================================================================
--- ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/JSExtensionBundle.java (added)
+++ ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/JSExtensionBundle.java Wed Oct 10 13:17:15 2007
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.extension.e4x;
+
+import org.apache.ode.bpel.eapi.AbstractExtensionBundle;
+
+/**
+ * Implementation of a Javascript extension bundle.
+ * 
+ * It currently provides only one extension operation to be used either as 
+ * extensionActivity or as extensionAssignOperation.
+ * 
+ * @author Tammo van Lessen
+ */
+public class JSExtensionBundle extends AbstractExtensionBundle {
+	public static final String NS = "http://ode.apache.org/extensions/e4x";
+	public String getNamespaceURI() {
+		return NS;
+	}
+
+	public void registerExtensionActivities() {
+		registerExtensionOperation("snippet", JSExtensionOperation.class);
+	}
+
+}

Added: ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/JSExtensionOperation.java
URL: http://svn.apache.org/viewvc/ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/JSExtensionOperation.java?rev=583602&view=auto
==============================================================================
--- ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/JSExtensionOperation.java (added)
+++ ode/trunk/extensions/e4x/src/main/java/org/apache/ode/extension/e4x/JSExtensionOperation.java Wed Oct 10 13:17:15 2007
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.extension.e4x;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.eapi.ExtensionContext;
+import org.apache.ode.bpel.eapi.ExtensionOperation;
+import org.apache.ode.utils.SerializableElement;
+import org.mozilla.javascript.Context;
+import org.mozilla.javascript.ContextFactory;
+import org.mozilla.javascript.Scriptable;
+import org.mozilla.javascript.ScriptableObject;
+import org.mozilla.javascript.xml.XMLLib;
+import org.mozilla.javascript.xml.XMLLib.Factory;
+
+/**
+ * Implementation of a Javascript extension assign operation.
+ * 
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public class JSExtensionOperation implements ExtensionOperation {
+	
+	public void run(ExtensionContext context, SerializableElement element) throws FaultException {
+
+		ContextFactory contextFactory = new ContextFactory() {
+			//Enforce usage of plain DOM
+			protected Factory getE4xImplementationFactory() {
+				return XMLLib.Factory.create("org.mozilla.javascript.xmlimpl.XMLLibImpl");
+			}
+		};
+
+		ContextFactory.initGlobal(contextFactory);
+		Context ctx = Context.enter();
+		try {
+			Scriptable scope = ctx.initStandardObjects();
+			ScriptableObject.defineClass(scope, ExtensionContextWrapper.class);
+			Scriptable wrappedContext = ctx.newObject(scope, "ExtensionContext", new Object[] {context, ctx});
+			ScriptableObject.putProperty(scope, "context", wrappedContext);
+			String source = element.getElement().getTextContent();
+			ctx.evaluateString(scope, source, context.getActivityName(), 1, null);
+		} catch (Exception e) {
+			throw new FaultException(new QName("ExtensionEvaluationFault", JSExtensionBundle.NS), e.getMessage());
+		} finally {
+			Context.exit();
+		}
+	}
+}

Added: ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/JSBPELTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/JSBPELTest.java?rev=583602&view=auto
==============================================================================
--- ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/JSBPELTest.java (added)
+++ ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/JSBPELTest.java Wed Oct 10 13:17:15 2007
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.extension.e4x;
+
+import org.apache.ode.test.BPELTestAbstract;
+import org.junit.Test;
+
+/**
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public class JSBPELTest extends BPELTestAbstract {
+
+	@Test public void testE4XAssign() throws Throwable {
+        // Test E4X
+		registerExtensionBundle(new JSExtensionBundle());
+        go("/bpel/TestE4X");
+    }
+
+}

Added: ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/JSOperationTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/JSOperationTest.java?rev=583602&view=auto
==============================================================================
--- ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/JSOperationTest.java (added)
+++ ode/trunk/extensions/e4x/src/test/java/org/apache/ode/extension/e4x/JSOperationTest.java Wed Oct 10 13:17:15 2007
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.extension.e4x;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.eapi.ExtensionContext;
+import org.apache.ode.bpel.o.OActivity;
+import org.apache.ode.bpel.o.OLink;
+import org.apache.ode.bpel.o.OProcess.OProperty;
+import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.SerializableElement;
+import org.junit.Test;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public class JSOperationTest {
+
+	public static class MockExtensionContext implements ExtensionContext {
+		private Map<String, Node> variables = new HashMap<String, Node>();
+		
+		public Map<String, Node> getVariables() {
+			return variables;
+		}
+		
+		public Long getProcessId() {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		public Map<String, Variable> getVisibleVariables()
+				throws FaultException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		public boolean isLinkActive(OLink olink) throws FaultException {
+			// TODO Auto-generated method stub
+			return false;
+		}
+
+		public String readMessageProperty(Variable variable, OProperty property)
+				throws FaultException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		public Node readVariable(Variable variable) throws FaultException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		public Node readVariable(String variableName) throws FaultException {
+			System.out.println("Reading " + variableName);
+			return variables.get(variableName);
+		}
+
+		public void writeVariable(Variable variable, Node value)
+				throws FaultException {
+			// TODO Auto-generated method stub
+			
+		}
+
+		public void writeVariable(String variableName, Node value)
+				throws FaultException {
+			variables.put(variableName, value);
+			System.out.println("Storing in " + variableName + ": " + DOMUtils.domToString(value));
+		}
+
+		public String getActivityName() {
+			return "mockActivity";
+		}
+
+		public OActivity getOActivity() {
+			// TODO Auto-generated method stub
+			return null;
+		}
+	}
+	
+	@Test public void test() throws Exception {
+		StringBuffer s = new StringBuffer();
+		s.append("var request = context.readVariable('request');\n");
+		//s.append("var str = '' + request.TestPart.toString();\n");
+		//s.append("request.TestPart = str + ' World';\n");//
+		s.append("request.TestPart += ' World';\n");
+		s.append("context.writeVariable('request', request);\n");
+
+		MockExtensionContext c = new MockExtensionContext();
+		c.getVariables().put("request", DOMUtils.stringToDOM("<message><TestPart>Hello</TestPart></message>"));
+		JSExtensionOperation jso = new JSExtensionOperation();
+		Element e = DOMUtils.stringToDOM("<js:script xmlns:js=\"js\"><![CDATA[" + s + "]]></js:script>");
+		jso.run(c, new SerializableElement(e));
+	}
+}

Added: ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/TestE4X.bpel
URL: http://svn.apache.org/viewvc/ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/TestE4X.bpel?rev=583602&view=auto
==============================================================================
--- ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/TestE4X.bpel (added)
+++ ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/TestE4X.bpel Wed Oct 10 13:17:15 2007
@@ -0,0 +1,69 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<process name="TestE4X"
+         targetNamespace="http://ode/bpel/unit-testAssign1"
+         xmlns:ode="http://www.apache.org/ode/type/extension"
+         xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+         xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+         xmlns:tns="http://ode/bpel/unit-testAssign1"
+         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+         xmlns:test="http://ode/bpel/unit-testAssign1.wsdl"
+         queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+         expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+         xmlns:js="http://ode.apache.org/extensions/e4x">
+
+    <import location="TestE4X.wsdl"
+            namespace="http://ode/bpel/unit-testAssign1.wsdl"
+            importType="http://schemas.xmlsoap.org/wsdl/" />
+
+    <partnerLinks>
+        <partnerLink name="TestAssignPartnerLink" partnerLinkType="test:TestAssignPartnerLinkType" myRole="me" />
+    </partnerLinks>
+
+	<extensions>
+		<extension namespace="http://ode.apache.org/extensions/e4x" mustUnderstand="yes"/>
+	</extensions>
+	
+    <variables>
+        <variable name="myVar" messageType="test:TestAssignMessage"/>
+        <variable name="otherMsgVar" messageType="test:TestAssignMessage"/>
+        <variable name="strVar" type="xsd:string"/>
+        <variable name="intVar" type="xsd:int"/>
+        <variable name="intVar2" type="xsd:int"/>
+        <variable name="boolVar" type="xsd:boolean"/>
+    </variables>
+
+    <sequence>
+        <receive name="start" partnerLink="TestAssignPartnerLink" portType="test:TestAssignPortType"
+                 operation="testAssign" variable="myVar" createInstance="yes"/>
+
+        <assign name="assign1">
+			<extensionAssignOperation>
+				<js:snippet>
+				var request = context.readVariable('myVar');
+				request.TestPart += ' 1World';
+				context.writeVariable('otherMsgVar', request);
+				</js:snippet>
+			</extensionAssignOperation>
+        </assign>
+        <reply name="end" partnerLink="TestAssignPartnerLink" portType="test:TestAssignPortType"
+               operation="testAssign" variable="otherMsgVar"/>
+    </sequence>
+</process>

Added: ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/TestE4X.wsdl
URL: http://svn.apache.org/viewvc/ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/TestE4X.wsdl?rev=583602&view=auto
==============================================================================
--- ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/TestE4X.wsdl (added)
+++ ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/TestE4X.wsdl Wed Oct 10 13:17:15 2007
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<wsdl:definitions
+    targetNamespace="http://ode/bpel/unit-testAssign1.wsdl"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://ode/bpel/unit-testAssign1.wsdl"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+    <wsdl:message name="TestAssignMessage">
+        <wsdl:part name="TestPart" type="xsd:string"/>
+    </wsdl:message>
+
+    <wsdl:portType name="TestAssignPortType">
+        <wsdl:operation name="testAssign">
+            <wsdl:input message="tns:TestAssignMessage" name="TestIn"/>
+            <wsdl:output message="tns:TestAssignMessage" name="TestOut"/>
+        </wsdl:operation>
+    </wsdl:portType>
+
+     <wsdl:binding name="TestAssignSoapBinding" type="tns:TestAssignPortType">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="testAssign">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input>
+                <soap:body namespace="http://ode/bpel/unit-test.wsdl" use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body namespace="http://ode/bpel/unit-test.wsdl" use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="TestAssignService">
+		<wsdl:port name="TestAssignPort" binding="tns:TestAssignSoapBinding">
+     		<soap:address location="http://localhost:8080/ode/processes/TestAssign"/>
+		</wsdl:port>
+    </wsdl:service>
+
+   <plnk:partnerLinkType name="TestAssignPartnerLinkType">
+       <plnk:role name="me" portType="tns:TestAssignPortType"/>
+       <plnk:role name="you" portType="tns:TestAssignPortType"/>
+   </plnk:partnerLinkType>
+</wsdl:definitions>
+

Added: ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/deploy.xml
URL: http://svn.apache.org/viewvc/ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/deploy.xml?rev=583602&view=auto
==============================================================================
--- ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/deploy.xml (added)
+++ ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/deploy.xml Wed Oct 10 13:17:15 2007
@@ -0,0 +1,32 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+  xmlns:pns="http://ode/bpel/unit-testAssign1"
+  xmlns:wns="http://ode/bpel/unit-testAssign1.wsdl">
+
+
+	<process name="pns:TestE4X">
+		<active>true</active>
+		<provide partnerLink="TestAssignPartnerLink">
+			<service name="wns:TestAssignService" port="TestAssignPort"/>
+			<service name="wns:TestAssignService" port="TestAssignPort"/>
+		</provide>
+	</process>
+</deploy>

Added: ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/test.properties
URL: http://svn.apache.org/viewvc/ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/test.properties?rev=583602&view=auto
==============================================================================
--- ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/test.properties (added)
+++ ode/trunk/extensions/e4x/src/test/resources/bpel/TestE4X/test.properties Wed Oct 10 13:17:15 2007
@@ -0,0 +1,22 @@
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You under the Apache License, Version 2.0
+#    (the "License"); you may not use this file except in compliance with
+#    the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+namespace=http://ode/bpel/unit-testAssign1.wsdl
+service=TestAssignService
+operation=testAssign
+request1=<message><TestPart>Hello</TestPart></message>
+response1=.*Hello World.*
\ No newline at end of file