You are viewing a plain text version of this content. The canonical link for it is here.
Posted to agila-commits@incubator.apache.org by mr...@apache.org on 2006/01/04 21:21:04 UTC
svn commit: r365997 [3/3] - in /incubator/agila/trunk/modules/bpel: ./
client/api/src/java/org/apache/agila/bpel/client/
client/web/src/java/org/apache/agila/bpel/web/common/
client/web/src/java/org/apache/agila/bpel/web/deployer/action/
client/web/src...
Modified: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/InvokeDeployer.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/InvokeDeployer.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/InvokeDeployer.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/InvokeDeployer.java Wed Jan 4 13:19:47 2006
@@ -19,7 +19,8 @@
import org.dom4j.Attribute;
import org.dom4j.Element;
-import org.dom4j.Namespace;
+import org.dom4j.QName;
+import org.apache.agila.bpel.common.util.NSUtil;
import org.apache.agila.bpel.common.util.StringUtil;
import org.apache.agila.bpel.deployer.exception.DeploymentException;
import org.apache.agila.bpel.deployer.priv.context.DeployerContext;
@@ -66,33 +67,19 @@
log.debug("partnerLink=" + partnerLink);
invoke.setPartner(partnerLink.getValue());
}
-
+
Attribute portType = element.attribute("portType");
if (portType != null) {
- String strNS = null;
- String portTypeStr = portType.getValue();
- int sepIndex = portTypeStr.indexOf(AgilaDeployerImpl.NS_SEPARATOR);
- if (sepIndex > 0) {
- strNS = portTypeStr.substring(0,sepIndex);
- portTypeStr = portTypeStr.substring(sepIndex + 1, portTypeStr.length());
-
- Namespace foundNS = findNS(element,strNS); //strNS acts first as prefix
- if(foundNS == null)
- throw new DeploymentException("Could not find Namespace for prefix " + strNS);
- strNS = foundNS.getURI();
- }
- else
- {
- Namespace foundNS = findTargetNS(element); //strNS acts first as prefix
- if(foundNS == null)
- throw new DeploymentException("Could not find targetNamespace or default Namespace xmlns for prefix ");
- strNS = foundNS.getURI();
- }
-
-
- log.debug("portType={" + strNS + "}" + portTypeStr);
- invoke.setPortType(portTypeStr);
- invoke.setNamespace(strNS);
+ try{
+ String portTypeStr = portType.getValue();
+ QName pTypeQname = NSUtil.findAsQname(portTypeStr,element);
+ log.debug("portType={" + pTypeQname.getNamespaceURI() + "}" + pTypeQname.getName());
+ invoke.setPortType(pTypeQname.getName());
+ invoke.setNamespace(pTypeQname.getNamespaceURI());
+
+ }catch (Exception e) {
+ throw new DeploymentException(e);
+ }
}
Attribute operation = element.attribute("operation");
@@ -113,52 +100,6 @@
invoke.setOutputVariable(outputVariable.getValue());
}
}
-
- /**
- * looks for namespaces according to prefixes, it search recursively to the root element
- * @param childElement element, from which we are looking for namespace
- * @param prefix prefix, for which we want to find defined namespace
- * @return namespace defined for prefix or null
- */
-
- private Namespace findNS(Element childElement,String prefix)
- {
- Namespace retNS = childElement.getNamespaceForPrefix(prefix);
- if(retNS==null && !childElement.isRootElement())
- {
- //Element parent = childElement.getParent();
- retNS = findNS(childElement.getParent(),prefix);
- }
- return retNS;
- }
-
- /**
- * tries to find targetNamespace for element, or xmlns of root element, if no targetNamespace was found
- *
- * @param childElement element, from which we are looking for namespace
- * @return targetNamespace or xmlns or null
- */
-
- private static Namespace findTargetNS(Element childElement)
- {
- String strNS = childElement.valueOf("@targetNamespace");
- Namespace retNS;
- if(strNS.equals(""))
- {
- if(childElement.isRootElement())
- {
- retNS = childElement.getNamespace();
- }
- else
- {
- retNS = findTargetNS(childElement.getParent());
- }
- }
- else
- retNS = new Namespace("",strNS);
- return retNS;
- }
-
private void processCorrelations(Element correlationsElement, Invoke invoke,
DeployerContext context) throws DBSessionException {
Modified: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/ReceiveDeployer.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/ReceiveDeployer.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/ReceiveDeployer.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/ReceiveDeployer.java Wed Jan 4 13:19:47 2006
@@ -19,6 +19,8 @@
import org.dom4j.Attribute;
import org.dom4j.Element;
+import org.dom4j.QName;
+import org.apache.agila.bpel.common.util.NSUtil;
import org.apache.agila.bpel.common.util.StringUtil;
import org.apache.agila.bpel.deployer.exception.DeploymentException;
import org.apache.agila.bpel.deployer.priv.context.DeployerContext;
@@ -27,7 +29,6 @@
import org.apache.agila.bpel.engine.priv.core.definition.ActivityFactory;
import org.apache.agila.bpel.engine.priv.core.definition.CorrelationRef;
import org.apache.agila.bpel.engine.priv.core.definition.Receive;
-import org.dom4j.Namespace;
public class ReceiveDeployer extends ActivityDeployer {
@@ -70,29 +71,16 @@
}*/
Attribute portType = element.attribute("portType");
if (portType != null) {
- String strNS = null;
- String portTypeStr = portType.getValue();
- int sepIndex = portTypeStr.indexOf(AgilaDeployerImpl.NS_SEPARATOR);
- if (sepIndex > 0) {
- strNS = portTypeStr.substring(0,sepIndex);
- portTypeStr = portTypeStr.substring(sepIndex + 1, portTypeStr.length());
- Namespace foundNS = findNS(element,strNS); //strNS acts first as prefix
- if(foundNS == null)
- throw new DeploymentException("Could not find Namespace for prefix " + strNS);
- strNS = foundNS.getURI();
- }
- else
- {
- Namespace foundNS = findTargetNS(element); //strNS acts first as prefix
- if(foundNS == null)
- throw new DeploymentException("Could not find targetNamespace or default Namespace xmlns for prefix ");
- strNS = foundNS.getURI();
- }
-
-
- log.debug("portType={" + strNS + "}" + portTypeStr);
- receive.setPortType(portTypeStr);
- receive.setNamespace(strNS);
+ try{
+ String portTypeStr = portType.getValue();
+ QName pTypeQname = NSUtil.findAsQname(portTypeStr,element);
+ log.debug("portType={" + pTypeQname.getNamespaceURI() + "}" + pTypeQname.getName());
+ receive.setPortType(pTypeQname.getName());
+ receive.setNamespace(pTypeQname.getNamespaceURI());
+
+ }catch (Exception e) {
+ throw new DeploymentException(e);
+ }
}
@@ -116,53 +104,6 @@
}
context.addActivityEvent(activity, element, DeployerContext.RECEIVE_DEPLOYED_EVENT);
}
-
- /**
- * looks for namespaces according to prefixes, it search recursively to the root element
- * @param childElement element, from which we are looking for namespace
- * @param prefix prefix, for which we want to find defined namespace
- * @return namespace defined for prefix or null
- */
-
- private Namespace findNS(Element childElement,String prefix)
- {
- Namespace retNS = childElement.getNamespaceForPrefix(prefix);
- if(retNS==null && !childElement.isRootElement())
- {
- //Element parent = childElement.getParent();
- retNS = findNS(childElement.getParent(),prefix);
- }
- return retNS;
- }
-
- /**
- * tries to find targetNamespace for element, or xmlns of root element, if no targetNamespace was found
- *
- * @param childElement element, from which we are looking for namespace
- * @return targetNamespace or xmlns or null
- */
-
- private static Namespace findTargetNS(Element childElement)
- {
- String strNS = childElement.valueOf("@targetNamespace");
- Namespace retNS;
- if(strNS.equals(""))
- {
- if(childElement.isRootElement())
- {
- retNS = childElement.getNamespace();
- }
- else
- {
- retNS = findTargetNS(childElement.getParent());
- }
- }
- else
- retNS = new Namespace("",strNS);
- return retNS;
- }
-
-
private void processCorrelations(Element correlationsElement, Receive receive,
DeployerContext context) throws DBSessionException {
Modified: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/ReplyDeployer.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/ReplyDeployer.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/ReplyDeployer.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/ReplyDeployer.java Wed Jan 4 13:19:47 2006
@@ -19,6 +19,8 @@
import org.dom4j.Attribute;
import org.dom4j.Element;
+import org.dom4j.QName;
+import org.apache.agila.bpel.common.util.NSUtil;
import org.apache.agila.bpel.deployer.exception.DeploymentException;
import org.apache.agila.bpel.deployer.priv.context.ActivityEvent;
import org.apache.agila.bpel.deployer.priv.context.DeployerContext;
@@ -28,7 +30,6 @@
import org.apache.agila.bpel.engine.priv.core.definition.CorrelationRef;
import org.apache.agila.bpel.engine.priv.core.definition.Receive;
import org.apache.agila.bpel.engine.priv.core.definition.Reply;
-import org.dom4j.Namespace;
/**
* <reply partnerLink="ncname" portType="qname" operation="ncname"
@@ -69,31 +70,18 @@
}*/
Attribute portType = element.attribute("portType");
if (portType != null) {
- String strNS = null;
- String portTypeStr = portType.getValue();
- int sepIndex = portTypeStr.indexOf(AgilaDeployerImpl.NS_SEPARATOR);
- if (sepIndex > 0) {
- strNS = portTypeStr.substring(0,sepIndex);
- portTypeStr = portTypeStr.substring(sepIndex + 1, portTypeStr.length());
-
- Namespace foundNS = findNS(element,strNS); //strNS acts first as prefix
- if(foundNS == null)
- throw new DeploymentException("Could not find Namespace for prefix " + strNS);
- strNS = foundNS.getURI();
- }
- else
- {
- Namespace foundNS = findTargetNS(element); //strNS acts first as prefix
- if(foundNS == null)
- throw new DeploymentException("Could not find targetNamespace or default Namespace xmlns for prefix ");
- strNS = foundNS.getURI();
- }
-
-
- log.debug("portType={" + strNS + "}" + portTypeStr);
- reply.setPortType(portTypeStr);
- reply.setNamespace(strNS);
+ try{
+ String portTypeStr = portType.getValue();
+ QName pTypeQname = NSUtil.findAsQname(portTypeStr,element);
+ log.debug("portType={" + pTypeQname.getNamespaceURI() + "}" + pTypeQname.getName());
+ reply.setPortType(pTypeQname.getName());
+ reply.setNamespace(pTypeQname.getNamespaceURI());
+
+ }catch (Exception e) {
+ throw new DeploymentException(e);
+ }
}
+
@@ -125,52 +113,6 @@
}
}
-
-
- /**
- * looks for namespaces according to prefixes, it search recursively to the root element
- * @param childElement element, from which we are looking for namespace
- * @param prefix prefix, for which we want to find defined namespace
- * @return namespace defined for prefix or null
- */
-
- private Namespace findNS(Element childElement,String prefix)
- {
- Namespace retNS = childElement.getNamespaceForPrefix(prefix);
- if(retNS==null && !childElement.isRootElement())
- {
- //Element parent = childElement.getParent();
- retNS = findNS(childElement.getParent(),prefix);
- }
- return retNS;
- }
-
- /**
- * tries to find targetNamespace for element, or xmlns of root element, if no targetNamespace was found
- *
- * @param childElement element, from which we are looking for namespace
- * @return targetNamespace or xmlns or null
- */
-
- private static Namespace findTargetNS(Element childElement)
- {
- String strNS = childElement.valueOf("@targetNamespace");
- Namespace retNS;
- if(strNS.equals(""))
- {
- if(childElement.isRootElement())
- {
- retNS = childElement.getNamespace();
- }
- else
- {
- retNS = findTargetNS(childElement.getParent());
- }
- }
- else
- retNS = new Namespace("",strNS);
- return retNS;
- }
protected void processSpecificElements(Element element, Activity activity,
DeployerContext context) throws DeploymentException {
@@ -197,7 +139,7 @@
boolean initiate = initiateAtt != null ? (initiateAtt.getValue().equals("yes") ? true : false) : false;
Attribute patternAtt = correlation.attribute("pattern");
int pattern = patternAtt != null ? getCorrelationPattern(patternAtt.getValue()) : CorrelationRef.NONE;
- // todo
+ // TODO
// CorrelationRef correlationRef = ActivityFactory.addCorrelationRef(receive, set, initiate, pattern);
// log.debug(correlationRef);
}
Modified: incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestBPELValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestBPELValidator.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestBPELValidator.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestBPELValidator.java Wed Jan 4 13:19:47 2006
@@ -15,9 +15,12 @@
*/
package org.apache.agila.bpel.deployer;
+import java.util.List;
+
import junit.framework.TestCase;
-import org.apache.agila.bpel.deployer.priv.validate.bpel.BPELValidator;
+
import org.apache.agila.bpel.common.configuration.XMLConfigurationReader;
+import org.apache.agila.bpel.deployer.priv.validate.bpel.BPELValidator;
/**
* @author mriou
@@ -37,12 +40,12 @@
}
public void testErrorValidation() {
- String[] errors = new BPELValidator().validate("engine/deployer/src/test/resources/error-process.bpel.xml");
- for (int m = 0; m < errors.length; m++) {
- String error = errors[m];
+ List errors = new BPELValidator().validate("engine/deployer/src/test/resources/error-process.bpel.xml");
+ for (int m = 0; m < errors.size(); m++) {
+ String error = (String)errors.get(m);
System.out.println(error);
}
- assertEquals(9, errors.length);
+ assertEquals(9, errors.size());
}
}
Modified: incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestDeployer.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestDeployer.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestDeployer.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestDeployer.java Wed Jan 4 13:19:47 2006
@@ -15,30 +15,25 @@
*/
package org.apache.agila.bpel.deployer;
+import java.util.HashMap;
+import java.util.Map;
+
import junit.framework.TestCase;
-import org.dom4j.Document;
-import org.dom4j.DocumentHelper;
-import org.dom4j.Element;
-import org.apache.agila.bpel.engine.common.transaction.TransactionManager;
-import org.apache.agila.bpel.engine.common.lifecycle.LifecycleManager;
+import net.sf.hibernate.cfg.Configuration;
+import net.sf.hibernate.tool.hbm2ddl.SchemaExport;
+
import org.apache.agila.bpel.common.util.StringUtil;
-import org.apache.agila.bpel.engine.priv.core.definition.AgilaProcess;
-import org.apache.agila.bpel.engine.priv.core.definition.ProcessFactory;
+import org.apache.agila.bpel.engine.AgilaEngineFactory;
+import org.apache.agila.bpel.engine.common.lifecycle.LifecycleManager;
+import org.apache.agila.bpel.engine.common.transaction.TransactionManager;
import org.apache.agila.bpel.engine.priv.core.dynamic.ProcessInstance;
import org.apache.agila.bpel.engine.priv.core.dynamic.ProcessInstanceFactory;
import org.apache.agila.bpel.engine.priv.core.dynamic.impl.xao.VariableXAO;
-import org.apache.agila.bpel.engine.AgilaEngineFactory;
-import org.apache.agila.bpel.engine.AgilaEngine;
-import org.apache.agila.bpel.deployer.*;
import org.apache.agila.bpel.util.BeanTester;
import org.apache.agila.bpel.util.EngineResultTester;
-import org.apache.agila.bpel.common.util.StringUtil;
-
-import java.util.Map;
-import java.util.HashMap;
-
-import net.sf.hibernate.tool.hbm2ddl.SchemaExport;
-import net.sf.hibernate.cfg.Configuration;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
/**
* had test ressources package in the classpath
@@ -79,7 +74,7 @@
Document doc = DocumentHelper.createDocument();
Element root = doc.addElement("message").addElement("main");
root.addElement("counter").setText("0");
- root.addElement("counterId").setText(counterId);
+ root.addElement("counterId").setText(counterId);
Document result = AgilaEngineFactory.getEngine()
.acknowledge("loopPartner","", "loopPort", "loopOp", doc);
Modified: incubator/agila/trunk/modules/bpel/engine/user/src/test/junit/org/apache/agila/bpel/user/TestAgilaUserLdapImpl.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/user/src/test/junit/org/apache/agila/bpel/user/TestAgilaUserLdapImpl.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/user/src/test/junit/org/apache/agila/bpel/user/TestAgilaUserLdapImpl.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/user/src/test/junit/org/apache/agila/bpel/user/TestAgilaUserLdapImpl.java Wed Jan 4 13:19:47 2006
@@ -22,7 +22,7 @@
/**
* LDAP has to be configurated (agila-configuration-ldap.xml),
* @author grofcik
- * @version $Id: TestAgilaUserLdapImpl.java,v 1.1 2004/12/29 14:52:39 chudikm Exp $
+ * @version $Id: TestAgilaUserLdapImpl.java,v 1.1 2005/12/08 12:11:19 steffen.horlacher Exp $
*/
public class TestAgilaUserLdapImpl extends TestCase {
Modified: incubator/agila/trunk/modules/bpel/engine/wsa/project.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/wsa/project.xml?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/wsa/project.xml (original)
+++ incubator/agila/trunk/modules/bpel/engine/wsa/project.xml Wed Jan 4 13:19:47 2006
@@ -17,6 +17,7 @@
</description>
<dependencies>
+ &dependency-addressing;
&dependency-asm;
&dependency-c3p0;
&dependency-cglib;
@@ -62,7 +63,7 @@
&dependency-wsdl4j;
&dependency-xerces;
&dependency-xindice;
- &dependency-wsdl4j;
+ &dependency-wsdl4j;
&dependency-xml-apis;
&dependency-xmldb-api;
&dependency-xmldb-api-sdk;
@@ -72,7 +73,6 @@
&dependency-xstream;
&dependency-xstream-xpp3;
</dependencies>
-
<build>
<sourceDirectory>src/java</sourceDirectory>
<unitTestSourceDirectory>src/test/junit</unitTestSourceDirectory>
@@ -86,6 +86,15 @@
<directory>src/aspect</directory>
<includes><include>**/*.*</include></includes>
</resource>
+ <resource>
+ <directory>src/hibernate</directory>
+ <includes><include>**/*.*</include></includes>
+ </resource>
+ <resource>
+ <directory>src/axis</directory>
+ <includes><include>**/*.*</include></includes>
+ </resource>
+
</resources>
<nagEmailAddress>wf-agila-devel@lists.sourceforge.net</nagEmailAddress>
Added: incubator/agila/trunk/modules/bpel/engine/wsa/src/axis/client-config.wsdd
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/wsa/src/axis/client-config.wsdd?rev=365997&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/wsa/src/axis/client-config.wsdd (added)
+++ incubator/agila/trunk/modules/bpel/engine/wsa/src/axis/client-config.wsdd Wed Jan 4 13:19:47 2006
@@ -0,0 +1,17 @@
+<deployment name="test" xmlns="http://xml.apache.org/axis/wsdd/"
+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+ <handler name="addr"
+ type="java:org.apache.axis.message.addressing.handler.AddressingHandler" />
+ <globalConfiguration>
+ <requestFlow>
+ <handler type="addr"/>
+ </requestFlow>
+ <responseFlow>
+ <handler type="addr"/>
+ </responseFlow>
+ </globalConfiguration>
+
+ <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
+ <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>
+ <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
+</deployment>
\ No newline at end of file
Modified: incubator/agila/trunk/modules/bpel/engine/wsa/src/java/org/apache/agila/bpel/wsa/EngineAdminWSA.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/wsa/src/java/org/apache/agila/bpel/wsa/EngineAdminWSA.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/wsa/src/java/org/apache/agila/bpel/wsa/EngineAdminWSA.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/wsa/src/java/org/apache/agila/bpel/wsa/EngineAdminWSA.java Wed Jan 4 13:19:47 2006
@@ -127,6 +127,24 @@
throw re;
}
}
+
+ public void deleteTerminatedInstance(long instanceId) throws EngineException {
+ try{
+ AgilaEngineAdminFactory.getEngineAdmin().deleteTerminatedInstance(instanceId);
+ } catch (RuntimeException re) {
+ log.error("A RuntimeException has been caught in EngineAdminWSA", re);
+ throw re;
+ }
+ }
+
+ public void terminateInstance(long instanceId) throws EngineException {
+ try{
+ AgilaEngineAdminFactory.getEngineAdmin().terminateInstance(instanceId);
+ } catch (RuntimeException re) {
+ log.error("A RuntimeException has been caught in EngineAdminWSA", re);
+ throw re;
+ }
+ }
/**
* Gets all messages that the engine has sent. Returns a map holding as key a string with
Modified: incubator/agila/trunk/modules/bpel/engine/wsa/src/java/org/apache/agila/bpel/wsa/EngineWSA.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/wsa/src/java/org/apache/agila/bpel/wsa/EngineWSA.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/wsa/src/java/org/apache/agila/bpel/wsa/EngineWSA.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/wsa/src/java/org/apache/agila/bpel/wsa/EngineWSA.java Wed Jan 4 13:19:47 2006
@@ -16,7 +16,6 @@
package org.apache.agila.bpel.wsa;
import java.util.Iterator;
-import java.util.Vector;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
@@ -24,6 +23,11 @@
import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPHeader;
+import org.apache.agila.bpel.engine.AgilaEngineFactory;
+import org.apache.agila.bpel.engine.exception.ConflictingReceiveException;
+import org.apache.agila.bpel.engine.exception.CorrelationViolationException;
+import org.apache.agila.bpel.engine.exception.SelectionFailureException;
+import org.apache.agila.bpel.engine.exception.UninitializedVariableException;
import org.apache.axis.AxisFault;
import org.apache.axis.message.SOAPBody;
import org.apache.axis.message.SOAPBodyElement;
@@ -36,12 +40,6 @@
import org.dom4j.io.DOMReader;
import org.dom4j.io.DOMWriter;
import org.dom4j.tree.AbstractElement;
-import org.apache.agila.bpel.engine.AgilaEngineFactory;
-import org.apache.agila.bpel.engine.exception.ConflictingReceiveException;
-import org.apache.agila.bpel.engine.exception.CorrelationViolationException;
-import org.apache.agila.bpel.engine.exception.SelectionFailureException;
-import org.apache.agila.bpel.engine.exception.UninitializedVariableException;
-import org.w3c.dom.Attr;
/**
* Web Services Adapter for the Agila Engine, it receives all messages sent to
@@ -51,28 +49,34 @@
private static final Logger log = Logger.getLogger(EngineWSA.class);
- private static final String MESSAGE_NS = "http://www.apache.org/agila/types/message";
- private static final String SOAP_ATTRIBUTE_NS = "http://www.apache.org/agila";
- private static final String SOAP_ATTRIBUTE_PARTNER = "partner";
- private static final String SOAP_ATTRIBUTE_PORTTYPE = "port";
- private static final String SOAP_ATTRIBUTE_OPERATION = "operation";
- private static final String SOAP_ATTRIBUTE_NAMESPACE = "namespace";
+ protected static final String MESSAGE_NS = "http://www.apache.org/agila/types/message";
+ protected static final String SOAP_ATTRIBUTE_NS = "http://www.apache.org/agila";
+ protected static final String SOAP_ATTRIBUTE_PARTNER = "partner";
+ protected static final String SOAP_ATTRIBUTE_PORTTYPE = "port";
+ protected static final String SOAP_ATTRIBUTE_OPERATION = "operation";
+ protected static final String SOAP_ATTRIBUTE_NAMESPACE = "namespace";
private DOMReader domReader;
private DOMWriter domWriter;
- private org.w3c.dom.Document sendToEngine(String partner, String namespace, String port, String operation, org.w3c.dom.Document message)
+ protected org.w3c.dom.Document sendToEngine(String partner, String namespace, String port, String operation, org.w3c.dom.Document message)
throws Exception {
Document dom4jMsg = getDomReader().read(message);
Element msgElmt = null;
if (dom4jMsg.getRootElement().element("agila-msg") != null) {
- msgElmt = dom4jMsg.getRootElement().element("agila-msg").element("message");
+ msgElmt = dom4jMsg.getRootElement().element("agila-msg").element("message");
} else {
- msgElmt = dom4jMsg.getRootElement();
- msgElmt.setName("message");
- msgElmt.remove(msgElmt.getNamespace());
+ msgElmt = dom4jMsg.getRootElement();
+ // List nss = msgElmt.declaredNamespaces();
+ //TODO: s.h. namespace handling ....
+ msgElmt.setName("message");
+ msgElmt.remove(msgElmt.getNamespace());
+ //for (Iterator iter = nss.iterator(); iter.hasNext();) {
+ // Namespace element = (Namespace) iter.next();
+ // msgElmt.add(element);
+ //}
}
Document msgDoc = DocumentHelper.createDocument((Element) msgElmt.detach());
@@ -153,7 +157,7 @@
} catch (CorrelationViolationException e) {
log.error("An error occured when acknowledging a message", e);
dom4jReply = DocumentHelper.createDocument();
- dom4jReply.addElement("bpws:correlationViolation",
+ dom4jReply.addElement("bpws:correlationViolation",
"http://schemas.xmlsoap.org/ws/2003/03/business-process/")
.setText(e.toString());
} catch (ConflictingReceiveException e) {
@@ -244,7 +248,12 @@
fault.setFaultString("No partner, portType or operation are included in the message.");
} else {
try {
- docResponse = sendToEngine(partner, namespace, port, operation, ((SOAPBody)request.getBody()).getAsDocument());
+ // TODO: s.h. namespace handling...
+ if(namespace == null) {
+ docResponse = sendToEngine(partner, port, operation, ((SOAPBody)request.getBody()).getAsDocument());
+ } else {
+ docResponse = sendToEngine(partner, port, operation, ((SOAPBody)request.getBody()).getAsDocument());
+ }
} catch (CorrelationViolationException e) {
log.error("An error occured when acknowledging a message", e);
SOAPFault fault = response.getBody().addFault();
@@ -395,7 +404,7 @@
}
- private boolean origined(Throwable e, Class aClass) {
+ protected boolean origined(Throwable e, Class aClass) {
while (e != null) {
if (aClass.isAssignableFrom(e.getClass())) {
return true;
Modified: incubator/agila/trunk/modules/bpel/engine/wsa/src/test/resources/hibernate.cfg.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/wsa/src/test/resources/hibernate.cfg.xml?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/wsa/src/test/resources/hibernate.cfg.xml (original)
+++ incubator/agila/trunk/modules/bpel/engine/wsa/src/test/resources/hibernate.cfg.xml Wed Jan 4 13:19:47 2006
@@ -46,6 +46,8 @@
<mapping resource="org/apache/agila/bpel/engine/executionevent.hbm.xml"/>
<mapping resource="org/apache/agila/bpel/engine/link.hbm.xml"/>
<mapping resource="org/apache/agila/bpel/engine/messageevent.hbm.xml"/>
+ <mapping resource="org/apache/agila/bpel/engine/partnerlink.hbm.xml"/>
+ <mapping resource="org/apache/agila/bpel/engine/partnerlinkrole.hbm.xml"/>
<mapping resource="org/apache/agila/bpel/engine/process.hbm.xml"/>
<mapping resource="org/apache/agila/bpel/engine/processinstance.hbm.xml"/>
<mapping resource="org/apache/agila/bpel/engine/property.hbm.xml"/>
Modified: incubator/agila/trunk/modules/bpel/engine/wsa/src/webapp/WEB-INF/server-config.wsdd
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/wsa/src/webapp/WEB-INF/server-config.wsdd?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/wsa/src/webapp/WEB-INF/server-config.wsdd (original)
+++ incubator/agila/trunk/modules/bpel/engine/wsa/src/webapp/WEB-INF/server-config.wsdd Wed Jan 4 13:19:47 2006
@@ -31,13 +31,16 @@
<parameter name="serviceName" value="SOAPMonitorService"/>
<parameter name="portName" value="Demo"/>
</handler>
+
+ <handler name="addressing"
+ type="java:org.apache.axis.message.addressing.handler.AddressingHandler" />
<service name="AgilaEngine" provider="java:MSG" style="message" use="literal">
<requestFlow>
- <handler type="soapmonitor"/>
+ <handler type="addressing"/>
</requestFlow>
<responseFlow>
- <handler type="soapmonitor"/>
+ <handler type="addressing"/>
</responseFlow>
<parameter name="allowedMethods" value="acknowledge"/>
<parameter name="className" value="org.apache.agila.bpel.wsa.EngineWSA"/>
Modified: incubator/agila/trunk/modules/bpel/samples/src/xml/example1/wsdef.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/samples/src/xml/example1/wsdef.xml?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/samples/src/xml/example1/wsdef.xml (original)
+++ incubator/agila/trunk/modules/bpel/samples/src/xml/example1/wsdef.xml Wed Jan 4 13:19:47 2006
@@ -5,12 +5,13 @@
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:wi="http://www.apache.org/agila/types/workitem/"
- xmlns:lns="http://www.apache.org/agila/samples/exemple1/definition/">
+ xmlns:lns="http://www.apache.org/agila/samples/exemple1/definition/"
+ xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
<message name="creditInformationMessage">
<part name="firstName" type="xsd:string"/>
<part name="lastName" type="xsd:string"/>
- <part name="amount" type="xsd:integer"/>
+ <part name="amount" type="xsd:integer"/>
</message>
<message name="approvalMessage">
<part name="accept" type="xsd:string"/>
@@ -28,23 +29,25 @@
<part name="lastName" type="xsd:string"/>
</message>
- <property name="customerFirstName" type="xsd:string"/>
- <propertyAlias propertyName="customerFirstName" messageType="creditInformationMessage" part="firstName"/>
- <propertyAlias propertyName="customerFirstName" messageType="approvalMessage" part="firstName"/>
- <propertyAlias propertyName="customerFirstName" messageType="riskAssessmentMessage" part="firstName"/>
-
- <property name="customerLastName" type="xsd:string"/>
- <propertyAlias propertyName="customerLastName" messageType="creditInformationMessage" part="lastName"/>
- <propertyAlias propertyName="customerLastName" messageType="approvalMessage" part="lastName"/>
- <propertyAlias propertyName="customerLastName" messageType="riskAssessmentMessage" part="lastName"/>
+ <bpel:property name="customerFirstName" type="xsd:string"/>
+ <bpel:propertyAlias propertyName="customerFirstName" messageType="creditInformationMessage" part="firstName"/>
+ <bpel:propertyAlias propertyName="customerFirstName" messageType="approvalMessage" part="firstName"/>
+ <bpel:propertyAlias propertyName="customerFirstName" messageType="riskAssessmentMessage" part="firstName"/>
+
+ <bpel:property name="customerLastName" type="xsd:string"/>
+ <bpel:propertyAlias propertyName="customerLastName" messageType="creditInformationMessage" part="lastName"/>
+ <bpel:propertyAlias propertyName="customerLastName" messageType="approvalMessage" part="lastName"/>
+ <bpel:propertyAlias propertyName="customerLastName" messageType="riskAssessmentMessage" part="lastName"/>
- <property name="workitem" type="xsd:string"/>
- <propertyAlias propertyName="workitem" messageType="workMessage" part="wipart" query="/workitemid"/>
+ <bpel:property name="workitem" type="xsd:string"/>
+ <bpel:propertyAlias propertyName="workitem" messageType="workMessage" part="wipart" query="/workitemid"/>
<portType name="loanServicePT">
<operation name="request">
<input message="lns:creditInformationMessage"/>
+ <!--
<fault name="unableToHandleRequest" message="lns:errorMessage"/>
+ -->
</operation>
<operation name="response">
<input message="lns:approvalMessage"/>
@@ -53,13 +56,17 @@
<portType name="riskAssessmentPT">
<operation name="check">
<input message="lns:creditInformationMessage"/>
+ <!--
<fault name="loanProcessFault" message="lns:errorMessage"/>
+ -->
</operation>
</portType>
<portType name="loanApprovalPT">
<operation name="approve">
<input message="lns:creditInformationMessage"/>
+ <!--
<fault name="loanProcessFault" message="lns:errorMessage"/>
+ -->
</operation>
</portType>
@@ -84,4 +91,4 @@
<plnk:portType name="lns:riskProcessorPT"/>
</plnk:role>
</plnk:partnerLinkType>
-</definitions>
\ No newline at end of file
+</definitions>