You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ms...@apache.org on 2006/10/24 06:43:18 UTC
svn commit: r467239 [3/7] - in /incubator/ode/trunk: ./ axis2-examples/
axis2-war/ axis2/ axis2/src/main/java/org/apache/ode/axis2/ bpel-api-jca/
bpel-api/ bpel-api/src/main/java/org/apache/ode/bpel/capi/
bpel-api/src/main/java/org/apache/ode/bpel/xsl/...
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGeneratorMessages.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGeneratorMessages.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGeneratorMessages.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGeneratorMessages.java Mon Oct 23 21:43:09 2006
@@ -19,8 +19,8 @@
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bpel.capi.CompilationMessage;
-import org.apache.ode.bpel.capi.CompilationMessageBundle;
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
public class PickGeneratorMessages extends CompilationMessageBundle {
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java Mon Oct 23 21:43:09 2006
@@ -18,9 +18,9 @@
*/
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.api.Activity;
-import org.apache.ode.bom.api.Correlation;
-import org.apache.ode.bpel.capi.CompilationException;
+import org.apache.ode.bpel.compiler.api.CompilationException;
+import org.apache.ode.bpel.compiler.bom.Activity;
+import org.apache.ode.bpel.compiler.bom.Correlation;
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.OPickReceive;
import org.apache.ode.bpel.o.OProcess;
@@ -84,7 +84,8 @@
OScope.CorrelationSet cset = _context.resolveCorrelationSet(correlation.getCorrelationSet());
switch (correlation.getInitiate()) {
- case Correlation.INITIATE_NO:
+ case UNSET:
+ case NO:
if (createInstance)
throw new CompilationException(__cmsgsGeneral.errUseOfUninitializedCorrelationSet(correlation
.getCorrelationSet()));
@@ -94,11 +95,11 @@
onMessage.matchCorrelation = cset;
onMessage.partnerLink.addCorrelationSetForOperation(onMessage.operation, cset);
break;
- case Correlation.INITIATE_YES:
+ case YES:
onMessage.initCorrelations.add(cset);
onMessage.partnerLink.addCorrelationSetForOperation(onMessage.operation, cset);
break;
- case Correlation.INITIATE_RENDEZVOUS:
+ case JOIN:
if (createInstance) {
onMessage.partnerLink.addCorrelationSetForOperation(onMessage.operation, cset);
onMessage.initCorrelations.add(cset);
@@ -109,6 +110,8 @@
}
break;
+ default:
+ throw new AssertionError("Unexpected value for correlation set enumeration!");
}
for (OProcess.OProperty property : cset.properties) {
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReceiveGenerator.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReceiveGenerator.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReceiveGenerator.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReceiveGenerator.java Mon Oct 23 21:43:09 2006
@@ -18,8 +18,8 @@
*/
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.api.Activity;
-import org.apache.ode.bom.api.ReceiveActivity;
+import org.apache.ode.bpel.compiler.bom.Activity;
+import org.apache.ode.bpel.compiler.bom.ReceiveActivity;
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.OEmpty;
import org.apache.ode.bpel.o.OPickReceive;
@@ -30,14 +30,14 @@
OPickReceive opick = (OPickReceive) output;
ReceiveActivity rcvDef = (ReceiveActivity) src;
- opick.createInstanceFlag = rcvDef.getCreateInstance();
+ opick.createInstanceFlag = rcvDef.isCreateInstance();
OPickReceive.OnMessage onMessage = compileOnMessage(
rcvDef.getVariable(),
rcvDef.getPartnerLink(),
rcvDef.getOperation(),
rcvDef.getMessageExchangeId(),
rcvDef.getPortType(),
- rcvDef.getCreateInstance(),
+ rcvDef.isCreateInstance(),
rcvDef.getCorrelations());
onMessage.activity = new OEmpty(_context.getOProcess(), opick);
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java Mon Oct 23 21:43:09 2006
@@ -18,9 +18,9 @@
*/
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.api.Activity;
-import org.apache.ode.bom.api.Correlation;
-import org.apache.ode.bpel.capi.CompilationException;
+import org.apache.ode.bpel.compiler.bom.Activity;
+import org.apache.ode.bpel.compiler.bom.Correlation;
+import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.o.*;
import org.apache.ode.utils.msg.MessageBundle;
@@ -32,74 +32,74 @@
*/
class ReplyGenerator extends DefaultActivityGenerator {
- private static final CommonCompilationMessages _cmsgsGeneral =
- MessageBundle.getMessages(CommonCompilationMessages.class);
+ private static final CommonCompilationMessages _cmsgsGeneral =
+ MessageBundle.getMessages(CommonCompilationMessages.class);
- private static final ReplyGeneratorMessages __cmsgsLocal =
- MessageBundle.getMessages(ReplyGeneratorMessages.class);
+ private static final ReplyGeneratorMessages __cmsgsLocal =
+ MessageBundle.getMessages(ReplyGeneratorMessages.class);
- public OActivity newInstance(Activity src) {
+ public OActivity newInstance(Activity src) {
return new OReply(_context.getOProcess(), _context.getCurrent());
+ }
+
+ public void compile(OActivity output, Activity src) {
+ org.apache.ode.bpel.compiler.bom.ReplyActivity replyDef = (org.apache.ode.bpel.compiler.bom.ReplyActivity) src;
+ OReply oreply = (OReply) output;
+
+ oreply.isFaultReply = replyDef.getFaultName() != null;
+ oreply.partnerLink = _context.resolvePartnerLink(replyDef.getPartnerLink());
+ oreply.messageExchangeId = replyDef.getMessageExchangeId();
+ if (replyDef.getVariable() != null) {
+ oreply.variable = _context.resolveVariable(replyDef.getVariable());
+ if (!(oreply.variable.type instanceof OMessageVarType))
+ throw new CompilationException(_cmsgsGeneral.errMessageVariableRequired(oreply.variable.name));
+ }
+
+ // The portType on the reply is not necessary, so we check its validty only when present.
+ if (replyDef.getPortType() != null && !oreply.partnerLink.myRolePortType.getQName().equals(replyDef.getPortType()))
+ throw new CompilationException(_cmsgsGeneral.errPortTypeMismatch(replyDef.getPortType(),oreply.partnerLink.myRolePortType.getQName()));
+
+ oreply.operation = _context.resolveMyRoleOperation(oreply.partnerLink, replyDef.getOperation());
+ if (oreply.operation.getOutput() == null)
+ throw new CompilationException(_cmsgsGeneral.errTwoWayOperationExpected(oreply.operation.getName()));
+
+ if (oreply.isFaultReply) {
+ // This is a bit fishy, WSDL fault names are not QNAMEs, but BPEL fault names are...
+ if (replyDef.getFaultName().getNamespaceURI().equals(oreply.partnerLink.myRolePortType.getQName().getNamespaceURI()))
+ oreply.fault = oreply.operation.getFault(replyDef.getFaultName().getLocalPart());
+ if (oreply.fault == null)
+ throw new CompilationException(__cmsgsLocal.errUndeclaredFault(replyDef.getFaultName().getLocalPart(), oreply.operation.getName()));
+ if (oreply.variable != null && !((OMessageVarType)oreply.variable.type).messageType.equals(oreply.fault.getMessage().getQName()))
+ throw new CompilationException(_cmsgsGeneral.errVariableTypeMismatch(oreply.variable.name, oreply.fault.getMessage().getQName(), ((OMessageVarType)oreply.variable.type).messageType));
+ } else /* !oreply.isFaultReply */ {
+ assert oreply.fault == null;
+ if (oreply.variable == null)
+ throw new CompilationException(__cmsgsLocal.errOutputVariableMustBeSpecified());
+ if (!((OMessageVarType)oreply.variable.type).messageType.equals(oreply.operation.getOutput().getMessage().getQName()))
+ throw new CompilationException(_cmsgsGeneral.errVariableTypeMismatch(oreply.variable.name, oreply.operation.getOutput().getMessage().getQName(),((OMessageVarType)oreply.variable.type).messageType));
}
- public void compile(OActivity output, Activity src) {
- org.apache.ode.bom.api.ReplyActivity replyDef = (org.apache.ode.bom.api.ReplyActivity) src;
- OReply oreply = (OReply) output;
-
- oreply.isFaultReply = replyDef.getFaultName() != null;
- oreply.partnerLink = _context.resolvePartnerLink(replyDef.getPartnerLink());
- oreply.messageExchangeId = replyDef.getMessageExchangeId();
- if (replyDef.getVariable() != null) {
- oreply.variable = _context.resolveVariable(replyDef.getVariable());
- if (!(oreply.variable.type instanceof OMessageVarType))
- throw new CompilationException(_cmsgsGeneral.errMessageVariableRequired(oreply.variable.name));
- }
-
- // The portType on the reply is not necessary, so we check its validty only when present.
- if (replyDef.getPortType() != null && !oreply.partnerLink.myRolePortType.getQName().equals(replyDef.getPortType()))
- throw new CompilationException(_cmsgsGeneral.errPortTypeMismatch(replyDef.getPortType(),oreply.partnerLink.myRolePortType.getQName()));
-
- oreply.operation = _context.resolveMyRoleOperation(oreply.partnerLink, replyDef.getOperation());
- if (oreply.operation.getOutput() == null)
- throw new CompilationException(_cmsgsGeneral.errTwoWayOperationExpected(oreply.operation.getName()));
-
- if (oreply.isFaultReply) {
- // This is a bit fishy, WSDL fault names are not QNAMEs, but BPEL fault names are...
- if (replyDef.getFaultName().getNamespaceURI().equals(oreply.partnerLink.myRolePortType.getQName().getNamespaceURI()))
- oreply.fault = oreply.operation.getFault(replyDef.getFaultName().getLocalPart());
- if (oreply.fault == null)
- throw new CompilationException(__cmsgsLocal.errUndeclaredFault(replyDef.getFaultName().getLocalPart(), oreply.operation.getName()));
- if (oreply.variable != null && !((OMessageVarType)oreply.variable.type).messageType.equals(oreply.fault.getMessage().getQName()))
- throw new CompilationException(_cmsgsGeneral.errVariableTypeMismatch(oreply.variable.name, oreply.fault.getMessage().getQName(), ((OMessageVarType)oreply.variable.type).messageType));
- } else /* !oreply.isFaultReply */ {
- assert oreply.fault == null;
- if (oreply.variable == null)
- throw new CompilationException(__cmsgsLocal.errOutputVariableMustBeSpecified());
- if (!((OMessageVarType)oreply.variable.type).messageType.equals(oreply.operation.getOutput().getMessage().getQName()))
- throw new CompilationException(_cmsgsGeneral.errVariableTypeMismatch(oreply.variable.name, oreply.operation.getOutput().getMessage().getQName(),((OMessageVarType)oreply.variable.type).messageType));
- }
-
- for (Iterator<Correlation> i = replyDef.getCorrelations().iterator(); i.hasNext(); ) {
- Correlation correlation = i.next();
- OScope.CorrelationSet cset = _context.resolveCorrelationSet(correlation.getCorrelationSet());
-
- switch (correlation.getInitiate()) {
- case Correlation.INITIATE_NO:
- oreply.assertCorrelations.add(cset);
- break;
- case Correlation.INITIATE_YES:
- oreply.initCorrelations.add(cset);
- break;
- default:
- // TODO: Make error for this.
- throw new AssertionError();
- }
-
- for (Iterator<OProcess.OProperty> j = cset.properties.iterator(); j.hasNext(); ) {
- OProcess.OProperty property = j.next();
- // Force resolution of alias, to make sure that we have one for this variable-property pair.
- _context.resolvePropertyAlias(oreply.variable, property.name);
- }
- }
+ for (Correlation correlation : replyDef.getCorrelations()) {
+ OScope.CorrelationSet cset = _context.resolveCorrelationSet(correlation.getCorrelationSet());
+
+ switch (correlation.getInitiate()) {
+ case UNSET:
+ case NO:
+ oreply.assertCorrelations.add(cset);
+ break;
+ case YES:
+ oreply.initCorrelations.add(cset);
+ break;
+ default:
+ // TODO: Make error for this.
+ throw new AssertionError();
+ }
+
+ for (Iterator<OProcess.OProperty> j = cset.properties.iterator(); j.hasNext(); ) {
+ OProcess.OProperty property = j.next();
+ // Force resolution of alias, to make sure that we have one for this variable-property pair.
+ _context.resolvePropertyAlias(oreply.variable, property.name);
+ }
}
+ }
}
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGeneratorMessages.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGeneratorMessages.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGeneratorMessages.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGeneratorMessages.java Mon Oct 23 21:43:09 2006
@@ -19,8 +19,8 @@
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bpel.capi.CompilationMessage;
-import org.apache.ode.bpel.capi.CompilationMessageBundle;
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
public class ReplyGeneratorMessages extends CompilationMessageBundle {
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RethrowGenerator.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RethrowGenerator.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RethrowGenerator.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RethrowGenerator.java Mon Oct 23 21:43:09 2006
@@ -18,7 +18,7 @@
*/
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.api.Activity;
+import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.ORethrow;
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SequenceGenerator.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SequenceGenerator.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SequenceGenerator.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SequenceGenerator.java Mon Oct 23 21:43:09 2006
@@ -18,10 +18,10 @@
*/
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.api.Activity;
-import org.apache.ode.bom.api.CompositeActivity;
-import org.apache.ode.bom.api.SequenceActivity;
-import org.apache.ode.bpel.capi.CompilationException;
+import org.apache.ode.bpel.compiler.api.CompilationException;
+import org.apache.ode.bpel.compiler.bom.Activity;
+import org.apache.ode.bpel.compiler.bom.CompositeActivity;
+import org.apache.ode.bpel.compiler.bom.SequenceActivity;
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.OSequence;
@@ -44,8 +44,7 @@
}
protected void compileChildren(OSequence dest, CompositeActivity src) {
- for (Iterator<Activity> i = src.getChildren().iterator(); i.hasNext();) {
- Activity child = i.next();
+ for (Activity child : src.getActivities()) {
try {
OActivity compiledChild = _context.compile(child);
dest.sequence.add(compiledChild);
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/TerminateGenerator.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/TerminateGenerator.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/TerminateGenerator.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/TerminateGenerator.java Mon Oct 23 21:43:09 2006
@@ -18,7 +18,7 @@
*/
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.api.Activity;
+import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.OTerminate;
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java Mon Oct 23 21:43:09 2006
@@ -18,8 +18,8 @@
*/
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.api.Activity;
-import org.apache.ode.bom.api.ThrowActivity;
+import org.apache.ode.bpel.compiler.bom.Activity;
+import org.apache.ode.bpel.compiler.bom.ThrowActivity;
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.OThrow;
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java Mon Oct 23 21:43:09 2006
@@ -18,33 +18,42 @@
*/
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.wsdl.*;
-import org.apache.ode.bpel.capi.CompilationException;
-import org.apache.ode.bpel.capi.CompilerContext;
-import org.apache.ode.utils.msg.MessageBundle;
-import org.apache.ode.utils.xsd.SchemaModel;
-import org.apache.ode.utils.xsd.SchemaModelImpl;
-import org.apache.ode.utils.xsd.XSUtils;
-import org.apache.ode.utils.xsd.XsdException;
-import org.apache.ode.utils.fs.FileUtils;
-import org.apache.ode.utils.DOMUtils;
-import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
-
+import java.io.StringReader;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.*;
-import java.io.StringReader;
-import java.io.IOException;
-
-import javax.wsdl.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Import;
+import javax.wsdl.Message;
+import javax.wsdl.PortType;
+import javax.wsdl.Types;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.xml.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
+import org.apache.ode.bpel.compiler.api.CompilationException;
+import org.apache.ode.bpel.compiler.api.CompilerContext;
+import org.apache.ode.bpel.compiler.bom.PartnerLinkType;
+import org.apache.ode.bpel.compiler.bom.PropertyAlias;
+import org.apache.ode.bpel.compiler.wsdl.Definition4BPEL;
+import org.apache.ode.bpel.compiler.wsdl.XMLSchemaType;
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.fs.FileUtils;
+import org.apache.ode.utils.msg.MessageBundle;
+import org.apache.ode.utils.xsd.SchemaModel;
+import org.apache.ode.utils.xsd.SchemaModelImpl;
+import org.apache.ode.utils.xsd.XSUtils;
+import org.apache.ode.utils.xsd.XsdException;
import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
/**
@@ -165,8 +174,8 @@
im.getLocationURI()).setSource(def.getDocumentBaseURI()));
if (_ctx == null)
throw ce;
- else
- _ctx.recoveredFromError(def.getDocumentBaseURI(), ce);
+
+ _ctx.recoveredFromError(def.getDocumentBaseURI(), ce);
continue;
}
@@ -246,7 +255,7 @@
}
}
- public Property getProperty(QName name) {
+ public org.apache.ode.bpel.compiler.bom.Property getProperty(QName name) {
ArrayList<Definition4BPEL> defs = _definitions.get(name.getNamespaceURI());
if (defs == null) return null;
for (Definition4BPEL definition4BPEL : defs) {
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGenerator.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGenerator.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGenerator.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGenerator.java Mon Oct 23 21:43:09 2006
@@ -19,9 +19,9 @@
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.api.Activity;
-import org.apache.ode.bom.api.WaitActivity;
-import org.apache.ode.bpel.capi.CompilationException;
+import org.apache.ode.bpel.compiler.api.CompilationException;
+import org.apache.ode.bpel.compiler.bom.Activity;
+import org.apache.ode.bpel.compiler.bom.WaitActivity;
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.OWait;
import org.apache.ode.utils.msg.MessageBundle;
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGeneratorMessages.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGeneratorMessages.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGeneratorMessages.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGeneratorMessages.java Mon Oct 23 21:43:09 2006
@@ -19,8 +19,8 @@
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bpel.capi.CompilationMessage;
-import org.apache.ode.bpel.capi.CompilationMessageBundle;
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
public class WaitGeneratorMessages extends CompilationMessageBundle {
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WhileGenerator.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WhileGenerator.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WhileGenerator.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WhileGenerator.java Mon Oct 23 21:43:09 2006
@@ -18,8 +18,8 @@
*/
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.api.Activity;
-import org.apache.ode.bom.api.WhileActivity;
+import org.apache.ode.bpel.compiler.bom.Activity;
+import org.apache.ode.bpel.compiler.bom.WhileActivity;
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.OWhile;
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WsdlFinder.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WsdlFinder.java?view=diff&rev=467239&r1=467238&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WsdlFinder.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WsdlFinder.java Mon Oct 23 21:43:09 2006
@@ -18,7 +18,7 @@
*/
package org.apache.ode.bpel.compiler;
-import org.apache.ode.bom.wsdl.Definition4BPEL;
+import org.apache.ode.bpel.compiler.wsdl.Definition4BPEL;
import java.io.IOException;
import java.io.InputStream;
Copied: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationException.java (from r448015, incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilationException.java)
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationException.java?view=diff&rev=467239&p1=incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilationException.java&r1=448015&p2=incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationException.java&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilationException.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationException.java Mon Oct 23 21:43:09 2006
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.ode.bpel.capi;
+package org.apache.ode.bpel.compiler.api;
/**
* Exception indicating a compilation error.
Copied: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessage.java (from r448015, incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilationMessage.java)
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessage.java?view=diff&rev=467239&p1=incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilationMessage.java&r1=448015&p2=incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessage.java&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilationMessage.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessage.java Mon Oct 23 21:43:09 2006
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.ode.bpel.capi;
+package org.apache.ode.bpel.compiler.api;
import org.apache.ode.utils.msg.CommonMessages;
import org.apache.ode.utils.msg.MessageBundle;
Copied: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessageBundle.java (from r448015, incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilationMessageBundle.java)
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessageBundle.java?view=diff&rev=467239&p1=incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilationMessageBundle.java&r1=448015&p2=incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessageBundle.java&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilationMessageBundle.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilationMessageBundle.java Mon Oct 23 21:43:09 2006
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.ode.bpel.capi;
+package org.apache.ode.bpel.compiler.api;
import org.apache.ode.utils.msg.MessageBundle;
Copied: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompileListener.java (from r448015, incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompileListener.java)
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompileListener.java?view=diff&rev=467239&p1=incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompileListener.java&r1=448015&p2=incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompileListener.java&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompileListener.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompileListener.java Mon Oct 23 21:43:09 2006
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.ode.bpel.capi;
+package org.apache.ode.bpel.compiler.api;
/**
* Interface allowing an object to listen to compilation events.
Copied: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java (from r448015, incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilerContext.java)
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java?view=diff&rev=467239&p1=incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilerContext.java&r1=448015&p2=incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/CompilerContext.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java Mon Oct 23 21:43:09 2006
@@ -16,10 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.ode.bpel.capi;
+package org.apache.ode.bpel.compiler.api;
-import org.apache.ode.bom.api.Activity;
-import org.apache.ode.bom.api.Expression;
+import java.util.List;
+
+import javax.wsdl.Operation;
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.compiler.bom.Activity;
+import org.apache.ode.bpel.compiler.bom.Expression;
+import org.apache.ode.bpel.compiler.bom.ScopeActivity;
+import org.apache.ode.bpel.compiler.bom.ScopeLikeActivity;
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.OExpression;
import org.apache.ode.bpel.o.OLValueExpression;
@@ -30,10 +37,8 @@
import org.apache.ode.bpel.o.OScope;
import org.apache.ode.bpel.o.OXsdTypeVarType;
import org.apache.ode.bpel.o.OXslSheet;
-
-import javax.wsdl.Operation;
-import javax.xml.namespace.QName;
-import java.util.List;
+import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.utils.NSContext;
/**
@@ -52,6 +57,8 @@
OLValueExpression compileLValueExpr(Expression expr)
throws CompilationException;
+ OExpression compileExpr(String locationstr, NSContext nsContext);
+
OXslSheet compileXslt(String docStrUri)
throws CompilationException;
@@ -81,6 +88,8 @@
OActivity compileSLC(final Activity source)
throws CompilationException;
+ OScope compileSLC(ScopeLikeActivity child, Variable[] variables);
+
OPartnerLink resolvePartnerLink(String name)
throws CompilationException;
@@ -110,7 +119,11 @@
String getSourceLocation();
- void compile(OActivity context, Runnable run);
+ boolean isPartnerLinkAssigned(String plink);
+
+ List<OActivity> getActivityStack();
+
+ OActivity getCurrent();
+
- public boolean isPartnerLinkAssigned(String plink);
}
Copied: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java (from r448015, incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/ExpressionCompiler.java)
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java?view=diff&rev=467239&p1=incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/ExpressionCompiler.java&r1=448015&p2=incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java&r2=467239
==============================================================================
--- incubator/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/capi/ExpressionCompiler.java (original)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java Mon Oct 23 21:43:09 2006
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.ode.bpel.capi;
+package org.apache.ode.bpel.compiler.api;
import org.apache.ode.bpel.o.OExpression;
import org.apache.ode.bpel.o.OLValueExpression;
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Activity.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Activity.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Activity.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Activity.java Mon Oct 23 21:43:09 2006
@@ -0,0 +1,92 @@
+/*
+ * 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.compiler.bom;
+
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.utils.stl.CollectionsX;
+import org.w3c.dom.Element;
+
+/**
+ * Interface common to all BPEL activities. This interface provides methods for
+ * manipulating the so-called "common attributes" such as source and target
+ * links, activity name, and supress join failure flag.
+ */
+public class Activity extends JoinFailureSuppressor {
+
+ public Activity(Element el) {
+ super(el);
+ }
+
+ public String getName() {
+ return getAttribute("name", null);
+ }
+
+ /**
+ * Get the join condition.
+ *
+ * @return the join condition
+ */
+ public Expression getJoinCondition() {
+ if (is11()) {
+ return isAttributeSet("joinCondition")
+ ? new Expression11(getElement(),getElement().getAttributeNode("joinCondition")) : null;
+ }
+
+ Targets targets = getFirstChild(Targets.class);
+ return targets == null ? null : (Expression) targets.getFirstChild(Expression.class);
+ }
+
+ /**
+ * Get the {@link LinkSource}s for this activity.
+ *
+ * @return set of {@link LinkSource}s
+ */
+ public List<LinkSource> getLinkSources() {
+ if (is11()) {
+ return getChildren(LinkSource.class);
+ }
+
+ Sources sources = getFirstChild(Sources.class);
+ if (sources == null)
+ return Collections.emptyList();
+ return sources.getChildren(LinkSource.class);
+ }
+
+ /**
+ * Get the {@link LinkTarget}s for this activity.
+ *
+ * @return set of {@link LinkTarget}s
+ */
+ public List<LinkTarget> getLinkTargets() {
+ if (is11()) {
+ return getChildren(LinkTarget.class);
+ }
+
+ Targets targets = getFirstChild(Targets.class);
+ if (targets == null )
+ return Collections.emptyList() ;
+
+ return targets.getChildren(LinkTarget.class);
+
+ }
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/AssignActivity.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/AssignActivity.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/AssignActivity.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/AssignActivity.java Mon Oct 23 21:43:09 2006
@@ -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.compiler.bom;
+
+import java.util.List;
+
+import org.w3c.dom.Element;
+
+/**
+ * BOM representation of the BPEL <code><assign></code> activity. The
+ * <code><assign></code> activity is simply a collection of
+ * <code><copy></code> entries ({@link Copy}).
+ */
+public class AssignActivity extends Activity {
+
+ public AssignActivity(Element el) {
+ super(el);
+ }
+
+ /**
+ * Get the list of <code><copy></code> entries for this activity.
+ *
+ * @return copy entries
+ */
+ public List<Copy> getCopies() {
+ return getChildren(Copy.class);
+ }
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Bpel20QNames.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Bpel20QNames.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Bpel20QNames.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Bpel20QNames.java Mon Oct 23 21:43:09 2006
@@ -0,0 +1,178 @@
+/*
+ * 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.compiler.bom;
+
+import javax.xml.namespace.QName;
+
+public abstract class Bpel20QNames {
+
+ /**
+ * The XML namespace for schema of WS-BPEL 2.0, i.e., the first
+ * OASIS-sanctioned version of the specification.
+ */
+ public static final String NS_WSBPEL2_0 = "http://schemas.xmlsoap.org/ws/2004/03/business-process/";
+
+ public static final String NS_WSBPEL_PARTNERLINK_2004_03 = "http://schemas.xmlsoap.org/ws/2004/03/partner-link/";
+
+ public static final QName PROCESS = newQName("process");
+
+ public static final QName IMPORT = newQName("import");
+
+ public static final QName SERVICE_REF = newQName("service-ref");
+
+ public static final QName SOURCES = newQName("sources");
+
+ public static final QName SOURCE = newQName("source");
+
+ public static final QName TARGETS = newQName("targets");
+
+ public static final QName TARGET = newQName("target");
+
+ public static final QName PARTNERLINKS = newQName("partnerLinks");
+
+ public static final QName PARTNERLINK = newQName("partnerLink");
+
+ public static final QName VARIABLES = newQName("variables");
+
+ public static final QName VARIABLE = newQName("variable");
+
+ public static final QName CORRELATIONSETS = newQName("correlationSets");
+
+ public static final QName CORRELATIONSET = newQName("correlationSet");
+
+ public static final QName FAULTHANDLERS = newQName("faultHandlers");
+
+ public static final QName CATCH = newQName("catch");
+
+ public static final QName CATCHALL = newQName("catchAll");
+
+ public static final QName COMPENSATIONHANDLER = newQName("compensationHandler");
+
+ public static final QName TERMINATIONHANDLER = newQName("terminationHandler");
+
+ public static final QName COMPENSATE = newQName("compensate");
+
+ public static final QName EVENTHANDLERS = newQName("eventHandlers");
+
+ public static final QName ONEVENT = newQName("onEvent");
+
+ public static final QName ONMESSAGE = newQName("onMessage");
+
+ public static final QName ONALARM = newQName("onAlarm");
+
+ public static final QName CORRELATIONS = newQName("correlations");
+
+ public static final QName CORRELATION = newQName("correlation");
+
+ public static final QName EMPTY = newQName("empty");
+
+ public static final QName INVOKE = newQName("invoke");
+
+ public static final QName RECEIVE = newQName("receive");
+
+ public static final QName REPLY = newQName("reply");
+
+ public static final QName ASSIGN = newQName("assign");
+
+ public static final QName COPY = newQName("copy");
+
+ public static final QName FROM = newQName("from");
+
+ public static final QName TO = newQName("to");
+
+ public static final QName WAIT = newQName("wait");
+
+ public static final QName THROW = newQName("throw");
+
+ public static final QName RETHROW = newQName("rethrow");
+
+ public static final QName EXIT = newQName("exit");
+
+ public static final QName FLOW = newQName("flow");
+
+ public static final QName LINKS = newQName("links");
+
+ public static final QName LINK = newQName("link");
+
+ public static final QName SWITCH = newQName("switch");
+
+ public static final QName CASE = newQName("case");
+
+ public static final QName OTHERWISE = newQName("otherwise");
+
+ public static final QName IF = newQName("if");
+
+ public static final QName THEN = newQName("then");
+
+ public static final QName ELSEIF = newQName("elseif");
+
+ public static final QName ELSE = newQName("else");
+
+ public static final QName WHILE = newQName("while");
+
+ public static final QName SEQUENCE = newQName("sequence");
+
+ public static final QName PICK = newQName("pick");
+
+ public static final QName SCOPE = newQName("scope");
+
+ public static final QName TRANSITION_CONDITION = newQName("transitionCondition");
+
+ public static final QName FOR = newQName("for");
+
+ public static final QName UNTIL = newQName("until");
+
+ public static final QName REPEAT_EVERY = newQName("repeatEvery");
+
+ public static final QName JOIN_CONDITION = newQName("joinCondition");
+
+ public static final QName CONDITION = newQName("condition");
+
+ public static final QName QUERY = newQName("query");
+
+ public static final QName EXPRESSION = newQName("expression");
+
+ public static final QName FOREACH = newQName("forEach");
+
+ public static final QName ITERATOR = newQName("iterator");
+
+ public static final QName START_COUNTER_VALUE = newQName("startCounterValue");
+
+ public static final QName FINAL_COUNTER_VALUE = newQName("finalCounterValue");
+
+ public static final QName COMPLETION_CONDITION = newQName("completionCondition");
+
+ public static final QName BRANCHES = newQName("branches");
+
+ public static final QName LITERAL = newQName("literal");
+
+ public static final QName PROPALIAS = newQName("propertyAlias");
+
+ public static final QName PROPERTY = newQName("property");
+
+ public static final QName PLINKTYPE = new QName(NS_WSBPEL_PARTNERLINK_2004_03, "partnerLinkType");
+
+ public static final QName PLINKROLE = new QName(NS_WSBPEL_PARTNERLINK_2004_03, "role");
+
+ private static QName newQName(String localname) {
+ return new QName(NS_WSBPEL2_0, localname);
+ }
+
+
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject.java Mon Oct 23 21:43:09 2006
@@ -0,0 +1,236 @@
+/*
+ * 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.compiler.bom;
+
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.NSContext;
+import org.apache.ode.utils.stl.CollectionsX;
+import org.apache.ode.utils.stl.MemberOfFunction;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.xml.namespace.QName;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Common interface to all BPEL object model (BOM) objects. Provides for
+ * location information (i.e. line numbers) and namespace context (XML namespace
+ * prefix maps).
+ */
+public class BpelObject {
+
+ public static final QName ATTR_LINENO = new QName("urn:org.apache.ode.bpel.compiler", "lineno");
+
+ private final Element _element;
+
+ private final QName _type;
+
+ private final NSContext _nsContext;
+
+ private List<BpelObject> _children = null;
+
+ public BpelObject(Element el) {
+ _element = el;
+ _type = new QName(el.getNamespaceURI(), el.getLocalName());
+ _nsContext = new NSContext();
+ initNSContext(el);
+ }
+
+ public QName getType() {
+ return _type;
+ }
+
+ public Element getElement() {
+ return _element;
+ }
+
+ /**
+ * Get the line number in the BPEL source document where this object is
+ * defined.
+ *
+ * @return line number
+ */
+ public int getLineNo() {
+ return Integer.valueOf(getAttribute(ATTR_LINENO, "-1"));
+ }
+
+ /**
+ * Get the namespace context for this BPEL object (i.e. prefix-to-namespace
+ * mapping).
+ *
+ * @return namespace context
+ */
+ public NSContext getNamespaceContext() {
+ return _nsContext;
+ }
+
+
+ /**
+ * Return the declared extensibility elements. The extensibility elements
+ * declared as subelements of this BpelObject will be returned with a value
+ * type of org.w3c.dom.Element. The ones declared as extensibility
+ * attributes will be returned as a value type of String.
+ *
+ * @return extensibility qualified names and the full elements value (String
+ * or Element)
+ */
+ public Map<QName, Object> getExtensibilityElements() {
+ // TODO: implement
+ return new HashMap<QName, Object>();
+
+ }
+
+
+ public Element getExtensibilityElement(QName extElName) {
+ BpelObject e = getFirstChild(extElName);
+ if (e == null)
+ return null;
+ return e.getElement();
+ }
+
+
+ /**
+ * Is this a BPEL 1.1 object?
+ * @return
+ */
+ protected boolean is11() {
+ return getType().getNamespaceURI() != null &&
+ (getType().getNamespaceURI().equals(Bpel11QNames.NS_BPEL4WS_2003_03)
+ || getType().getNamespaceURI().equals(Bpel11QNames.NS_BPEL4WS_PARTNERLINK_2003_05));
+ }
+
+ protected boolean isAttributeSet(String attrname) {
+ return null != getAttribute(attrname, null);
+ }
+
+ protected <T extends BpelObject> List<T> getChildren(Class<T> cls) {
+ return CollectionsX.filter(new ArrayList<T>(), getChildren(), cls);
+ }
+
+ protected <T extends BpelObject> T getFirstChild(Class<T> cls) {
+ List<T> children = getChildren(cls);
+ if (children.size() == 0)
+ return null;
+ return children.get(0);
+ }
+
+ protected List<BpelObject> getChildren(final QName type) {
+ return CollectionsX.filter(new ArrayList<BpelObject>(), getChildren(), new MemberOfFunction<BpelObject>() {
+ @Override
+ public boolean isMember(BpelObject o) {
+ return o.getType().equals(type);
+ }
+ });
+ }
+
+ protected BpelObject getFirstChild(final QName type) {
+ return CollectionsX.find_if(getChildren(), new MemberOfFunction<BpelObject>() {
+ @Override
+ public boolean isMember(BpelObject o) {
+ return o.getType().equals(type);
+ }
+ });
+ }
+
+ protected List<BpelObject> getChildren() {
+ if (_children == null) {
+ _children = new ArrayList<BpelObject>();
+ NodeList nl = _element.getChildNodes();
+ for (int i = 0; i < nl.getLength(); ++i) {
+ Node node = nl.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE)
+ _children.add(createBpelObject((Element) node));
+ }
+ }
+
+ return _children;
+
+ }
+
+ protected BpelObject createBpelObject(Element element) {
+ return BpelObjectFactory.getInstance().createBpelObject(element);
+ }
+
+ protected String getAttribute(QName name, String dflt) {
+ String val = _element.getAttributeNS(name.getNamespaceURI(), name.getLocalPart());
+ if (val == null || "".equals(val))
+ return dflt;
+ return val;
+ }
+
+ protected String getAttribute(String name, String dflt) {
+ String val = _element.getAttribute(name);
+ if (val == null || "".equals(val))
+ return dflt;
+ return val;
+ }
+
+ protected String getAttribute(String name) {
+ return getAttribute(name, null);
+ }
+
+ protected <T> T getAttribute(String attrName, Map<String, T> suppressJoinFailure, T notset) {
+ String val = getAttribute(attrName, null);
+ if (val == null || "".equals(val))
+ return notset;
+ return suppressJoinFailure.get(val);
+ }
+
+
+
+ /**
+ * Initialize object's namespace context (recursively).
+ *
+ * @param el
+ * object's associated element.
+ */
+ private void initNSContext(Element el) {
+ if (el.getParentNode() != null && el.getParentNode().getNodeType() == Node.ELEMENT_NODE)
+ initNSContext((Element) el.getParentNode());
+ NamedNodeMap attrs = el.getAttributes();
+ for (int i = 0; i < attrs.getLength(); ++i) {
+ Attr attr = (Attr) attrs.item(i);
+ if (!attr.getName().startsWith("xmlns:"))
+ continue;
+ String prefix = attr.getLocalName();
+ String uri = attr.getValue();
+
+ _nsContext.register(prefix, uri);
+ }
+
+ Attr dflt = el.getAttributeNode("xmlns");
+ if (dflt != null) {
+ _nsContext.register("", dflt.getTextContent());
+ }
+
+ }
+
+ @Override
+ public String toString() {
+ return DOMUtils.domToString(_element);
+ }
+
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject4WSDL.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject4WSDL.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject4WSDL.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObject4WSDL.java Mon Oct 23 21:43:09 2006
@@ -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.bpel.compiler.bom;
+
+import java.io.Serializable;
+
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+public abstract class BpelObject4WSDL extends BpelObject implements ExtensibilityElement, Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private QName _elType;
+ private Boolean _required;
+ private String _targetNamespace;
+
+
+
+ public BpelObject4WSDL(Element el) {
+ super(el);
+ _elType = new QName(el.getNamespaceURI(), el.getLocalName());
+ }
+
+ public QName getElementType() {
+ return _elType;
+ }
+
+ public void setRequired(Boolean required) {
+ _required = required;
+ }
+
+ public void setElementType(QName eltype) {
+ _elType = eltype;
+ }
+
+ public Boolean getRequired() {
+ return _required;
+ }
+
+ public void setTargetNamespace(String tns) {
+ _targetNamespace = tns;
+ }
+
+ public String getTargetNamespace() {
+ return _targetNamespace;
+ }
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/BpelObjectFactory.java Mon Oct 23 21:43:09 2006
@@ -0,0 +1,223 @@
+/*
+ * 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.compiler.bom;
+
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.validation.Schema;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.compiler.bom.IfActivity.Case;
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.XMLParserUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+
+public class BpelObjectFactory {
+
+ private static final Log __log = LogFactory.getLog(BpelObjectFactory.class);
+ private static BpelObjectFactory __instance = new BpelObjectFactory();
+
+ public static final String WSDL = "http://schemas.xmlsoap.org/wsdl/";
+ public static final String XML = "http://www.w3.org/2001/xml.xsd";
+
+ private final Map<QName, Class<? extends BpelObject>> _mappings = new HashMap<QName, Class<? extends BpelObject>>();
+
+ private Schema _bpelSchema;
+
+ private Class[] __CTOR = { Element.class };
+
+ public BpelObjectFactory() {
+
+ //
+ // BPEL 2.0 Mappings
+ //
+ _mappings.put(Bpel20QNames.PROCESS, Process.class);
+ _mappings.put(Bpel20QNames.ASSIGN, AssignActivity.class);
+ _mappings.put(Bpel20QNames.EMPTY, EmptyActivity.class);
+ _mappings.put(Bpel20QNames.INVOKE, InvokeActivity.class);
+ _mappings.put(Bpel20QNames.RECEIVE, ReceiveActivity.class);
+ _mappings.put(Bpel20QNames.REPLY, ReplyActivity.class);
+ _mappings.put(Bpel20QNames.WAIT, WaitActivity.class);
+ _mappings.put(Bpel20QNames.THROW, ThrowActivity.class);
+ _mappings.put(Bpel20QNames.COMPENSATE, CompensateActivity.class);
+ _mappings.put(Bpel20QNames.RETHROW, RethrowActivity.class);
+ _mappings.put(Bpel20QNames.EXIT, TerminateActivity.class);
+ _mappings.put(Bpel20QNames.FLOW, FlowActivity.class);
+ _mappings.put(Bpel20QNames.SWITCH, IfActivity.class);
+ _mappings.put(Bpel20QNames.IF, IfActivity.class);
+ _mappings.put(Bpel20QNames.WHILE, WhileActivity.class);
+ _mappings.put(Bpel20QNames.SEQUENCE, SequenceActivity.class);
+ _mappings.put(Bpel20QNames.PICK, PickActivity.class);
+ _mappings.put(Bpel20QNames.SCOPE, ScopeActivity.class);
+ _mappings.put(Bpel20QNames.FOREACH, ForEachActivity.class);
+ _mappings.put(Bpel20QNames.COPY, Copy.class);
+ _mappings.put(Bpel20QNames.CATCH, Catch.class);
+ _mappings.put(Bpel20QNames.CATCHALL, Catch.class);
+ _mappings.put(Bpel20QNames.TO, To.class);
+ _mappings.put(Bpel20QNames.FROM, From.class);
+ _mappings.put(Bpel20QNames.START_COUNTER_VALUE, Expression.class);
+ _mappings.put(Bpel20QNames.FINAL_COUNTER_VALUE, Expression.class);
+ _mappings.put(Bpel20QNames.CORRELATION, Correlation.class);
+ _mappings.put(Bpel20QNames.CORRELATIONSET, CorrelationSet.class);
+ _mappings.put(Bpel20QNames.COMPENSATE, CompensateActivity.class);
+ _mappings.put(Bpel20QNames.COMPENSATIONHANDLER, CompensationHandler.class);
+ _mappings.put(Bpel20QNames.FAULTHANDLERS, FaultHandler.class);
+ _mappings.put(Bpel20QNames.TERMINATIONHANDLER, TerminationHandler.class);
+ _mappings.put(Bpel20QNames.CASE, IfActivity.Case.class);
+ _mappings.put(Bpel20QNames.CONDITION, Expression.class);
+ _mappings.put(Bpel20QNames.UNTIL, Expression.class);
+ _mappings.put(Bpel20QNames.FOR, Expression.class);
+ _mappings.put(Bpel20QNames.REPEAT_EVERY, Expression.class);
+ _mappings.put(Bpel20QNames.ONALARM, OnAlarm.class);
+ _mappings.put(Bpel20QNames.ONEVENT, OnEvent.class);
+ _mappings.put(Bpel20QNames.ONMESSAGE, OnMessage.class);
+ _mappings.put(Bpel20QNames.LITERAL, LiteralVal.class);
+ _mappings.put(Bpel20QNames.PLINKTYPE, PartnerLinkType.class);
+ _mappings.put(Bpel20QNames.PLINKROLE, PartnerLinkType.Role.class);
+ _mappings.put(Bpel20QNames.PROPALIAS, PropertyAlias.class);
+ _mappings.put(Bpel20QNames.PROPERTY, Property.class);
+ _mappings.put(Bpel20QNames.VARIABLES, Variables.class);
+ _mappings.put(Bpel20QNames.VARIABLE, Variable.class);
+ _mappings.put(Bpel20QNames.PARTNERLINKS, PartnerLinks.class);
+ _mappings.put(Bpel20QNames.PARTNERLINK, PartnerLink.class);
+ _mappings.put(Bpel20QNames.CORRELATIONSETS, CorrelationSets.class);
+ _mappings.put(Bpel20QNames.JOIN_CONDITION, Expression.class);
+ _mappings.put(Bpel20QNames.LINKS, Links.class );
+ _mappings.put(Bpel20QNames.LINK, Link.class);
+ _mappings.put(Bpel20QNames.SOURCE, LinkSource.class);
+ _mappings.put(Bpel20QNames.TARGET, LinkTarget.class);
+ _mappings.put(Bpel20QNames.SOURCES, BpelObject.class);
+ _mappings.put(Bpel20QNames.TARGETS, BpelObject.class);
+ _mappings.put(Bpel20QNames.IMPORT, Import.class);
+ _mappings.put(Bpel20QNames.QUERY, Query.class);
+ _mappings.put(Bpel20QNames.TRANSITION_CONDITION, Expression.class);
+ _mappings.put(Bpel20QNames.THEN, Case.class);
+ _mappings.put(Bpel20QNames.ELSE, Case.class);
+ _mappings.put(Bpel20QNames.ELSEIF, Case.class);
+ _mappings.put(Bpel20QNames.CORRELATIONS, Correlations.class);
+ _mappings.put(Bpel20QNames.EVENTHANDLERS, BpelObject.class);
+ _mappings.put(Bpel20QNames.TARGETS,Targets.class);
+ _mappings.put(Bpel20QNames.SOURCES,Sources.class);
+
+
+ //
+ // BPEL 1.1 Mappings
+ //
+ _mappings.put(Bpel11QNames.PROCESS, Process.class);
+ _mappings.put(Bpel11QNames.ASSIGN, AssignActivity.class);
+ _mappings.put(Bpel11QNames.EMPTY, EmptyActivity.class);
+ _mappings.put(Bpel11QNames.INVOKE, InvokeActivity.class);
+ _mappings.put(Bpel11QNames.RECEIVE, ReceiveActivity.class);
+ _mappings.put(Bpel11QNames.REPLY, ReplyActivity.class);
+ _mappings.put(Bpel11QNames.WAIT, WaitActivity.class);
+ _mappings.put(Bpel11QNames.THROW, ThrowActivity.class);
+ _mappings.put(Bpel11QNames.COMPENSATE, CompensateActivity.class);
+ _mappings.put(Bpel11QNames.TERMINATE, TerminateActivity.class);
+ _mappings.put(Bpel11QNames.FLOW, FlowActivity.class);
+ _mappings.put(Bpel11QNames.SWITCH, IfActivity.class);
+ _mappings.put(Bpel11QNames.WHILE, WhileActivity.class);
+ _mappings.put(Bpel11QNames.SEQUENCE, SequenceActivity.class);
+ _mappings.put(Bpel11QNames.PICK, PickActivity.class);
+ _mappings.put(Bpel11QNames.SCOPE, ScopeActivity.class);
+ _mappings.put(Bpel11QNames.COPY, Copy.class);
+ _mappings.put(Bpel11QNames.CATCH, Catch.class);
+ _mappings.put(Bpel11QNames.CATCHALL, Catch.class);
+ _mappings.put(Bpel11QNames.TO, To.class);
+ _mappings.put(Bpel11QNames.FROM, From.class);
+ _mappings.put(Bpel11QNames.CORRELATION, Correlation.class);
+ _mappings.put(Bpel11QNames.CORRELATIONSET, CorrelationSet.class);
+ _mappings.put(Bpel11QNames.COMPENSATE, CompensateActivity.class);
+ _mappings.put(Bpel11QNames.COMPENSATIONHANDLER, CompensationHandler.class);
+ _mappings.put(Bpel11QNames.FAULTHANDLERS, FaultHandler.class);
+ _mappings.put(Bpel11QNames.CASE, IfActivity.Case.class);
+ _mappings.put(Bpel11QNames.ONALARM, OnAlarm.class);
+ _mappings.put(Bpel11QNames.ONMESSAGE, OnMessage.class);
+ _mappings.put(Bpel11QNames.PLINKTYPE, PartnerLinkType.class);
+ _mappings.put(Bpel11QNames.PLINKROLE, PartnerLinkType.Role.class);
+ _mappings.put(Bpel11QNames.PROPALIAS, PropertyAlias.class);
+ _mappings.put(Bpel11QNames.PROPERTY, Property.class);
+ _mappings.put(Bpel11QNames.VARIABLES, Variables.class);
+ _mappings.put(Bpel11QNames.VARIABLE, Variable.class);
+ _mappings.put(Bpel11QNames.PARTNERLINKS, PartnerLinks.class);
+ _mappings.put(Bpel11QNames.PARTNERLINK, PartnerLink.class);
+ _mappings.put(Bpel11QNames.CORRELATIONSETS, CorrelationSets.class);
+ _mappings.put(Bpel11QNames.LINKS, Links.class );
+ _mappings.put(Bpel11QNames.LINK, Link.class);
+ _mappings.put(Bpel11QNames.SOURCE, LinkSource.class);
+ _mappings.put(Bpel11QNames.TARGET, LinkTarget.class);
+ _mappings.put(Bpel11QNames.QUERY, Query.class);
+ _mappings.put(Bpel11QNames.CORRELATIONS, Correlations.class);
+ _mappings.put(Bpel11QNames.EVENTHANDLERS, BpelObject.class);
+
+
+ }
+
+ public static BpelObjectFactory getInstance() {
+ return __instance;
+ }
+
+ public BpelObject createBpelObject(Element el) {
+ QName type = new QName(el.getNamespaceURI(), el.getLocalName());
+ Class cls = _mappings.get(type);
+ if (cls == null) {
+ __log.warn("Unrecognized element in BPEL dom: " + type);
+ return new BpelObject(el);
+ }
+ try {
+ Constructor ctor = cls.getConstructor(__CTOR);
+ return (BpelObject) ctor.newInstance(new Object[]{el});
+ } catch (Exception ex) {
+ throw new RuntimeException("Internal compiler error", ex);
+ }
+ }
+
+ /**
+ * Parse a BPEL process found at the input source.
+ * @param isrc input source.
+ * @return
+ * @throws SAXException
+ */
+ public Process parse(InputSource isrc) throws IOException, SAXException {
+ XMLReader _xr = XMLParserUtils.getXMLReader();
+ LocalEntityResolver resolver = new LocalEntityResolver();
+ resolver.register(Bpel11QNames.NS_BPEL4WS_2003_03, getClass().getResource("/bpel4ws_1_1-fivesight.xsd"));
+ resolver.register(Bpel20QNames.NS_WSBPEL2_0, getClass().getResource("/wsbpel_main-draft-Apr-29-2006.xsd"));
+ resolver.register(XML, getClass().getResource("/xml.xsd"));
+ resolver.register(WSDL,getClass().getResource("/wsdl.xsd"));
+ resolver.register(Bpel20QNames.NS_WSBPEL_PARTNERLINK_2004_03,
+ getClass().getResource("/wsbpel_plinkType-draft-Apr-29-2006.xsd"));
+ _xr.setEntityResolver(resolver);
+ Document doc = DOMUtils.newDocument();
+ _xr.setContentHandler(new DOMBuilderContentHandler(doc));
+ _xr.setFeature("http://xml.org/sax/features/namespaces",true);
+ _xr.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
+ _xr.parse(isrc);
+ return (Process) createBpelObject(doc.getDocumentElement());
+ }
+
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Catch.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Catch.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Catch.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Catch.java Mon Oct 23 21:43:09 2006
@@ -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.compiler.bom;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+/**
+ * Representation of a BPEL fault handler catch block.
+ */
+public class Catch extends Scope {
+ public Catch(Element el) {
+ super(el);
+ }
+
+ /**
+ * Get the activity for this catch block. This is the activity that is
+ * activated if this catch block is enabled.
+ *
+ * @return catch activity fault handling activity
+ */
+ public Activity getActivity() {
+ return getFirstChild(Activity.class);
+ }
+
+ /**
+ * Get the name of the fault. May be <code>null</code>.
+ *
+ * @return fault name or <code>null</code>
+ */
+ public QName getFaultName() {
+ return getNamespaceContext().derefQName(getAttribute("faultName", null));
+ }
+
+ /**
+ * Get the fault variable. May be <code>null</code>
+ *
+ * @return name of the fault variable
+ */
+ public String getFaultVariable() {
+ return getAttribute("faultVariable", null);
+ }
+
+ /**
+ * Get the fault variable type. The fault variable type must be specified in
+ * BPEL 2.0 if the fault variable is set.
+ *
+ * @return fault variable type or <code>null</code> if none specified.
+ */
+ public QName getFaultVariableMessageType() {
+ return getNamespaceContext().derefQName(getAttribute("faultMessageType", null));
+ }
+
+ /**
+ * Get the fault variable type. The fault variable type must be specified in
+ * BPEL 2.0 if the fault variable is set.
+ *
+ * @return fault variable type or <code>null</code> if none specified.
+ */
+ public QName getFaultVariableElementType() {
+ return getNamespaceContext().derefQName(getAttribute("faultElement", null));
+ }
+
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Communication.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Communication.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Communication.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Communication.java Mon Oct 23 21:43:09 2006
@@ -0,0 +1,57 @@
+/*
+ * 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.compiler.bom;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Base interface for BPEL constructs representing a web-service communication.
+ */
+public interface Communication {
+
+ /**
+ * Get the operation for the communication.
+ *
+ * @return name of operation
+ */
+ String getOperation();
+
+
+ /**
+ * Get the partnerLink link on which to communicate.
+ *
+ * @return name of the partner link
+ */
+ String getPartnerLink();
+
+
+ /**
+ * Get the port type for the communication. This property is optional as the partner link type
+ * implies a port type.
+ *
+ * @return name of portType for the communication (or <code>null</code>)
+ */
+ QName getPortType();
+
+
+ List<Correlation> getCorrelations();
+
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CommunicationHelper.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CommunicationHelper.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CommunicationHelper.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CommunicationHelper.java Mon Oct 23 21:43:09 2006
@@ -0,0 +1,56 @@
+/*
+ * 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.compiler.bom;
+
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+public final class CommunicationHelper extends BpelObject implements Communication {
+
+ public CommunicationHelper(Element el) {
+ super(el);
+ }
+
+ public String getOperation() {
+ return getAttribute("operation", null);
+
+ }
+
+ public String getPartnerLink() {
+ return getAttribute("partnerLink", null);
+ }
+
+ public QName getPortType() {
+ return getNamespaceContext().derefQName(getAttribute("portType", null));
+ }
+
+ public List<Correlation> getCorrelations() {
+ Correlations correlations = getFirstChild(Correlations.class);
+ if (correlations == null)
+ return Collections.emptyList();
+
+ return correlations.getChildren(Correlation.class);
+ }
+
+
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateActivity.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateActivity.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateActivity.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensateActivity.java Mon Oct 23 21:43:09 2006
@@ -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.compiler.bom;
+
+import org.w3c.dom.Element;
+
+/**
+ * Representation of the BPEL <code><compensate></code> activity.
+ */
+public class CompensateActivity extends Activity {
+
+ public CompensateActivity(Element el) {
+ super(el);
+ }
+
+ /**
+ * Get the name of the compensate scope: the scope which is compensated by
+ * this activity.
+ *
+ * @return scope compensated by this activity
+ */
+ public String getScopeToCompensate() {
+ return getAttribute("scope", null);
+ }
+
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensationHandler.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensationHandler.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensationHandler.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompensationHandler.java Mon Oct 23 21:43:09 2006
@@ -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.compiler.bom;
+
+import org.w3c.dom.Element;
+
+/**
+ * Representation of a BPEL compensation handler.
+ */
+public class CompensationHandler extends BpelObject {
+
+ public CompensationHandler(Element el) {
+ super(el);
+ }
+
+ /**
+ * Get the compensating activity. This is the
+ * activity that gets activated if the compensation handler
+ * is activated.
+ *
+ * @return compensating activity.
+ */
+ public Activity getActivity() {
+ return getFirstChild(Activity.class);
+ }
+
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompletionCondition.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompletionCondition.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompletionCondition.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompletionCondition.java Mon Oct 23 21:43:09 2006
@@ -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.compiler.bom;
+
+import org.w3c.dom.Element;
+
+/**
+ * Interface for a <code><completionCondition></code> as used in a
+ * forEach activity.
+ */
+public class CompletionCondition extends Expression {
+
+ public CompletionCondition(Element el) {
+ super(el);
+ }
+
+ /**
+ * Gets whether the completion count should include all terminated children
+ * or only successfully completed ones.
+ *
+ * @return counts completed
+ */
+ public boolean isSuccessfulBranchesOnly() {
+ return getAttribute("successfulBranchesOnly", "no").equals("yes");
+ }
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompositeActivity.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompositeActivity.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompositeActivity.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CompositeActivity.java Mon Oct 23 21:43:09 2006
@@ -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.compiler.bom;
+
+import java.util.List;
+
+import org.w3c.dom.Element;
+
+/**
+ * Base interface for BPEL composite activities <code><flow></code> and
+ * <code><sequence></code>. This interface provides methods for
+ * manipulating an ordered list of child activities.
+ */
+public class CompositeActivity extends Activity {
+
+ public CompositeActivity(Element el) {
+ super(el);
+ }
+
+ /**
+ * Get the (ordered) list of child activities.
+ *
+ * @return immutable list of child {@link Activity} objects
+ */
+ public List<Activity> getActivities() {
+ return getChildren(Activity.class);
+ }
+
+}
Added: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Constants.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Constants.java?view=auto&rev=467239
==============================================================================
--- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Constants.java (added)
+++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Constants.java Mon Oct 23 21:43:09 2006
@@ -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.compiler.bom;
+
+/**
+ * Constants.
+ */
+public final class Constants {
+
+ /**
+ * BPEL Namespace, 03/2003
+ */
+ public static final String NS_BPEL4WS_2003_03 = "http://schemas.xmlsoap.org/ws/2003/03/business-process/";
+
+ /**
+ * BPEL Partnerlink Namespace, 05/2003
+ */
+ public static final String NS_BPEL4WS_PARTNERLINK_2003_05 = "http://schemas.xmlsoap.org/ws/2003/05/partner-link/";
+
+ private Constants() {
+ }
+
+}