incubator-agila-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r165042 [23/30] - in /incubator/agila/trunk: ./ config/ modules/ modules/bpel/ modules/bpel/client/ modules/bpel/client/api/ modules/bpel/client/api/src/ modules/bpel/client/api/src/conf/ modules/bpel/client/api/src/java/ modules/bpel/client/api/src/java/org/ modules/bpel/client/api/src/java/org/apache/ modules/bpel/client/api/src/java/org/apache/agila/ modules/bpel/client/api/src/java/org/apache/agila/bpel/ modules/bpel/client/api/src/java/org/apache/agila/bpel/client/ modules/bpel/client/api/src/test/ modules/bpel/client/api/src/test/junit/ modules/bpel/client/api/src/test/junit/org/ modules/bpel/client/api/src/test/junit/org/apache/ modules/bpel/client/api/src/test/junit/org/apache/agila/ modules/bpel/client/api/src/test/junit/org/apache/agila/bpel/ modules/bpel/client/api/src/test/junit/org/apache/agila/bpel/client/ modules/bpel/client/web/ modules/bpel/client/web/src/ modules/bpel/client/web/src/conf/ modules/bpel/client/web/src/java/ modules/bpel/client/web/src/java/org/ modules/bpel/client/web/src/java/org/apache/ modules/bpel/client/web/src/java/org/apache/agila/ modules/bpel/client/web/src/java/org/apache/agila/bpel/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/common/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/form/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/form/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/global/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/global/action/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/security/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/security/action/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/security/form/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/user/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/user/action/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/user/form/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/util/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/ modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/ modules/bpel/client/web/src/webapp/ modules/bpel/client/web/src/webapp/META-INF/ modules/bpel/client/web/src/webapp/WEB-INF/ modules/bpel/client/web/src/webapp/WEB-INF/classes/ modules/bpel/client/web/src/webapp/images/ modules/bpel/client/web/src/webapp/images/audit/ modules/bpel/client/web/src/webapp/style/ modules/bpel/common/ modules/bpel/common/src/ modules/bpel/common/src/aspect/ modules/bpel/common/src/conf/ modules/bpel/common/src/java/ modules/bpel/common/src/java/org/ modules/bpel/common/src/java/org/apache/ modules/bpel/common/src/java/org/apache/agila/ modules/bpel/common/src/java/org/apache/agila/bpel/ modules/bpel/common/src/java/org/apache/agila/bpel/common/ modules/bpel/common/src/java/org/apache/agila/bpel/common/aspect/ modules/bpel/common/src/java/org/apache/agila/bpel/common/configuration/ modules/bpel/common/src/java/org/apache/agila/bpel/common/util/ modules/bpel/common/src/java/org/apache/agila/bpel/common/util/logger/ modules/bpel/common/src/test/ modules/bpel/common/src/test/junit/ modules/bpel/common/src/test/junit/org/ modules/bpel/common/src/test/junit/org/apache/ modules/bpel/common/src/test/junit/org/apache/agila/ modules/bpel/common/src/test/junit/org/apache/agila/bpel/ modules/bpel/common/src/test/junit/org/apache/agila/bpel/common/ modules/bpel/common/src/test/junit/org/apache/agila/bpel/common/util/ modules/bpel/dist/ modules/bpel/dist/src/ modules/bpel/dist/src/java/ modules/bpel/dist/src/java/org/ modules/bpel/dist/src/java/org/apache/ modules/bpel/dist/src/java/org/apache/agila/ modules/bpel/dist/src/java/org/apache/agila/bpel/ modules/bpel/dist/src/java/org/apache/agila/bpel/util/ modules/bpel/dist/src/script/ modules/bpel/engine/ modules/bpel/engine/common/ modules/bpel/engine/common/src/ modules/bpel/engine/common/src/aspect/ modules/bpel/engine/common/src/hibernate/ modules/bpel/engine/common/src/hibernate/org/ modules/bpel/engine/common/src/hibernate/org/apache/ modules/bpel/engine/common/src/hibernate/org/apache/agila/ modules/bpel/engine/common/src/hibernate/org/apache/agila/bpel/ modules/bpel/engine/common/src/hibernate/org/apache/agila/bpel/engine/ modules/bpel/engine/common/src/hibernate/org/apache/agila/bpel/engine/common/ modules/bpel/engine/common/src/java/ modules/bpel/engine/common/src/java/org/ modules/bpel/engine/common/src/java/org/apache/ modules/bpel/engine/common/src/java/org/apache/agila/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/aspect/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/event/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/event/execution/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/event/execution/impl/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/event/lifecycle/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/event/lifecycle/dao/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/lifecycle/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/monitoring/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/persistence/ modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/transaction/ modules/bpel/engine/common/src/test/ modules/bpel/engine/common/src/test/junit/ modules/bpel/engine/common/src/test/junit/org/ modules/bpel/engine/common/src/test/junit/org/apache/ modules/bpel/engine/common/src/test/junit/org/apache/agila/ modules/bpel/engine/common/src/test/junit/org/apache/agila/bpel/ modules/bpel/engine/common/src/test/junit/org/apache/agila/bpel/engine/ modules/bpel/engine/common/src/test/junit/org/apache/agila/bpel/engine/common/ modules/bpel/engine/common/src/test/junit/org/apache/agila/bpel/engine/common/event/ modules/bpel/engine/common/src/test/resources/ modules/bpel/engine/core/ modules/bpel/engine/core/src/ modules/bpel/engine/core/src/aspect/ modules/bpel/engine/core/src/hibernate/ modules/bpel/engine/core/src/hibernate/org/ modules/bpel/engine/core/src/hibernate/org/apache/ modules/bpel/engine/core/src/hibernate/org/apache/agila/ modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/ modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/ modules/bpel/engine/core/src/java/ modules/bpel/engine/core/src/java/org/ modules/bpel/engine/core/src/java/org/apache/ modules/bpel/engine/core/src/java/org/apache/agila/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/exception/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/dao/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/dao/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/xao/ modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/expression/ modules/bpel/engine/core/s
Date Wed, 27 Apr 2005 20:28:07 GMT
Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/WhileDeployer.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/WhileDeployer.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/WhileDeployer.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/WhileDeployer.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv;
+
+import org.dom4j.Attribute;
+import org.dom4j.Element;
+import org.apache.agila.bpel.deployer.exception.DeploymentException;
+import org.apache.agila.bpel.deployer.priv.context.DeployerContext;
+import org.apache.agila.bpel.engine.priv.core.definition.Activity;
+import org.apache.agila.bpel.engine.priv.core.definition.While;
+
+/**
+ * <while condition="bool-expr" standard-attributes>
+ * standard-elements
+ * activity
+ * </while>
+ */
+public class WhileDeployer extends ActivityDeployer {
+
+    protected Class getActivityClass() {
+        return While.class;
+    }
+
+    protected void processSpecificAttributes(Element element, Activity activity, 
+            DeployerContext context) {
+        
+        While awhile = (While) activity;
+        Attribute condition = element.attribute("condition");
+        if (condition != null) {
+            log.debug("condition=" + condition.getValue());
+            awhile.setCondition(condition.getValue());
+        }
+    }
+
+    protected void processSpecificElements(Element element, Activity activity, 
+            DeployerContext context) throws DeploymentException {
+//        for (Iterator i = element.elementIterator(); i.hasNext();) {
+//            Element elem = (Element) i.next();
+//            ActivityDeployer ad = ActivityDeployerFactory.getActivityDeployer(elem.getName());
+//            ad.deploy(elem, (StructuredActivity) activity);
+//        }
+    }
+
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/context/ActivityEvent.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/context/ActivityEvent.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/context/ActivityEvent.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/context/ActivityEvent.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.context;
+
+import org.dom4j.Node;
+import org.apache.agila.bpel.engine.priv.core.definition.Activity;
+
+
+/**
+ * @author mriou
+ */
+public class ActivityEvent {
+    public static final int NEW = 0;
+    public static final int PROCESSED = 1;
+    
+    private int status = 0;
+    private Activity activity;
+    private Node node;
+    
+    public ActivityEvent(Activity activity, Node node) {
+        this.activity = activity;
+        this.node = node;
+    }        
+    public Activity getActivity() {
+        return activity;
+    }
+    public Node getNode() {
+        return node;
+    }
+    public int getStatus() {
+        return status;
+    }
+    public void markProcessed() {
+        status = PROCESSED;
+    }
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/context/DeployerContext.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/context/DeployerContext.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/context/DeployerContext.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/context/DeployerContext.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.context;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+
+import org.dom4j.Node;
+import org.apache.agila.bpel.engine.priv.core.definition.Activity;
+import org.apache.agila.bpel.engine.priv.core.definition.Receive;
+
+
+/**
+ * The deployer context provides contextual informtion about the deployment. This allows
+ * deployers to know what happened before they get called  and react accordingly or 
+ * eventually update already created structures. 
+ * @author mriou
+ */
+public class DeployerContext {
+    
+    public static final Long RECEIVE_DEPLOYED_EVENT = new Long(0);    
+    
+    private Map eventMap = new HashMap();
+    
+    public void addActivityEvent(Activity activity, Node node, Long event) {
+        Object eventValue = eventMap.get(event);
+        if (eventValue == null) {
+            LinkedList eventList = new LinkedList();
+            eventList.add(new ActivityEvent(activity, node));
+            eventMap.put(event, eventList);
+        } else {
+            LinkedList eventList = (LinkedList)eventValue;
+            eventList.add(new ActivityEvent(activity, node));
+        }
+    }
+    
+    public ActivityEvent getReceiveDeployedEvent(String partner, String namespace, String  port, String operation) {
+        LinkedList eventList = (LinkedList) eventMap.get(RECEIVE_DEPLOYED_EVENT);
+        if (eventList != null) {
+            for (Iterator eventIter = eventList.iterator(); eventIter.hasNext();) {
+                ActivityEvent event = (ActivityEvent) eventIter.next();
+                Receive receive = (Receive) event.getActivity();
+                if (receive.getOperation().equals(operation) 
+                        && receive.getPartner().equals(partner)
+                    && receive.getPortType().equals(port)
+                    && receive.getNamespace().equals(namespace)
+                        && event.getStatus() == ActivityEvent.NEW) {
+                    return event;
+                }
+            }
+        }
+        return null;
+    }
+    
+    public ActivityEvent getReceiveDeployedEvent(String partner, String port, String operation) {
+        LinkedList eventList = (LinkedList) eventMap.get(RECEIVE_DEPLOYED_EVENT);
+        if (eventList != null) {
+            for (Iterator eventIter = eventList.iterator(); eventIter.hasNext();) {
+                ActivityEvent event = (ActivityEvent) eventIter.next();
+                Receive receive = (Receive) event.getActivity();
+                if (receive.getOperation().equals(operation) 
+                        && receive.getPartner().equals(partner)
+                        && receive.getPortType().equals(port)
+                        && event.getStatus() == ActivityEvent.NEW) {
+                    return event;
+                }
+            }
+        }
+        return null;
+    }
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/ValidationException.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/ValidationException.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/ValidationException.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/ValidationException.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate;
+
+/**
+ * @author mriou
+ */
+public class ValidationException extends Exception {
+
+    public ValidationException(String message) {
+        super(message);
+    }
+
+    public ValidationException(Throwable cause) {
+        super(cause);
+    }
+
+    public ValidationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/BPELNodeValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/BPELNodeValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/BPELNodeValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/BPELNodeValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.XPath;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Validates a specific node (attribute or element) in a BPEL document.
+ * @author mriou
+ */
+public abstract class BPELNodeValidator {
+
+    protected static String ERROR = "ERROR";
+    protected static String WARNING = "WARNING";
+
+    /**
+     * Validates a node inside a document.
+     * @param bpelDoc
+     * @return a List of error or warning messages
+     */
+    public abstract List validate(Document bpelDoc);
+
+    /**
+     * @return the error type if something wrong is found (error or warning).
+     */
+    protected abstract String errorType();
+
+    /**
+     * @param xpathExpr
+     * @param nsMap
+     * @return An XPath instance represenging the provided path initialized with provided namespaces.
+     */
+    protected XPath getXPath(String xpathExpr, Map nsMap) {
+        XPath xPath = DocumentHelper.createXPath(xpathExpr);
+        xPath.setNamespaceURIs(nsMap);
+        return xPath;
+    }
+
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/BPELValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/BPELValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/BPELValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/BPELValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel;
+
+import org.apache.log4j.Logger;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.io.SAXReader;
+import org.apache.agila.bpel.common.configuration.DeployerConfiguration;
+import org.apache.agila.bpel.common.configuration.XMLConfigurationReader;
+import org.apache.agila.bpel.common.configuration.ConfigurationException;
+import org.apache.agila.bpel.common.util.StringUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Validates the WS-BPEL description of a process. Also relies on the
+ * related WSDL documents to validate web services invocations.
+ * @author mriou
+ */
+public class BPELValidator {
+
+    private Logger log = Logger.getLogger(getClass());
+
+    /**
+     * Validates a BPEL process description.
+     * @param bpelDocLocation
+     * @return the error code ("0" if no error).
+     */
+    public String[] validate(String bpelDocLocation) {
+        ArrayList result = new ArrayList();
+        Document bpelDoc = null;
+        try {
+            bpelDoc = getReader().read(bpelDocLocation);
+        } catch (DocumentException e) {
+            result.add("ERROR: Could not find BPEL document " + bpelDocLocation + " or could not read it.");
+        }
+        List validators = DeployerConfiguration.getValidators();
+        for (int m = 0; m < validators.size(); m++) {
+            String className = (String) validators.get(m);
+            System.out.println("** " + className);
+            BPELNodeValidator nodeValidator = null;
+            try {
+                nodeValidator = (BPELNodeValidator) Class.forName(className).newInstance();
+            } catch (InstantiationException e) {
+                log.error("Could not instantiate a validator.", e);
+            } catch (IllegalAccessException e) {
+                log.error("Could not access a validator.", e);
+            } catch (ClassNotFoundException e) {
+                log.error("Could not find a validator.", e);
+            }
+            result.addAll(nodeValidator.validate(bpelDoc));
+        }
+        return StringUtil.toStringArray(result);
+    }
+
+    private SAXReader reader;
+    private SAXReader getReader() {
+        if (reader == null) {
+            reader = new SAXReader();
+        }
+        return reader;
+    }
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/complex/CreateInstanceCorrelationValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/complex/CreateInstanceCorrelationValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/complex/CreateInstanceCorrelationValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/complex/CreateInstanceCorrelationValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.complex;
+
+import org.apache.agila.bpel.deployer.priv.validate.bpel.BPELNodeValidator;
+import org.dom4j.Document;
+import org.dom4j.Namespace;
+import org.dom4j.Element;
+import org.dom4j.Node;
+
+import java.util.List;
+import java.util.HashMap;
+import java.util.ArrayList;
+
+/**
+ * As per paragraph 11.4 of WS-BPEL specs, all receive activities (or pick) with the
+ * createInstance attribute MUST use the same correlation set.
+ * @author mriou
+ */
+public class CreateInstanceCorrelationValidator extends BPELNodeValidator {
+
+    private static final String CREATEINSTANCE_RECEIVE =
+            "//ns:receive[@createInstance = 'yes' and correlations]";
+    private static final String CREATEINSTANCE_PICK =
+            "//ns:pick[@createInstance = 'yes' and correlations]";
+    private static final String CREATEINSTANCE_ALL =
+            "//ns:receive[@createInstance='yes'] | //ns:pick[@createInstance='yes'] " +
+            "//ns:receive[@createInstance='true'] | //ns:pick[@createInstance='true']";
+
+    private static final String CREATEINSTANCE_RECEIVE_CORR =
+            "//ns:receive[@createInstance]/ns:correlations/ns:correlation[@set!='##']";
+    private static final String CREATEINSTANCE_PICK_CORR =
+            "//ns:pick[@createInstance]/ns:onMessage/ns:correlations/ns:correlation[@set!='##']";
+
+    public List validate(Document bpelDoc) {
+        Namespace defaultNS = bpelDoc.getRootElement().getNamespace();
+        HashMap nsMap = new HashMap(1);
+        nsMap.put("ns", defaultNS.getURI());
+
+        ArrayList results = new ArrayList(0);
+        List ciReceives = getXPath(CREATEINSTANCE_RECEIVE, nsMap).selectNodes(bpelDoc);
+        List ciPicks = getXPath(CREATEINSTANCE_PICK, nsMap).selectNodes(bpelDoc);
+
+        // First finding out the first correlation name to use as reference, all other correlations
+        // must use the same one.
+        String corrName = null;
+        if (ciReceives.size() > 0) {
+            corrName = ((Element)ciReceives.get(0)).element("correlations")
+                                .element("correlation").attribute("set").getText();
+        } else if (ciPicks.size() > 0) {
+            corrName = ((Element)ciPicks.get(0)).element("onMessage").element("correlations")
+                    .element("correlation").attribute("set").getText();
+        } else {
+            List allCreates = getXPath(CREATEINSTANCE_ALL, nsMap).selectNodes(bpelDoc);
+            if (allCreates.size() == 0) {
+                results.add(WARNING + ": Your process doesn't have any receive or pick activity with a createInstance " +
+                                "attribute, it can't be executed!");
+            }
+            return results;
+        }
+
+        // Then selecting all receive or pick with the createInstance attribute using another correlation
+        String receivesCorrStr = CREATEINSTANCE_RECEIVE_CORR.replaceAll("##", corrName);
+        String picksCorrStr = CREATEINSTANCE_PICK_CORR.replaceAll("##", corrName);
+        List ciReceivesCorr = getXPath(receivesCorrStr, nsMap).selectNodes(bpelDoc);
+        List ciPicksCorr = getXPath(picksCorrStr, nsMap).selectNodes(bpelDoc);
+        for (int m = 0; m < ciReceivesCorr.size(); m++) {
+            Node node = (Node) ciReceivesCorr.get(m);
+            results.add(errorType() + ": All receive activities with a createInstance attribute MUST use the " +
+                            "same correlation set. Correlation declared in node \n" + node.getParent().getParent().asXML() +
+                            "\nisn't using the " + corrName + " correlation.");
+        }
+        for (int m = 0; m < ciPicksCorr.size(); m++) {
+            Node node = (Node) ciPicksCorr.get(m);
+            results.add(errorType() + ": All pick activities with a createInstance attribute MUST use the " +
+                            "same correlation set. Correlation declared in node \n" + node.getParent().getParent().asXML() +
+                            "\nisn't using the " + corrName + " correlation.");
+        }
+
+        return results;
+    }
+
+    protected String errorType() {
+        return ERROR;
+    }
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/exclusivity/NodeExclusivityValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/exclusivity/NodeExclusivityValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/exclusivity/NodeExclusivityValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/exclusivity/NodeExclusivityValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.exclusivity;
+
+import org.apache.agila.bpel.deployer.priv.validate.bpel.BPELNodeValidator;
+import org.dom4j.Document;
+import org.dom4j.Namespace;
+import org.dom4j.Node;
+
+import java.util.List;
+import java.util.HashMap;
+import java.util.ArrayList;
+
+/**
+ * Checks node that are mutually exclusive. For example a variable definition
+ * can't have a messagetType, an element reference and a type reference but only
+ * one of the three. The exclusivity is checked using an XPath expression
+ * combining all possible node using an 'or' operator. The NodeSet returned
+ * must therefore contain only one node. This XPath expression is applied
+ * relatively to a root element defined by another XPath expression.
+ * @author mriou
+ */
+public abstract class NodeExclusivityValidator extends BPELNodeValidator {
+
+    public List validate(Document bpelDoc) {
+        Namespace defaultNS = bpelDoc.getRootElement().getNamespace();
+        HashMap nsMap = new HashMap(1);
+        nsMap.put("ns", defaultNS.getURI());
+
+        ArrayList results = new ArrayList(0);
+        List roots = getXPath(getRootXPath(), nsMap).selectNodes(bpelDoc);
+        for (int m = 0; m < roots.size(); m++) {
+            Node root = (Node) roots.get(m);
+            List exclusiveNodes = getXPath(getExclusivityXPath(), nsMap).selectNodes(root);
+            if (exclusiveNodes.size() != 1) {
+                results.add(errorType() + ": " + buildError(root));
+            }
+        }
+
+        return results;
+    }
+
+    /**
+     * A path selecting several nodes relatively to the root element that are
+     * mutually exclusive.
+     * @return
+     */
+    protected abstract String getExclusivityXPath();
+
+    /**
+     * The path of the root element the exclusivity path will be applied on.
+     * @return
+     */
+    protected abstract String getRootXPath();
+
+    /**
+     * Builds an error message using the root Node from which the exclusivity
+     * path is applied.
+     * @param rootNode
+     * @return
+     */
+    protected abstract String buildError(Node rootNode);
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/exclusivity/VariableTypeExclValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/exclusivity/VariableTypeExclValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/exclusivity/VariableTypeExclValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/exclusivity/VariableTypeExclValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.exclusivity;
+
+import org.dom4j.Node;
+
+import java.util.List;
+
+/**
+ * Simply making sure that a variable has exactly ONE type defined from messagetType,
+ * element reference and type reference.
+ * @author mriou
+ */
+public class VariableTypeExclValidator extends NodeExclusivityValidator {
+
+    private static final String ROOT_PATH = "/ns:process/ns:variables/ns:variable";
+    private static final String EXCLUSIVITY_PATH = "@messageType | @type | @element";
+
+    protected String getExclusivityXPath() {
+        return EXCLUSIVITY_PATH;
+    }
+
+    protected String getRootXPath() {
+        return ROOT_PATH;
+    }
+
+    protected String buildError(Node root) {
+        StringBuffer buf = new StringBuffer();
+        buf.append("You must provide EXACTLY ONE attribute from messageType, type or element in node: ");
+        buf.append(root.asXML());
+        return buf.toString();
+    }
+
+    protected String errorType() {
+        return ERROR;
+    }
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/CorrelationRefValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/CorrelationRefValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/CorrelationRefValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/CorrelationRefValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.reference;
+
+
+/**
+ * @author mriou
+ */
+public class CorrelationRefValidator extends ReferenceValidator {
+
+    private static final String REFERENCE = "//ns:correlation/@set";
+    private static final String DEFINITION = "/ns:process/ns:correlationSets/ns:correlationSet[@name='##']";
+
+    protected String getReferenceXPath() {
+        return REFERENCE;
+    }
+
+    protected String getDefinitonXPath() {
+        return DEFINITION;
+    }
+
+    protected String errorType() {
+        return ERROR;
+    }
+}
\ No newline at end of file

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/FromVariableRefValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/FromVariableRefValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/FromVariableRefValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/FromVariableRefValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.reference;
+
+import org.dom4j.Node;
+
+/**
+ * Validates the from element in an assignment to make sure that, if a part
+ * is provided, the related variable type is a messageType.
+ * @author mriou
+ */
+public class FromVariableRefValidator extends ReferenceValidator {
+
+    private static final String REFERENCE = "//ns:assign/ns:copy/ns:from/@part/../@variable";
+    private static final String DEFINITION = "/ns:process/ns:variables/ns:variable[@name='##']/@messageType";
+
+    protected String getReferenceXPath() {
+        return REFERENCE;
+    }
+
+    protected String getDefinitonXPath() {
+        return DEFINITION;
+    }
+
+    protected String errorType() {
+        return ERROR;
+    }
+
+    protected String buildError(Node reference) {
+        StringBuffer buf = new StringBuffer();
+        buf.append("The variable with name ");
+        buf.append(reference.getText());
+        buf.append(" isn't typed as a WSDL message. To use a part assignment using this variable in node ");
+        buf.append(reference.getParent().asXML());
+        buf.append(" it must be defined using a messageType and not an element or a type reference.");
+        return buf.toString();
+    }
+}
\ No newline at end of file

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/PartnerLinkRefValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/PartnerLinkRefValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/PartnerLinkRefValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/PartnerLinkRefValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.reference;
+
+
+/**
+ * Validates partner links references in an activity (like Invoke or Receive for example).
+ * @author mriou
+ */
+public class PartnerLinkRefValidator extends ReferenceValidator {
+
+    private static final String REFERENCE = "//@partnerLink/parent::*[@portType!='WorkListPT' and @portType!='WorkListAnswerPT']/@partnerLink";
+    private static final String DEFINITION = "/ns:process/ns:partnerLinks/ns:partnerLink[@name='##']";
+
+    protected String getReferenceXPath() {
+        return REFERENCE;
+    }
+
+    protected String getDefinitonXPath() {
+        return DEFINITION;
+    }
+
+    protected String errorType() {
+        return ERROR;
+    }
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/ReferenceValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/ReferenceValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/ReferenceValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/ReferenceValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.reference;
+
+import org.dom4j.Document;
+import org.dom4j.Namespace;
+import org.dom4j.Node;
+import org.apache.agila.bpel.deployer.priv.validate.bpel.BPELNodeValidator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * Validates from a first reference its definition. Basically applies a first XPath and
+ * evaluates a second path using the value returned by the first path. If the result of
+ * the second evaluation isn't a single value, an error message is produced.
+ * @author mriou
+ */
+public abstract class ReferenceValidator extends BPELNodeValidator {
+
+    private String REPLACE_PATTERN = "##";
+
+    /**
+     * Validates the document to check that there's exactly one definition for each
+     * reference.
+     * @param bpelDoc
+     * @return error messsages
+     */
+    public List validate(Document bpelDoc) {
+        Namespace defaultNS = bpelDoc.getRootElement().getNamespace();
+        HashMap nsMap = new HashMap(1);
+        nsMap.put("ns", defaultNS.getURI());
+
+        ArrayList results = new ArrayList(0);
+        List references = getXPath(getReferenceXPath(), nsMap).selectNodes(bpelDoc);
+        for (int m = 0; m < references.size(); m++) {
+            Node reference = (Node) references.get(m);
+            if (reference.getNodeType() == Node.ATTRIBUTE_NODE) {
+                String refValue = reference.getText();
+                String defXPath = getDefinitonXPath().replaceAll(REPLACE_PATTERN, refValue);
+                List definitions = null;
+                if (isAbsoluteReference()) {
+                    definitions = getXPath(defXPath, nsMap).selectNodes(bpelDoc);
+                } else {
+                    definitions = getXPath(defXPath, nsMap).selectNodes(reference);
+                }
+                if (definitions.size() != 1) {
+                    results.add(errorType() + ": " + buildError(reference));
+                }
+            }
+        }
+        return results;
+    }
+
+    /**
+     * An XPath expression pointing to the attribute which value hold a reference. For
+     * example something like '**\/@variable' will return all attributes referencing
+     * variables inside a document. All elements in the XPath expression should use the
+     * namespace prefix 'ns'.
+     * @return the XPath expression.
+     */
+    protected abstract String getReferenceXPath();
+
+    /**
+     * An XPath expression pointing to the definition of the reference. The expression will
+     * be pre-processed before being executed to replace '##' with the reference value. For
+     * example the variable definition's path is '/process/variables/variable[@name='##']'.
+     * The expression should return exactly one node. All elements in the XPath expression
+     * should use the namespace prefix 'ns'.
+     * @return the XPath expression
+     */
+    protected abstract String getDefinitonXPath();
+
+    /**
+     * Whether the definition path is relatve to the reference path or absolute. Default is
+     * absolute, subclasses using relatve definition path should override this.
+     * @return
+     */
+    protected boolean isAbsoluteReference() {
+        return true;
+    }
+
+    /**
+     * Builds an error message using the reference Node (node selected by the
+     * getReferenceXPath() expression). Can be overriden by subclasses needing
+     * a more specific message.
+     * @param reference
+     * @return
+     */
+    protected String buildError(Node reference) {
+        StringBuffer buf = new StringBuffer();
+        buf.append("No definition or more than one definition could be found for value ");
+        buf.append(reference.getText());
+        buf.append(" in element ");
+        buf.append(reference.getParent().asXML());
+        return buf.toString();
+    }
+
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/VariableRefValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/VariableRefValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/VariableRefValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/reference/VariableRefValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.reference;
+
+
+/**
+ * Validates a simple variable reference by making sure there's a variable
+ * definition for all variable, inputVariable and outputVariable attributes
+ * (in a receive, invoke or reply activity for example).
+ * @author mriou
+ */
+public class VariableRefValidator extends ReferenceValidator {
+
+    private static final String REFERENCE = "//@variable | " +
+                                                "//@inputVariable | " +
+                                                "//@outputVariable";
+
+    private static final String DEFINITION = "/ns:process/ns:variables/ns:variable[@name='##']";
+
+    protected String getReferenceXPath() {
+        return REFERENCE;
+    }
+
+    protected String getDefinitonXPath() {
+        return DEFINITION;
+    }
+
+    protected String errorType() {
+        return ERROR;
+    }
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/UnicityValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/UnicityValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/UnicityValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/UnicityValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.unicity;
+
+import org.dom4j.Document;
+import org.dom4j.Namespace;
+import org.dom4j.Node;
+import org.apache.agila.bpel.deployer.priv.validate.bpel.BPELNodeValidator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+
+/**
+ * Checks the unicity of an element's value within a document.
+ * @author mriou
+ */
+public abstract class UnicityValidator extends BPELNodeValidator {
+
+    public List validate(Document bpelDoc) {
+        Namespace defaultNS = bpelDoc.getRootElement().getNamespace();
+        HashMap nsMap = new HashMap(1);
+        nsMap.put("ns", defaultNS.getURI());
+
+        ArrayList results = new ArrayList(0);
+        List references = getXPath(getElementXPath(), nsMap).selectNodes(bpelDoc);
+        HashSet unicitySet = new HashSet();
+        for (int m = 0; m < references.size(); m++) {
+            Node reference = (Node) references.get(m);
+            String refValue = reference.getText();
+            if (unicitySet.contains(refValue)) {
+                StringBuffer buf = new StringBuffer();
+                buf.append(errorType());
+                buf.append(": Only one element can be defined using the attribute value ");
+                buf.append(refValue);
+                buf.append(" in element ");
+                buf.append(reference.getParent().asXML());
+                results.add(buf.toString());
+            } else {
+                unicitySet.add(refValue);
+            }
+        }
+        return results;
+    }
+
+    /**
+     * An XPath expression referring to element's value that must be unique inside
+     * a document. The unicity will be checked by verifying that two different
+     * elements returned by the expression don't have the same text().
+     * @return
+     */
+    protected abstract String getElementXPath();
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/VariableNameUnicityValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/VariableNameUnicityValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/VariableNameUnicityValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/VariableNameUnicityValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.unicity;
+
+
+/**
+ * @author mriou
+ */
+public class VariableNameUnicityValidator extends UnicityValidator {
+
+    private static final String VARIABLE_PATH = "/ns:process/ns:variables/ns:variable/@name";
+
+    protected String getElementXPath() {
+        return VARIABLE_PATH;
+    }
+
+    protected String errorType() {
+        return ERROR;
+    }
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/WorkItemVariableUnicity.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/WorkItemVariableUnicity.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/WorkItemVariableUnicity.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/bpel/unicity/WorkItemVariableUnicity.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.bpel.unicity;
+
+/**
+ * WorkItems in Agila are created using an invoke and a receive pair in
+ * the BPEL description, this class forces all variables used as outputVariable
+ * in the process for work item creation to be different.
+ * @author mriou
+ */
+public class WorkItemVariableUnicity extends UnicityValidator {
+
+    private static final String VARIABLE_PATH = "//ns:invoke[@portType='WorkListPT']/@outputVariable";
+    
+    protected String getElementXPath() {
+        return VARIABLE_PATH;
+    }
+
+    protected String errorType() {
+        return WARNING;
+    }
+
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/wsdl/WSDLValidator.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/wsdl/WSDLValidator.java?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/wsdl/WSDLValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/validate/wsdl/WSDLValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer.priv.validate.wsdl;
+
+import org.apache.agila.bpel.deployer.priv.validate.ValidationException;
+import org.apache.agila.bpel.common.configuration.DeployerConfiguration;
+import org.apache.agila.bpel.common.configuration.XMLConfigurationReader;
+import org.eclipse.wsdl.validate.ValidationReport;
+import org.eclipse.wsdl.validate.ValidationMessage;
+import org.eclipse.wsdl.validate.wsdl11.internal.WSDL11ValidatorDelegate;
+import org.eclipse.wsdl.validate.internal.xml.XMLCatalog;
+import org.eclipse.wsdl.validate.internal.ValidatorRegistry;
+import org.eclipse.wsdl.validate.internal.WSDLValidatorDelegate;
+
+/**
+ * Validates the WSDL description of a Web Service. Basically delegates to Eclipse WSVT.
+ * @author mriou
+ */
+public class WSDLValidator {
+
+    /**
+     * Validates a WSDL description.
+     * @param wsdlDocLocation the lcoation of the WSDL document once deployed
+     * @return a List of String containing all errors or warnings
+     */
+    public String[] validate(String wsdlDocLocation) throws ValidationException {
+        XMLCatalog.addSchemaDir(DeployerConfiguration.getSchemasDir());
+        XMLCatalog.addSchemaDir(DeployerConfiguration.getDeployDir());
+        XMLCatalog.getInstance(); // Force schemas loading
+        WSDLValidatorDelegate delegate = new WSDLValidatorDelegate(
+                "org.eclipse.wsdl.validate.wsdl11.internal.WSDL11ValidatorController", "validatewsdl");
+        WSDL11ValidatorDelegate delegate11 = new WSDL11ValidatorDelegate(
+                "org.eclipse.wsdl.validate.wsdl11.internal.WSDL11BasicValidator", "validatewsdl");
+
+        ValidatorRegistry.getInstance().registerValidator("http://schemas.xmlsoap.org/wsdl/", delegate
+                , ValidatorRegistry.WSDL_VALIDATOR);
+        org.eclipse.wsdl.validate.wsdl11.internal.ValidatorRegistry.getInstance().registerValidator(
+                "http://schemas.xmlsoap.org/wsdl/", delegate11);
+
+        org.eclipse.wsdl.validate.WSDLValidator validator = org.eclipse.wsdl.validate.WSDLValidator.getInstance();
+        ValidationReport report = validator.validate(wsdlDocLocation);
+
+        int msgcount = 0;
+        for (int m = 0; m < report.getValidationMessages().length; m++) {
+            ValidationMessage validationMessage = report.getValidationMessages()[m];
+            if (validationMessage.getMessage().indexOf("invalid value 'workitem'") < 0) {
+                msgcount++;
+            }
+        }
+        String[] result = new String[msgcount];
+        int counter = 0;
+        for (int m = 0; m < report.getValidationMessages().length; m++) {
+            ValidationMessage validationMessage = report.getValidationMessages()[m];
+            // Couldn't get WSVT to validate workitem parts for an unknown reason, nasty fix.
+            if (validationMessage.getMessage().indexOf("invalid value 'workitem'") < 0) {
+                result[counter] = ((validationMessage.getSeverity() == ValidationMessage.SEV_ERROR ? "ERROR: " : "WARNING: ") +
+                        validationMessage.getMessage() + " at line " + validationMessage.getLine() +
+                        ", column " + validationMessage.getColumn());
+                counter++;
+            }
+        }
+        return result;
+    }
+
+/*
+    public static void main(String[] args) {
+        WSDLValidator validator = new WSDLValidator();
+        try {
+            DeployerConfiguration.setDeployDir("C:\\Dev\\Tools\\Platform\\jakarta-tomcat-5.0.28\\webapps\\agila-ws\\WEB-INF\\deploy");
+            DeployerConfiguration.setSchemasDir("C:\\Dev\\Tools\\Platform\\jakarta-tomcat-5.0.28\\webapps\\agila-ws\\WEB-INF\\schema");
+            validator.validate("file:///C:/Perso/src/agila/samples/src/xml/example2/wsdef.xml");
+        } catch (ValidationException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+    }
+*/
+}

Added: 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=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestBPELValidator.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestBPELValidator.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer;
+
+import junit.framework.TestCase;
+import org.apache.agila.bpel.deployer.priv.validate.bpel.BPELValidator;
+import org.apache.agila.bpel.common.configuration.XMLConfigurationReader;
+
+/**
+ * @author mriou
+ */
+public class TestBPELValidator extends TestCase {
+
+    private AgilaDeployer deployer;
+
+    protected void setUp() throws Exception {
+        XMLConfigurationReader.loadConfiguration();
+
+        deployer = AgilaDeployerFactory.getAgilaDeployer();
+    }
+
+    protected void tearDown() throws Exception {
+        deployer = null;
+    }
+
+    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];
+            System.out.println(error);
+        }
+        assertEquals(9, errors.length);
+    }
+
+}

Added: 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=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestDeployer.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestDeployer.java Wed Apr 27 13:27:43 2005
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.agila.bpel.deployer;
+
+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 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.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;
+
+/**
+ * had test ressources package in the classpath
+ */
+public class TestDeployer extends TestCase {
+
+    private AgilaDeployer deployer;
+
+    protected void setUp() throws Exception {
+        SchemaExport schemaExport = new SchemaExport(new Configuration().configure());
+        schemaExport.create(true, true);
+
+        LifecycleManager.getLifecycleManager().createResources();
+        LifecycleManager.getLifecycleManager().startResources();
+
+        deployer = AgilaDeployerFactory.getAgilaDeployer();
+    }
+
+    protected void tearDown() throws Exception {
+        deployer = null;
+
+        LifecycleManager.getLifecycleManager().stopResources();
+        LifecycleManager.getLifecycleManager().destroyResources();
+    }
+
+    public void testDeploy1() throws Exception {
+        String processDesc = StringUtil.convert(getClass().getClassLoader().getResourceAsStream("loop.xml"));
+        String wsDefs = StringUtil.convert(getClass().getClassLoader().getResourceAsStream("loop-defs.xml"));
+        deployer.deploy(processDesc, wsDefs);
+
+    }
+    public void testDeploy() throws Exception {
+        String processDesc = StringUtil.convert(getClass().getClassLoader().getResourceAsStream("loop.xml"));
+        String wsDefs = StringUtil.convert(getClass().getClassLoader().getResourceAsStream("loop-defs.xml"));
+        deployer.deploy(processDesc, wsDefs);
+
+        String counterId = (String)BeanTester.generateRandomValue(String.class);
+        Document doc = DocumentHelper.createDocument();
+        Element root = doc.addElement("message").addElement("main");
+        root.addElement("counter").setText("0");
+        root.addElement("counterId").setText(counterId);
+        Document result = AgilaEngineFactory.getEngine()
+                .acknowledge("loopPartner","", "loopPort", "loopOp", doc);
+
+        assertTrue("Message controller didn't acknowledge the message properly, an error occured",
+                EngineResultTester.test(result));
+
+        Thread.sleep(30000);
+
+        TransactionManager.beginTransaction();
+        Map corrProp = new HashMap();
+        corrProp.put("counterId", counterId);
+        ProcessInstance createdInstance = ProcessInstanceFactory.findInstanceByCorrelation("counterCorrel", corrProp);
+        assertNotNull("Could not find the created process instance from correlation", createdInstance);
+        assertEquals("Process instance is not properly terminated", ProcessInstance.COMPLETED, createdInstance.getStatus());
+        assertEquals("The counter variable has not been incremented 10 times",
+                "10.0", VariableXAO.queryVariableValue("loop","", "loopVar", createdInstance.getId(), "main", "/counter"));
+        TransactionManager.commitTransaction();
+
+    }
+}

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/test/resources/agila-configuration.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/test/resources/agila-configuration.xml?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/test/resources/agila-configuration.xml (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/test/resources/agila-configuration.xml Wed Apr 27 13:27:43 2005
@@ -0,0 +1,133 @@
+<agila>
+    <lifecycle>
+        <resource>org.apache.agila.bpel.engine.common.transaction.TransactionManager</resource>
+        <resource>org.apache.agila.bpel.engine.common.event.EventManager</resource>
+        <resource>org.apache.agila.bpel.engine.priv.timer.EngineTimer</resource>
+    </lifecycle>
+    <transaction>
+        <resource>org.apache.agila.bpel.engine.common.persistence.DBSessionManager</resource>
+        <resource>org.apache.agila.bpel.engine.common.persistence.XMLSessionManager</resource>
+    </transaction>
+    <event-listeners>
+        <listener>org.apache.agila.bpel.engine.common.event.DebuggingListener</listener>
+    </event-listeners>
+    <tools>
+    	<axis>
+    		<url>http://localhost:8080/agila-ws</url>
+    	</axis>
+        <xindice>
+            <url>xmldb:xindice://localhost:8080/db</url>
+        </xindice>
+    </tools>
+    <deployer>
+    	<path>
+            <target>./deploy/</target>
+	        <schemas>./schema/</schemas>
+    	</path>
+        <namespaces>
+            <map remote-url="http://www.apache.org/agila/examples/loop/service/"
+                 local-url="loop-defs.xml"/>
+            <map remote-url="http://www.apache.org/agila/examples/process-defs.xml"
+                 local-url="process-defs.xml"/>
+            <map remote-url="http://www.apache.org/agila/test/flow/service/"
+                 local-url="test-flow-defs.xml"/>
+            <map remote-url="http://www.apache.org/agila/test/pick/service/"
+                 local-url="test-pick-defs.xml"/>
+            <map remote-url="http://www.apache.org/agila/test/reply/service/"
+                 local-url="test-reply-defs.xml"/>
+            <ignore>http://schemas.xmlsoap.org/ws/2003/03/business-process/</ignore>
+        </namespaces>
+        <validation>
+            <validator>org.apache.agila.bpel.deployer.priv.validate.bpel.reference.CorrelationRefValidator</validator>
+            <validator>org.apache.agila.bpel.deployer.priv.validate.bpel.reference.VariableRefValidator</validator>
+            <validator>org.apache.agila.bpel.deployer.priv.validate.bpel.reference.PartnerLinkRefValidator</validator>
+        </validation>
+    </deployer>
+    <engine>
+        <history>
+            <sent-messages>true</sent-messages>
+        </history>
+        <implementations>
+            <message-broker impl="org.apache.agila.bpel.engine.priv.messaging.impl.DefaultMessageBrokerImpl"/>
+
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Assign"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.AssignImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Empty"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.EmptyImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Flow"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.FlowImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Invoke"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.InvokeImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Pick"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.PickImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Receive"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.ReceiveImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Reply"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.ReplyImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Sequence"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.SequenceImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Scope"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.ScopeImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Switch"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.SwitchImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Terminate"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.TerminateImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Wait"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.WaitImpl"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.While"
+                impl="org.apache.agila.bpel.engine.priv.core.definition.impl.WhileImpl"/>
+
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.AssignEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.AssignECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.EmptyEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.EmptyECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.FlowEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.FlowECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.InvokeEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.InvokeECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.PickEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.PickECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.ReceiveEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.ReceiveECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.ReplyEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.ReplyECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.SequenceEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.SequenceECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.SwitchEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.SwitchECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.TerminateEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.TerminateECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.WaitEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.WaitECImpl"/>
+            <execution-context interface="org.apache.agila.bpel.engine.priv.core.dynamic.WhileEC"
+                impl="org.apache.agila.bpel.engine.priv.core.dynamic.impl.WhileECImpl"/>
+        </implementations>
+
+        <executions>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Assign"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.AssignEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Empty"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.EmptyEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Flow"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.FlowEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Invoke"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.InvokeEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Pick"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.PickEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Receive"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.ReceiveEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Reply"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.ReplyEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Sequence"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.SequenceEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Switch"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.SwitchEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Terminate"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.TerminateEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.Wait"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.WaitEC"/>
+            <activity interface="org.apache.agila.bpel.engine.priv.core.definition.While"
+                execution="org.apache.agila.bpel.engine.priv.core.dynamic.WhileEC"/>
+        </executions>
+    </engine>
+</agila>
\ No newline at end of file

Added: incubator/agila/trunk/modules/bpel/engine/deployer/src/test/resources/error-process.bpel.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/deployer/src/test/resources/error-process.bpel.xml?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/deployer/src/test/resources/error-process.bpel.xml (added)
+++ incubator/agila/trunk/modules/bpel/engine/deployer/src/test/resources/error-process.bpel.xml Wed Apr 27 13:27:43 2005
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<process name="errors-test"
+    targetNamespace="http://www.apache.org/agila/test/errors/process/"
+    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
+    xmlns:lns="http://www.apache.org/agila/test/errors/definition/">
+
+    <correlationSets>
+        <correlationSet properties="lns:workitem" name="aCorrelation"/>
+    </correlationSets>
+
+    <partnerLinks>
+        <partnerLink name="aLink" partnerLinkType="lns:loanPartnerLinkType" myRole="loanService"/>
+    </partnerLinks>
+
+    <variables>
+        <!-- Two variables with idential name in the same scope -->
+        <variable name="duplVariable" messageType="lns:msgType"/>
+        <variable name="duplVariable" messageType="lns:msgType"/>
+        <variable name="aVariable" messageType="lns:msgType"/>
+        <variable name="elmtVariable" element="lns:someElmt" type="lns:fictiveType"/>
+    </variables>
+
+    <sequence>
+        <!-- Typo in variable name -->
+        <receive partnerLink="aLink" portType="lns:port" operation="operation"
+            variable="aVariabl" createInstance="yes">
+            <correlations>
+                <correlation set="aCorrelation" initiate="true"/>
+            </correlations>
+        </receive>
+        <!-- Typo in variable name -->
+        <invoke partnerLink="aLink" portType="lns:port" operation="operation" inputVariable="aVariabl"/>
+        <!-- This partner link doesn't exist -->
+        <!-- This correlation doesn't exist -->
+        <!-- Two receives with createInstance and different correlations -->
+        <receive partnerLink="theLink" portType="lns:port" operation="operation"
+            variable="aVariable">
+            <correlations>
+                <correlation set="theCorrelation"/>
+            </correlations>
+        </receive>
+        <!-- Pick with createInstance and different correlation -->
+        <receive partnerLink="theLink" portType="lns:port" operation="operation"
+            variable="aVariable" createInstance="yes">
+            <correlations>
+                <correlation set="otherCorrelation" initiate="true"/>
+            </correlations>
+        </receive>
+        <assign>
+            <copy>
+                <from variable="aVariable" part="aPart"/>
+                <to variable="aVariable" part="aPart"/>
+            </copy>
+            <copy>
+                <from variable="elmtVariable" part="aPart"/>
+                <to variable="elmtVariable" part="aPart"/>
+            </copy>
+        </assign>
+    </sequence>
+
+</process>
\ No newline at end of file

Added: incubator/agila/trunk/modules/bpel/engine/user/locator.ent
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/user/locator.ent?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/user/locator.ent (added)
+++ incubator/agila/trunk/modules/bpel/engine/user/locator.ent Wed Apr 27 13:27:43 2005
@@ -0,0 +1 @@
+<!ENTITY % dependencies SYSTEM "file:../../dependencies.ent">%dependencies;

Added: incubator/agila/trunk/modules/bpel/engine/user/maven.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/user/maven.xml?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/user/maven.xml (added)
+++ incubator/agila/trunk/modules/bpel/engine/user/maven.xml Wed Apr 27 13:27:43 2005
@@ -0,0 +1,74 @@
+<project default="jar:jar" xmlns:j="jelly:core" xmlns:u="jelly:util" xmlns:ant="jelly:ant"
+    xmlns:maven="jelly:maven" xmlns:m="maven" xmlns:deploy="deploy">
+
+    <!-- Module specific build, called by the reactor of the root module to build -->
+    <!-- all submodules. -->
+    <goal name="buildmodule">
+        <attainGoal name="jar:install"/>
+    </goal>
+
+    <goal name="sitemodule">
+        <attainGoal name="site:generate"/>
+    </goal>
+
+    <preGoal name="java:compile">
+        <attainGoal name="xdoclet:hibernatedoclet"/>
+
+        <!-- Copying necessary resources -->
+        <copy toDir="${maven.build.dest}">
+            <fileset dir="src/aspect">
+                <include name="*.*"/>
+            </fileset>
+            <fileset dir="target/xdoclet/hibernatedoclet">
+                <include name="**/*.xml"/>
+            </fileset>
+        </copy>
+
+        <!-- AOP must be copied before compilation -->
+        <copy toDir="${maven.build.dest}/META-INF">
+            <fileset dir="src/aspect">
+                <include name="*.*"/>
+            </fileset>
+        </copy>
+
+    </preGoal>
+
+    <postGoal name="java:compile">
+        <!-- Preparing JBossAOP classpath -->
+        <path id="all.classpath.ref">
+            <pathelement path="${maven.build.dest}"/>
+            <path refid="maven.dependency.classpath"/>
+        </path>
+
+        <!-- Running JBossAOP Annotations compiler -->
+        <echo>Starting JBossAOP JDK 1.4 annotation compiler...</echo>
+        <taskdef name="annotationc" classname="org.jboss.aop.ant.AnnotationC" classpathref="all.classpath.ref"/>
+        <annotationc compilerclasspathref="all.classpath.ref" classpathref="all.classpath.ref" bytecode="true">
+        	<src path="src/java"/>
+        </annotationc>
+        <echo>JBossAOP annotation compilation done.</echo>
+
+        <!-- Calling JBoss AOP bytecode enhancer -->
+        <echo>Starting JBossAOP bytecode enhancer...</echo>
+        <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="maven.dependency.classpath"/>
+        <aopc compilerclasspathref="all.classpath.ref" classpathref="all.classpath.ref" verbose="true">
+            <classpath refid="all.classpath.ref"/>
+            <src path="${maven.build.dest}"/>
+            <aoppath>
+                <pathelement path="${maven.build.dest}/META-INF/jboss-aop.xml"/>
+            </aoppath>
+        </aopc>
+        <echo>JBossAOP bytecode enhancer done.</echo>
+    </postGoal>
+
+    <goal name="hsql:start">
+        <mkdir dir="etc/hsql"/>
+        <java classname="org.hsqldb.Server" fork="true" dir="etc/hsql">
+            <arg line="-database agila"/>
+            <classpath>
+                <pathelement location="${pom.getDependencyPath('hsqldb')}"/>
+            </classpath>
+	</java>
+    </goal>
+
+</project>
\ No newline at end of file

Added: incubator/agila/trunk/modules/bpel/engine/user/project.properties
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/user/project.properties?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/user/project.properties (added)
+++ incubator/agila/trunk/modules/bpel/engine/user/project.properties Wed Apr 27 13:27:43 2005
@@ -0,0 +1,6 @@
+maven.multiproject.type=jar
+maven.junit.fork=true
+
+maven.xdoclet.hibernatedoclet.hibernate.0.Version=2.0
+
+maven.test.skip=true

Added: incubator/agila/trunk/modules/bpel/engine/user/project.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/user/project.xml?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/user/project.xml (added)
+++ incubator/agila/trunk/modules/bpel/engine/user/project.xml Wed Apr 27 13:27:43 2005
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<!DOCTYPE project [
+<!ENTITY % locator SYSTEM "file:locator.ent">%locator;
+]>
+<project>
+    <extend>${basedir}/../../project.xml</extend>
+    <name>Agila User/Group/Role Manager</name>
+    <id>agila-user</id>
+    <package>org.apache.agila.bpel.user</package>
+
+    <shortDescription>Agila User/Group/Role Manager</shortDescription>
+
+    <description>
+        This service is used to handle users, the groups they belong to and the
+        roles they can act as.
+    </description>
+
+    <dependencies>
+        &dependency-agila-agila-common;
+        &dependency-agila-agila-engine-common;
+        &dependency-commons-logging;
+        &dependency-concurrent;
+        &dependency-hibernate;
+        &dependency-jboss-javassist-aop;
+        &dependency-jboss-jboss-aop;
+        &dependency-jboss-jboss-common-aop;
+        &dependency-log4j;
+        &dependency-trove;
+        &dependency-qdox;
+        &dependency-xdoclet-xjavadoc;
+        &dependency-xdoclet;
+        &dependency-xdoclet-plugin;
+        &dependency-xdoclet-xdoclet-xdoclet-module;
+        &dependency-xdoclet-xdoclet-ejb-module;
+        &dependency-xdoclet-xdoclet-web-module;
+        &dependency-xdoclet-xdoclet-jmx-module;
+        &dependency-xdoclet-xdoclet-web-module;
+        &dependency-xdoclet-xdoclet-jboss-module;
+        &dependency-xdoclet-xdoclet-apache-module;
+        &dependency-xdoclet-xdoclet-hibernate-module;
+    </dependencies>
+
+    <build>
+        <nagEmailAddress>
+            wf-agila-devel@lists.sourceforge.net
+        </nagEmailAddress>
+
+        <sourceDirectory>src/java</sourceDirectory>
+        <aspectSourceDirectory>src/aspect</aspectSourceDirectory>
+
+        <resources>
+            <!--            <resource>-->
+                <!--                <directory>src/hibernate</directory>-->
+                <!--                <includes><include>**/*.*</include></includes>-->
+                <!--                <excludes><exclude>*.cfg.xml</exclude></excludes>-->
+                <!--            </resource>-->
+            <resource>
+                <directory>target/xdoclet/hibernatedoclet</directory>
+                <includes><include>*.cfg.xml</include></includes>
+            </resource>
+        </resources>
+
+        <unitTestSourceDirectory>src/test/junit</unitTestSourceDirectory>
+
+        <!-- Unit test cases -->
+        <unitTest>
+            <includes>
+                <include>**/Test*.java</include>
+            </includes>
+            <resources>
+                <resource>
+                    <directory>src/test/resource</directory>
+                    <includes><include>*.*</include></includes>
+                </resource>
+            </resources>
+        </unitTest>
+
+        <!-- Integration unit test cases -->
+        <integrationUnitTest/>
+
+        <jars>
+        </jars>
+
+        <nagEmailAddress>wf-agila-devel@lists.sourceforge.net</nagEmailAddress>
+    </build>
+
+    &site-reports;
+
+</project>

Added: incubator/agila/trunk/modules/bpel/engine/user/src/aspect/jboss-aop.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/user/src/aspect/jboss-aop.xml?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/user/src/aspect/jboss-aop.xml (added)
+++ incubator/agila/trunk/modules/bpel/engine/user/src/aspect/jboss-aop.xml Wed Apr 27 13:27:43 2005
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aop>
+	<!-- Tracing binding, includes debug messages at method entrance and exit -->
+<!--   <bind pointcut="execution(public * org.smcp.*->*(..)) AND !all(*.aspect.*)">-->
+<!--      <interceptor class="org.apache.agila.bpel.common.aspect.LoggingInterceptor"/>-->
+<!--   </bind>-->
+   
+   <!-- Transaction commit, includes transaction behaviour at methods entranc and exit -->
+    <bind pointcut="all(@org.apache.agila.bpel.engine.common.aspect.Transactional)">
+        <interceptor class="org.apache.agila.bpel.engine.common.aspect.TransactionInterceptor"/>
+    </bind>
+
+</aop>

Added: incubator/agila/trunk/modules/bpel/engine/user/src/hibernate/org/apache/agila/bpel/user/users.hbm.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/user/src/hibernate/org/apache/agila/bpel/user/users.hbm.xml?rev=165042&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/user/src/hibernate/org/apache/agila/bpel/user/users.hbm.xml (added)
+++ incubator/agila/trunk/modules/bpel/engine/user/src/hibernate/org/apache/agila/bpel/user/users.hbm.xml Wed Apr 27 13:27:43 2005
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+        "-//Hibernate/Hibernate Mapping DTD//EN"
+        "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
+
+<hibernate-mapping>
+    <class name="org.apache.agila.bpel.user.priv.UserImpl" table="USERS">
+        <id name="username" column="USER" type="string">
+            <generator class="assigned"/>
+        </id>
+
+        <property name="password" type="string" not-null="true"/>
+
+        <set name="roles" inverse="true">
+            <key column="user"/>
+            <one-to-many class="org.apache.agila.bpel.user.priv.RoleImpl"/>
+        </set>
+    </class>
+
+    <class name="org.apache.agila.bpel.user.priv.RoleImpl" table="ROLES">
+        <id name="id" column="ID" type="long">
+            <generator class="hilo">
+                <param name="table">ROLE_ID</param>
+                <param name="column">NEXTID</param>
+            </generator>
+        </id>
+
+        <property name="rolename" type="string" not-null="true"/>
+
+        <many-to-one name="user"
+            class="org.apache.agila.bpel.user.priv.UserImpl" column="user"/>
+
+    </class>
+
+</hibernate-mapping>
\ No newline at end of file



Mime
View raw message