You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2008/09/10 21:07:05 UTC
svn commit: r693931 [7/12] - in /ode/trunk:
bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/
bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/xpath10/
bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/xpath20/
runtimes/...
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/InvalidContextException.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/InvalidContextException.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/InvalidContextException.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/InvalidContextException.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,49 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+/**
+ * Exception used by the runtime to indicate a problem with the execution context. This
+ * is for dealing with conditions where the runtime expects certain things of the context
+ * and the context does not oblige. These are what one might call "internal errors", for
+ * example if a message is received and it does not have the required parts, this execption
+ * is thrown, since the runtime expects received messages to be of the correct form.
+ *
+ * @author Maciej Szefler - m s z e f l e r @ g m a i l . c o m
+ *
+ */
+public class InvalidContextException extends RuntimeException {
+
+ public InvalidContextException() {
+ super();
+ }
+
+ public InvalidContextException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public InvalidContextException(String message) {
+ super(message);
+ }
+
+ public InvalidContextException(Throwable cause) {
+ super(cause);
+ }
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/KonstExpressionLanguageRuntimeImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/KonstExpressionLanguageRuntimeImpl.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/KonstExpressionLanguageRuntimeImpl.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/KonstExpressionLanguageRuntimeImpl.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,93 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.rtrep.common.ConfigurationException;
+import org.apache.ode.utils.xsd.Duration;
+import org.w3c.dom.Node;
+
+import java.util.Calendar;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * An implementation of the {@link org.apache.ode.bpel.explang.ExpressionLanguageRuntime} interface
+ * for constant expressions.
+ */
+public class KonstExpressionLanguageRuntimeImpl implements ExpressionLanguageRuntime {
+
+ public void initialize(Map properties) throws ConfigurationException {
+ }
+
+ public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException {
+ OConstantExpression konst = (OConstantExpression) cexp;
+ if (konst.getVal() instanceof String)
+ return (String) konst.getVal();
+ throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
+ }
+
+ public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException {
+ OConstantExpression konst = (OConstantExpression) cexp;
+ if (konst.getVal() instanceof Boolean)
+ return (Boolean) konst.getVal();
+ throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
+ }
+
+ public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException {
+ OConstantExpression konst = (OConstantExpression) cexp;
+ if (konst.getVal() instanceof Number)
+ return (Number)konst.getVal();
+ throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
+ }
+
+ public List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException {
+ OConstantExpression konst = (OConstantExpression) cexp;
+ if (konst.getVal() instanceof List)
+ return (List) konst.getVal();
+ throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
+ }
+
+ public Node evaluateNode(OExpression cexp, EvaluationContext context) throws FaultException {
+ OConstantExpression konst = (OConstantExpression) cexp;
+ if (konst.getVal() instanceof Node)
+ return (Node) konst.getVal();
+ throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
+ }
+
+ public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context) throws FaultException {
+ OConstantExpression konst = (OConstantExpression) cexp;
+
+ if (konst.getVal() instanceof Calendar)
+ return (Calendar) konst.getVal();
+
+ throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
+
+ }
+
+ public Duration evaluateAsDuration(OExpression cexp, EvaluationContext context) throws FaultException {
+
+ OConstantExpression konst = (OConstantExpression) cexp;
+
+ if (konst.getVal() instanceof Duration)
+ return (Duration) konst.getVal();
+
+ throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/LinkFrame.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/LinkFrame.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/LinkFrame.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/LinkFrame.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,48 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import org.apache.ode.bpel.rtrep.v1.OLink;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Link stack frame allowing resolution of {@link OLink} objects to the
+ * current {@link LinkInfo} in context.
+ */
+class LinkFrame implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ LinkFrame next;
+ Map<OLink, LinkInfo> links = new HashMap<OLink, LinkInfo>();
+
+ LinkFrame(LinkFrame next) {
+ this.next = next;
+ }
+
+ LinkInfo resolve(OLink link) {
+ LinkInfo li = links.get(link);
+ if (li == null && next != null)
+ return next.resolve(link);
+ return li;
+ }
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/LinkInfo.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/LinkInfo.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/LinkInfo.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/LinkInfo.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,47 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import org.apache.ode.bpel.rtrep.v1.OLink;
+import org.apache.ode.bpel.rtrep.v1.channels.LinkStatusChannel;
+
+import java.io.Serializable;
+
+/**
+ * Run-time represetation of the link data.
+ */
+class LinkInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ final OLink olink;
+
+ /** Channel to be used for link status publisher. */
+ final LinkStatusChannel pub;
+
+ /** Channel to be used for link status listener. */
+ final LinkStatusChannel sub;
+
+
+ LinkInfo(OLink olink, LinkStatusChannel pub, LinkStatusChannel sub) {
+ this.olink = olink;
+ this.pub = pub;
+ this.sub = sub;
+ }
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/Messages.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/Messages.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/Messages.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/Messages.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,93 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import org.apache.ode.utils.msg.MessageBundle;
+
+import java.util.Map;
+
+/**
+ * Message bundle for this package.
+ */
+public class Messages extends MessageBundle {
+
+ /**
+ * Format a message about being unable to compile an XPath expression.
+ *
+ * @param expr
+ * the expression in error
+ * @param lineNo
+ * the line number for the expression
+ * @param reason
+ * the reason that compilation failed.
+ *
+ * Unable to compile XPath expression {0} (line#{1}): {2}
+ */
+ public String msgUnableToCompileXPath(String expr, int lineNo, String reason) {
+ return this.format("Unable to compile XPath expression {0} (line#{1}): {2}", expr, lineNo,
+ reason);
+ }
+
+ /**
+ * Format a message about passing a non-static location path where one is
+ * expected.
+ *
+ * @param pathString
+ * the errant XPath expression
+ * @param lineNo
+ * the line number where the expression occurs
+ * @param type
+ * the type of the expression
+ *
+ * Non-static string values for location paths are not allowed; the expression
+ * {0} at line {1} evaluates to type {2}.
+ */
+ public String msgLocationMustBeString(String pathString, int lineNo, String type) {
+ return this.format("Non-static string values for location paths are not allowed;"
+ + "the expression {0} at line {1} evaluates to type {2}.", pathString, lineNo, type);
+ }
+
+ // TODO better message
+ public String msgPropertyAliasReturnedRValue(String alias, String variable) {
+ return this.format("msgPropertyAliasReturnedRValue: {0} {1}", alias, variable);
+ }
+
+ // TODO better message
+ public String msgPropertyAliasReturnedNonElement(String alias, String variable) {
+ return this.format("msgPropertyAliasReturnedNonElement: {0} {1}", alias, variable);
+ }
+
+ public String msgMessageExchangeFailureOnProcessCompletion() {
+ return "Process has been completed, pending message exchanges must be failed.";
+ }
+
+ public String msgUnknownEPR(String string) {
+ return format("Unknown EPR: {0}", string);
+ }
+
+ public String msgExpLangRegistrationError(String expressionLanguageUri, Map<String, String> properties) {
+ return format("Error registering expression language \"" + expressionLanguageUri + "\" with properties " + properties);
+ }
+
+ public String msgPropertyAliasReturnedNullSet(String alias, String variable) {
+ return this.format("msgPropertyAliasReturnedNullSet: {0} {1}", alias, variable);
+ }
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OActivity.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OActivity.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OActivity.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OActivity.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,80 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import org.apache.ode.utils.ObjectPrinter;
+
+import java.util.HashSet;
+import java.util.Set;
+
+
+/**
+ * Compiled represnetation of a BPEL activity.
+ */
+public abstract class OActivity extends OAgent {
+ static final long serialVersionUID = -1L ;
+
+ public OExpression joinCondition;
+ public boolean suppressJoinFailure;
+ public final Set<OLink>sourceLinks = new HashSet<OLink>();
+ public final Set<OLink>targetLinks = new HashSet<OLink>();
+ public String name;
+ public OFailureHandling failureHandling;
+ private OActivity parent;
+
+ public String getType() {
+ return getClass().getSimpleName();
+ }
+
+ public OActivity(OProcess owner, OActivity parent) {
+ super(owner);
+ this.parent = parent;
+ }
+
+ public OActivity getParent() {
+ return this.parent;
+ }
+
+ public OFailureHandling getFailureHandling() {
+ OFailureHandling handling = this.failureHandling;
+ if (handling == null) {
+ OActivity parent = this.parent;
+ while (parent != null && handling == null) {
+ handling = parent.failureHandling;
+ parent = parent.parent;
+ }
+ }
+ return handling;
+ }
+
+ public void setFailureHandling(OFailureHandling failureHandling) {
+ this.failureHandling = failureHandling;
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer(super.toString());
+ if (name != null) {
+ buf.append('-');
+ buf.append(name);
+ }
+
+ return buf.toString();
+ }
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OAgent.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OAgent.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OAgent.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OAgent.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,48 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Base class for active BPEL agents.
+ */
+public class OAgent extends OBase {
+ private static final long serialVersionUID = 6391205087340931483L;
+
+ /** Links entering this agent. */
+ public final Set<OLink> incomingLinks = new HashSet<OLink>();
+
+ /** Links exiting this agent. */
+ public final Set<OLink> outgoingLinks = new HashSet<OLink>();
+
+ /** Variables read from. */
+ public final Set<OScope.Variable> variableRd = new HashSet<OScope.Variable>();
+
+ /** Variables written to. */
+ public final Set<OScope.Variable> variableWr = new HashSet<OScope.Variable>();
+
+ /** The children of this agent. */
+ public final Set<OAgent> nested = new HashSet<OAgent>();
+
+ public OAgent(OProcess owner) {
+ super(owner);
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OAssign.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OAssign.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OAssign.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OAssign.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,249 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import org.apache.ode.bpel.rtrep.v1.OScope.Variable;
+import org.apache.ode.utils.DOMUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.namespace.QName;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class OAssign extends OActivity {
+ static final long serialVersionUID = -1L ;
+
+ public final List<Copy> copy = new ArrayList<Copy>();
+
+ public OAssign(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+
+
+ public String toString() {
+ return "{OAssign : " + name + ", joinCondition=" + joinCondition + "}";
+ }
+
+ /**
+ * Assignmenet copy entry, i.e. what the assignment consits of.
+ */
+ public static class Copy extends OBase {
+ private static final long serialVersionUID = 1L;
+ public LValue to;
+ public RValue from;
+ public boolean keepSrcElementName;
+ public boolean ignoreMissingFromData;
+ public boolean ignoreUninitializedFromVariable;
+
+ public Copy(OProcess owner) {
+ super(owner);
+ }
+
+ public String toString() {
+ return "{OCopy " + to + "=" + from + "}";
+ }
+ }
+
+ public interface LValue {
+ OScope.Variable getVariable();
+ }
+
+ public interface RValue { }
+
+ public static class Literal extends OBase implements RValue {
+ private static final long serialVersionUID = 1L;
+ public transient Document xmlLiteral;
+
+ public Literal(OProcess owner, Document xmlLiteral) {
+ super(owner);
+ if (xmlLiteral == null)
+ throw new IllegalArgumentException("null xmlLiteral!");
+ this.xmlLiteral = xmlLiteral;
+ }
+
+ public String toString() {
+ return "{Literal " + DOMUtils.domToString(xmlLiteral) + "}";
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out)
+ throws IOException
+ {
+ out.writeObject(DOMUtils.domToString(xmlLiteral));
+ }
+
+ private void readObject(java.io.ObjectInputStream in)
+ throws IOException
+ {
+ String domStr = null;
+ try {
+ domStr = (String) in.readObject();
+ } catch (ClassNotFoundException e) {
+ throw (IOException)(new IOException("XML de-serialization error.")).initCause(e);
+ }
+ try {
+ xmlLiteral = DOMUtils.stringToDOM(domStr).getOwnerDocument();
+ } catch (Exception ex) {
+ throw (IOException)(new IOException("XML de-serialization error.")).initCause(ex);
+ }
+ }
+
+ public Document getXmlLiteral() {
+ Element literalRoot = xmlLiteral.getDocumentElement();
+ Document copyDoc = DOMUtils.newDocument();
+ Node copyElmt = copyDoc.importNode(literalRoot, true);
+ copyDoc.appendChild(copyElmt);
+ return copyDoc;
+ }
+ }
+
+ public static class LValueExpression extends OBase implements LValue {
+ private static final long serialVersionUID = 1L;
+ public OLValueExpression expression;
+
+ public LValueExpression(OProcess owner, OLValueExpression compiledExpression) {
+ super(owner);
+ this.expression = compiledExpression;
+ }
+
+ public String toString() {
+ return expression.toString();
+ }
+ /**
+ * @see org.apache.ode.bpel.rtrep.v1.OAssign.LValue#getVariable()
+ */
+ public Variable getVariable() {
+ return expression.getVariable();
+ }
+
+ }
+ public static class Expression extends OBase implements RValue {
+ private static final long serialVersionUID = 1L;
+ public OExpression expression;
+
+ public Expression(OProcess owner, OExpression compiledExpression) {
+ super(owner);
+ this.expression = compiledExpression;
+ }
+
+ public String toString() {
+ return expression.toString();
+ }
+ }
+
+
+ /**
+ * Direct reference: selects named child of the message document element.
+ * This is used for access to extensions (SOAP headers for example).
+ * @author mszefler
+ */
+ public static class DirectRef extends OBase implements RValue, LValue {
+ private static final long serialVersionUID = 1L;
+ public DirectRef(OProcess owner) {
+ super(owner);
+ }
+
+ /** Referenced Variable */
+ public OScope.Variable variable;
+
+ /** Name of the element referenced. */
+ public QName elName;
+
+ public Variable getVariable() {
+ return variable;
+ }
+ }
+
+ public static class VariableRef extends OBase implements RValue, LValue {
+ private static final long serialVersionUID = 1L;
+ public OScope.Variable variable;
+ public OMessageVarType.Part part;
+ public OMessageVarType.Part headerPart;
+ public OExpression location;
+
+ public VariableRef(OProcess owner) {
+ super(owner);
+ }
+
+ public OScope.Variable getVariable() {
+ return variable;
+ }
+
+ /**
+ * Report whether this is a reference to a whole "message"
+ * @return <code>true</code> if whole-message reference
+ */
+ public boolean isMessageRef() {
+ return variable.type instanceof OMessageVarType && part == null && headerPart == null && location == null;
+ }
+
+ /**
+ * Report whether this is a reference to a message part.
+ * @return <code>true</code> if reference to a message part
+ */
+ public boolean isPartRef() {
+ return variable.type instanceof OMessageVarType && part != null && location == null;
+ }
+
+ public boolean isHeaderRef() {
+ return variable.type instanceof OMessageVarType && headerPart != null && location == null;
+ }
+
+ public String toString() {
+ return "{VarRef " + variable +
+ (part==null ? "" : "." + part.name) +
+ (location == null ? "" : location.toString())+ "}";
+ }
+ }
+
+ public static class PropertyRef extends OBase implements RValue, LValue {
+ private static final long serialVersionUID = 1L;
+ public OScope.Variable variable;
+ public OProcess.OPropertyAlias propertyAlias;
+
+ public PropertyRef(OProcess owner) { super(owner); }
+
+ public OScope.Variable getVariable() {
+ return variable;
+ }
+
+ public String toString() {
+ return "{PropRef " + variable + "!" + propertyAlias+ "}";
+ }
+ }
+
+ public static class PartnerLinkRef extends OBase implements RValue, LValue {
+ private static final long serialVersionUID = 1L;
+ public OPartnerLink partnerLink;
+ public boolean isMyEndpointReference;
+
+ public PartnerLinkRef(OProcess owner) { super(owner); }
+
+ // Must fit in a LValue even if it's not variable based
+ public Variable getVariable() {
+ return null;
+ }
+
+ public String toString() {
+ return "{PLinkRef " + partnerLink + "!" + isMyEndpointReference + "}";
+ }
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OBase.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OBase.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OBase.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OBase.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,82 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import org.apache.ode.bpel.rapi.ActivityModel;
+
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+import java.util.HashMap;
+
+
+/**
+ * Base class for compiled BPEL objects.
+ */
+public class OBase implements Serializable, ActivityModel {
+
+ static final long serialVersionUID = -1L ;
+
+ /** Our identifier, in terms of our parent. */
+ private final int _id;
+ private final OProcess _owner;
+
+ public DebugInfo debugInfo;
+
+ protected OBase(OProcess owner) {
+ _owner = owner;
+ if (owner == null) {
+ _id = 0;
+ } else {
+ _id = ++_owner._childIdCounter;
+ _owner._children.add(this);
+ }
+ assert _id == 0 || _owner != null;
+ }
+
+ public OProcess getOwner() {
+ return (OProcess) (_owner == null ? this : _owner);
+ }
+
+ public int hashCode() {
+ return _id;
+ }
+
+ public boolean equals(Object obj) {
+ if(!(obj instanceof OBase))
+ return false;
+
+ OBase other = (OBase) obj;
+ return (_id == 0 && other._id == 0) || _id == other._id && other._owner.equals(_owner);
+ }
+
+ public int getId() {
+ return _id;
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer(getClass().getSimpleName());
+ buf.append('#');
+ buf.append(_id);
+ return buf.toString();
+ }
+
+ public HashMap<QName, Object> getExtensibilityElements() {
+ return null;
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCatch.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCatch.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCatch.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCatch.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,38 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import javax.xml.namespace.QName;
+
+/**
+ * The catch pseudo-activity.
+ */
+public final class OCatch extends OScope {
+ static final long serialVersionUID = -1L ;
+ public QName faultName;
+ public OScope.Variable faultVariable;
+
+ public OCatch(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+
+ public String toString() {
+ return "{OCatch faultName=" + faultName + ", faultVariable=" + faultVariable + "}";
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCompensate.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCompensate.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCompensate.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCompensate.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,33 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+/**
+ * Compiled representation of the BPEL <code><compensate></code> activity.
+ */
+public class OCompensate extends OActivity {
+ static final long serialVersionUID = -1L ;
+
+ /** The scope that is compensated by this activity. */
+ public OScope compensatedScope;
+
+ public OCompensate(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCompensationHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCompensationHandler.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCompensationHandler.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OCompensationHandler.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,27 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+public class OCompensationHandler extends OScope {
+ private static final long serialVersionUID = -9208360082697192920L;
+
+ public OCompensationHandler(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstantExpression.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstantExpression.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstantExpression.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstantExpression.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,45 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+public class OConstantExpression extends OExpression {
+ static final long serialVersionUID = -1L ;
+
+ private Object _val;
+
+ public OConstantExpression(OProcess owner, Object val) {
+ super(owner);
+ setVal(val);
+ }
+
+ public Object getVal() {
+ return _val;
+ }
+
+ public void setVal(Object val) {
+ if (val == null)
+ throw new IllegalArgumentException("OConstatExpression cannot be null.");
+
+ this._val = val;
+ }
+
+ public String toString() {
+ return "{OConstantExpression " + _val + "}";
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstantVarType.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstantVarType.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstantVarType.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstantVarType.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,51 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import org.apache.ode.utils.DOMUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * @author Matthieu Riou <mriou at apache dot org>
+ */
+public class OConstantVarType extends OVarType {
+ private String value;
+ private transient Node nodeValue;
+
+ public OConstantVarType(OProcess owner, Node value) {
+ super(owner);
+ this.value = DOMUtils.domToString(value);
+ }
+
+ public Node newInstance(Document doc) {
+ return getValue();
+ }
+
+ public Node getValue() {
+ if (nodeValue == null)
+ try {
+ nodeValue = DOMUtils.stringToDOM(value);
+ } catch (Exception e) {
+ // Highly unexpected
+ throw new RuntimeException(e);
+ }
+ return nodeValue;
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstants.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstants.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstants.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstants.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,51 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Compiled BPEL constants. Mostly the qualified names of the standard
+ * faults.
+ */
+public class OConstants extends OBase {
+
+ private static final long serialVersionUID = 1L;
+ public QName qnMissingRequest;
+ public QName qnMissingReply;
+ public QName qnUninitializedVariable;
+ public QName qnConflictingReceive;
+ public QName qnSelectionFailure;
+ public QName qnMismatchedAssignmentFailure;
+ public QName qnJoinFailure;
+ public QName qnForcedTermination;
+ public QName qnCorrelationViolation;
+ public QName qnXsltInvalidSource;
+ public QName qnSubLanguageExecutionFault;
+ public QName qnUninitializedPartnerRole;
+ public QName qnForEachCounterError;
+ public QName qnInvalidBranchCondition;
+ public QName qnInvalidExpressionValue;
+
+
+ public OConstants(OProcess owner) {
+ super(owner);
+ }
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OElementVarType.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OElementVarType.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OElementVarType.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OElementVarType.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,42 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class OElementVarType extends OVarType {
+ private static final long serialVersionUID = 1L;
+
+ public QName elementType;
+
+ public OElementVarType(OProcess owner, QName typeName) {
+ super(owner);
+ elementType = typeName;
+ }
+
+ public Node newInstance(Document doc) {
+ Element el = doc.createElementNS(elementType.getNamespaceURI(),
+ elementType.getLocalPart());
+ return el;
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OEmpty.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OEmpty.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OEmpty.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OEmpty.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,28 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+public class OEmpty extends OActivity {
+
+ static final long serialVersionUID = -1L ;
+
+ public OEmpty(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OEventHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OEventHandler.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OEventHandler.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OEventHandler.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,77 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.wsdl.Operation;
+
+
+/**
+ * Compiled represenation of a BPEL event handler.
+ */
+public class OEventHandler extends OAgent {
+ static final long serialVersionUID = -1L ;
+ public List<OEvent> onMessages = new ArrayList<OEvent>();
+ public List<OAlarm> onAlarms = new ArrayList<OAlarm>();
+
+ public OEventHandler(OProcess owner) {
+ super(owner);
+ }
+
+ public static class OAlarm extends OAgent {
+ static final long serialVersionUID = -1L ;
+
+ public OExpression forExpr;
+ public OExpression untilExpr;
+ public OExpression repeatExpr;
+ public OActivity activity;
+
+ public OAlarm(OProcess owner){
+ super(owner);
+ }
+ }
+
+ public static class OEvent extends OScope {
+ static final long serialVersionUID = -1L ;
+
+ /** Correlations to initialize. */
+ public final List <OScope.CorrelationSet> initCorrelations = new ArrayList<OScope.CorrelationSet>();
+
+ /** Correlation set to match on. */
+ public OScope.CorrelationSet matchCorrelation;
+
+ public OPartnerLink partnerLink;
+ public Operation operation;
+ public OScope.Variable variable;
+
+ /** OASIS addition for disambiguating receives (optional). */
+ public String messageExchangeId = "";
+
+
+ public String getCorrelatorId() {
+ return partnerLink.getId() + "." + operation.getName();
+ }
+
+ public OEvent(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExpression.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExpression.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExpression.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExpression.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,39 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+/**
+ * Base class for compiled expressions. The exact form of a compiled expression is
+ * dependent on the compiler implementation.
+ */
+public abstract class OExpression extends OBase {
+ static final long serialVersionUID = -1L ;
+
+ public OExpressionLanguage expressionLanguage;
+
+ public OExpression(OProcess owner) {
+ super(owner);
+ }
+
+ /** Get the expression language used to generate this expression. */
+ public OExpressionLanguage getExpressionLanguage() {
+ return expressionLanguage;
+ }
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExpressionLanguage.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExpressionLanguage.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExpressionLanguage.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExpressionLanguage.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,46 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Compiled representation of an expression language dependency.
+ */
+public class OExpressionLanguage extends OBase {
+ private static final long serialVersionUID = 1L;
+ public String expressionLanguageUri;
+ public final Map<String,String> properties = new HashMap<String,String>();
+
+ public OExpressionLanguage(OProcess owner, Map<String,String> properties) {
+ super(owner);
+ if (properties != null)
+ this.properties.putAll(properties);
+ }
+
+ public boolean equals(Object obj) {
+ if (obj instanceof OExpressionLanguage) return ((OExpressionLanguage)obj).expressionLanguageUri.equals(expressionLanguageUri);
+ else return super.equals(obj);
+ }
+
+ public int hashCode() {
+ return expressionLanguageUri.hashCode();
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExtVar.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExtVar.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExtVar.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OExtVar.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,43 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+
+/**
+ * Compiled representation of an external variable declaration.
+ *
+ * @author Maciej Szefler <mszefler at gmail dot com>
+ *
+ */
+public class OExtVar extends OBase {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Unique identifier for the external variable. Will be referenced in the deployment descriptor.
+ */
+ public String externalVariableId;
+
+ /** Related variable containing the identifying information. */
+ public OScope.Variable related;
+
+ public OExtVar(OProcess owner) {
+ super(owner);
+ }
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFailureHandling.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFailureHandling.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFailureHandling.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFailureHandling.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,44 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * Holds information about the failure handling of this activity.
+ */
+public class OFailureHandling implements Serializable {
+ private static final long serialVersionUID = 5637366976949702880L;
+
+ public static final String EXTENSION_NS_URI = "http://ode.apache.org/activityRecovery";
+ public static final QName FAILURE_FAULT_NAME = new QName(EXTENSION_NS_URI, "activityFailure");
+ public static final QName FAILURE_EXT_ELEMENT = new QName(EXTENSION_NS_URI, "failureHandling");
+
+ // Number of times to retry the activity if failure occurs.
+ // Defaults to zero.
+ public int retryFor;
+
+ // Time delay between retries of the activity, in seconds.
+ public int retryDelay;
+
+ // If true, fault when failure occurs, otherwise, enter activity recovery state.
+ public boolean faultOnFailure;
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFaultHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFaultHandler.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFaultHandler.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFaultHandler.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,42 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+
+/**
+ * Compiled representation of a BPEL fault handler.
+ */
+public class OFaultHandler extends OBase {
+
+ static final long serialVersionUID = -1L ;
+
+ public final List<OCatch> catchBlocks = new ArrayList<OCatch>();
+
+ public OFaultHandler(OProcess owner) {
+ super(owner);
+ }
+
+ public Collection<OLink> outgoinglinks() {
+ throw new UnsupportedOperationException(); // TODO: implement me!
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFlow.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFlow.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFlow.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OFlow.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,50 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import org.apache.ode.utils.stl.CollectionsX;
+import org.apache.ode.utils.stl.MemberOfFunction;
+
+import java.util.HashSet;
+import java.util.Set;
+
+
+/**
+ */
+public class OFlow extends OActivity {
+ static final long serialVersionUID = -1L ;
+
+ /** Links delcared within this activity. */
+ public final Set<OLink> localLinks = new HashSet<OLink>();
+
+ public final Set<OActivity> parallelActivities = new HashSet<OActivity>();
+
+ public OFlow(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+
+ public OLink getLocalLink(final String linkName) {
+ return CollectionsX.find_if(localLinks, new MemberOfFunction<OLink>() {
+ public boolean isMember(OLink o) {
+ return o.name.equals(linkName);
+ }
+ });
+ }
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OForEach.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OForEach.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OForEach.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OForEach.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,59 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+/**
+ * Base model class for forEach activity.
+ */
+public class OForEach extends OActivity {
+ static final long serialVersionUID = -1L;
+
+ public OScope.Variable counterVariable;
+ public boolean parallel;
+ public OExpression startCounterValue;
+ public OExpression finalCounterValue;
+ public CompletionCondition completionCondition;
+
+ public OScope innerScope;
+
+ public OForEach(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+
+ public String toString() {
+ return "+{OForEach : " + name +
+ ", counterName=" + counterVariable.name +
+ ", parallel=" + parallel +
+ ", startCounterValue=" + startCounterValue +
+ ", finalCounterValue=" + finalCounterValue +
+ ", completionCondition=" + (completionCondition == null ? "" : completionCondition.branchCount) + "}";
+ }
+
+ public static class CompletionCondition extends OBase {
+ static final long serialVersionUID = -1L;
+
+ public boolean successfulBranchesOnly;
+ public OExpression branchCount;
+
+ public CompletionCondition(OProcess owner) {
+ super(owner);
+ }
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OInvoke.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OInvoke.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OInvoke.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OInvoke.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,52 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.wsdl.Operation;
+
+/**
+ * Compiled rerpresentation of the BPEL <code><invoke></code> activity.
+ */
+public class OInvoke extends OActivity {
+
+ static final long serialVersionUID = -1L ;
+ public OPartnerLink partnerLink;
+ public OScope.Variable inputVar;
+ public OScope.Variable outputVar;
+ public Operation operation;
+
+ /** Correlation sets initialized on the input message. */
+ public final List<OScope.CorrelationSet> initCorrelationsInput = new ArrayList<OScope.CorrelationSet>();
+
+ /** Correlation sets initialized on the input message. */
+ public final List <OScope.CorrelationSet> initCorrelationsOutput = new ArrayList<OScope.CorrelationSet>();
+
+ /** Correlation sets asserted on input. */
+ public final List <OScope.CorrelationSet> assertCorrelationsInput = new ArrayList<OScope.CorrelationSet>();
+
+ /** Correlation sets asserted on output. */
+ public final List<OScope.CorrelationSet> assertCorrelationsOutput = new ArrayList<OScope.CorrelationSet>();
+
+ public OInvoke(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OLValueExpression.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OLValueExpression.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OLValueExpression.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OLValueExpression.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,34 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+public abstract class OLValueExpression extends OExpression {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * @param owner
+ */
+ public OLValueExpression(OProcess owner) {
+ super(owner);
+ }
+
+ public abstract OScope.Variable getVariable();
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OLink.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OLink.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OLink.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OLink.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,45 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+/**
+ * Compiled representation of a BPEL control link.
+ */
+public class OLink extends OBase {
+ static final long serialVersionUID = -1L ;
+
+ /** The flow in which the link is declared. */
+ public OFlow declaringFlow;
+
+ /** The name of the link. */
+ public String name;
+
+ /** The link's transition condition. */
+ public OExpression transitionCondition;
+
+ /** The source activity. */
+ public OActivity source;
+
+ /** The target activity. */
+ public OActivity target;
+
+ public OLink(OProcess owner) {
+ super(owner);
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OMessageVarType.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OMessageVarType.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OMessageVarType.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OMessageVarType.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,85 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Message variable type.
+ */
+public class OMessageVarType extends OVarType {
+ private static final long serialVersionUID = 256680050844726425L;
+
+ public QName messageType;
+ public final Map<String, Part> parts = new LinkedHashMap<String,Part>();
+
+ /** For doc-lit-like message types , the element type of the only part. */
+ public final OElementVarType docLitType;
+
+ public OMessageVarType(OProcess owner, QName messageType, Collection<Part> parts) {
+ super(owner);
+ this.messageType = messageType;
+ for (Iterator<Part> i = parts.iterator(); i.hasNext();) {
+ Part part = i.next();
+ this.parts.put(part.name,part);
+ }
+
+ if ((parts.size() == 1 && parts.iterator().next().type instanceof OElementVarType))
+ docLitType = (OElementVarType) parts.iterator().next().type;
+ else
+ docLitType = null;
+ }
+
+ boolean isDocLit() { return docLitType != null; }
+
+
+ public Node newInstance(Document doc) {
+ Element el = doc.createElementNS(null, "message");
+ for(OMessageVarType.Part part : parts.values()){
+ Element partElement = doc.createElementNS(null, part.name);
+ partElement.appendChild(part.type.newInstance(doc));
+ el.appendChild(partElement);
+ }
+ return el;
+ }
+
+ public static class Part extends OBase {
+ private static final long serialVersionUID = -2356665271228433779L;
+
+ public String name;
+ public OVarType type;
+
+ public Part(OProcess owner, String partName, OVarType partType) {
+ super(owner);
+ this.name = partName;
+ this.type = partType;
+ }
+
+ }
+
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPartnerLink.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPartnerLink.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPartnerLink.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPartnerLink.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,154 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import org.apache.ode.bpel.rapi.PartnerLinkModel;
+import org.apache.ode.bpel.rapi.CorrelationSetModel;
+
+import javax.wsdl.Operation;
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Compiled representation of a BPEL partnerLink.
+ */
+public class OPartnerLink extends OBase implements PartnerLinkModel {
+ static final long serialVersionUID = -1L ;
+ /** partnerLink name. */
+ public String name;
+
+ /** Scope in which this partnerLink is declared. */
+ public OScope declaringScope;
+
+ /** The type of this partnerLink. */
+ public QName partnerLinkType;
+
+ public String partnerRoleName;
+
+ public String myRoleName;
+
+ public PortType myRolePortType;
+
+ public PortType partnerRolePortType;
+
+ public boolean initializePartnerRole;
+
+ /** The set of CorrelationSets that may be used as a match criteria, organized by {@link Operation} */
+ private final HashMap<String,Set<OScope.CorrelationSet>> _nonIntitiatingCorrelationSets = new HashMap<String,Set<OScope.CorrelationSet>>();
+
+ /** The set of {@link Operation}s that can be used to create a process instance. */
+ private final HashSet<String> _createInstanceOperations = new HashSet<String>();
+
+ public OPartnerLink(OProcess owner) {
+ super(owner);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public boolean hasMyRole() {
+ return myRolePortType != null;
+ }
+
+ public boolean hasPartnerRole() {
+ return partnerRolePortType != null;
+ }
+
+ public boolean isCreateInstanceOperation(Operation op) {
+ return _createInstanceOperations.contains(op.getName());
+ }
+
+ public void addCreateInstanceOperation(Operation operation) {
+ _createInstanceOperations.add(operation.getName());
+ }
+
+ /**
+ * Add a {@link org.apache.ode.bpel.rtrep.v1.OScope.CorrelationSet} to an {@link Operation}'s list
+ * of "non-initiating" correlation sets. The non-initiating correlation sets are those
+ * sets that are used (along with the operation) to "match" incoming messages.
+ * We need to know which correlation sets are used with which operation in order to
+ * pre-compute correlation keys at the time of message receipt.
+ * @param operation WSDL {@link Operation}
+ * @param cset non-initiating correlation used in this operation
+ */
+ public void addCorrelationSetForOperation(Operation operation, OScope.CorrelationSet cset) {
+ Set<OScope.CorrelationSet> ret = _nonIntitiatingCorrelationSets.get(operation.getName());
+ if (ret == null) {
+ ret = new HashSet<OScope.CorrelationSet>();
+ _nonIntitiatingCorrelationSets.put(operation.getName(), ret);
+ }
+ ret.add(cset);
+
+ }
+
+ /**
+ * Get all non-initiating correlation sets that are ever used to qualify a receive for a the given
+ * operation.
+ * @param operation the operation
+ * @return all non-initiating correlation sets used in the given operation
+ */
+ @SuppressWarnings("unchecked")
+ public Set<CorrelationSetModel> getCorrelationSetsForOperation(Operation operation) {
+ Set<OScope.CorrelationSet> ret = _nonIntitiatingCorrelationSets.get(operation.getName());
+ if (ret == null) return Collections.EMPTY_SET;
+ return Collections.unmodifiableSet(new HashSet(ret));
+ }
+
+ @SuppressWarnings("unchecked")
+ public Operation getMyRoleOperation(String name) {
+ for (Operation op : (List<Operation>)myRolePortType.getOperations())
+ if (op.getName().equals(name))
+ return op;
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Operation getPartnerRoleOperation(String name) {
+ for (Operation op : (List<Operation>)partnerRolePortType.getOperations())
+ if (op.getName().equals(name))
+ return op;
+ return null;
+ }
+
+ public String getMyRoleName() {
+ return myRoleName;
+ }
+
+ public String getPartnerRoleName() {
+ return partnerRoleName;
+ }
+
+ public boolean isInitializePartnerRoleSet() {
+ return initializePartnerRole;
+ }
+
+ public PortType getMyRolePortType() {
+ return myRolePortType;
+ }
+
+ public PortType getPartnerRolePortType() {
+ return partnerRolePortType;
+ }
+}
Added: ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPickReceive.java
URL: http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPickReceive.java?rev=693931&view=auto
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPickReceive.java (added)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPickReceive.java Wed Sep 10 12:06:59 2008
@@ -0,0 +1,81 @@
+/*
+ * 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.bpel.rtrep.v1;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.wsdl.Operation;
+
+
+/**
+ * Compiled rerperesentation of the BPEL <code><pick></code> and
+ * <codE><receive></code> activities. Because the latter is essentially
+ * a simplified version of the former, at run-time we do not distinguish
+ * between the two.
+ */
+public class OPickReceive extends OActivity{
+ static final long serialVersionUID = -1L ;
+ public final List<OnMessage> onMessages = new ArrayList<OnMessage>();
+ public final List<OnAlarm> onAlarms = new ArrayList<OnAlarm>();
+
+ public boolean createInstanceFlag;
+
+ public OPickReceive(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+
+ public static class OnAlarm extends OBase {
+ static final long serialVersionUID = -1L ;
+ public OActivity activity;
+ public OExpression forExpr;
+ public OExpression untilExpr;
+
+ public OnAlarm(OProcess owner) {
+ super(owner);
+ }
+ }
+
+ public static class OnMessage extends OBase {
+
+ static final long serialVersionUID = -1L ;
+
+ /** Correlations to initialize. */
+ public final List <OScope.CorrelationSet> initCorrelations = new ArrayList<OScope.CorrelationSet>();
+
+ /** Correlation set to match on. */
+ public OScope.CorrelationSet matchCorrelation;
+
+ public OPartnerLink partnerLink;
+ public Operation operation;
+ public OScope.Variable variable;
+ public OActivity activity;
+
+ /** OASIS addition for disambiguating receives (optional). */
+ public String messageExchangeId = "";
+
+ public OnMessage(OProcess owner) {
+ super(owner);
+ }
+
+ public String getCorrelatorId() {
+ return partnerLink.getId() + "." + operation.getName();
+ }
+ }
+}