incubator-agila-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r365997 [1/3] - in /incubator/agila/trunk/modules/bpel: ./ client/api/src/java/org/apache/agila/bpel/client/ client/web/src/java/org/apache/agila/bpel/web/common/ client/web/src/java/org/apache/agila/bpel/web/deployer/action/ client/web/src...
Date Wed, 04 Jan 2006 21:21:04 GMT
Author: mriou
Date: Wed Jan  4 13:19:47 2006
New Revision: 365997

URL: http://svn.apache.org/viewcvs?rev=365997&view=rev
Log:
Applying patch for Jira issue AGILA-38 (contribution of Steffen Horlacher from Pansoft).

Added:
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/DeleteInstance.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/TerminateInstance.java
    incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/partnerlink.hbm.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/partnerlinkrole.hbm.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/PartnerLink.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/PartnerLinkRole.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/PartnerLinkImpl.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/PartnerLinkRoleImpl.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/xao/AbstractXAO.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/xao/AddressingXAO.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/xao/PartnerLinkXAO.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/messaging/impl/AddressingWSMessageBroker.java
    incubator/agila/trunk/modules/bpel/engine/core/src/test/resources/test-terminate-defs.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/test/resources/test-terminate-msg.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/test/resources/test-terminate.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/test/resources/test-wait-defs.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/test/resources/test-wait-msg.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/test/resources/test-wait.xml
    incubator/agila/trunk/modules/bpel/engine/wsa/src/axis/
    incubator/agila/trunk/modules/bpel/engine/wsa/src/axis/client-config.wsdd
Modified:
    incubator/agila/trunk/modules/bpel/client/api/src/java/org/apache/agila/bpel/client/AgilaEngineAdmin.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/common/AbstractAction.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/DeleteProcess.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/DeployProcess.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/LoadDeployerForm.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ViewProcessAsXml.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ViewProcessDefAsXml.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadInstanceAuditView.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadInstanceView.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadSentMessagesList.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/SendMessageToEngine.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/CompleteOrCancel.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/LoadWorkItem.java
    incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/LoadWorkList.java
    incubator/agila/trunk/modules/bpel/client/web/src/webapp/WEB-INF/struts-config-engine.xml
    incubator/agila/trunk/modules/bpel/client/web/src/webapp/instanceView.jsp
    incubator/agila/trunk/modules/bpel/client/web/src/webapp/sentMessagesList.jsp
    incubator/agila/trunk/modules/bpel/client/web/src/webapp/xmlbody.jsp
    incubator/agila/trunk/modules/bpel/common/src/java/org/apache/agila/bpel/common/util/NSUtil.java
    incubator/agila/trunk/modules/bpel/dependencies.ent
    incubator/agila/trunk/modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/persistence/XMLDataAccess.java
    incubator/agila/trunk/modules/bpel/engine/core/project.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/activity.hbm.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/process.hbm.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/AgilaEngineAdmin.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/AgilaEngineAdminImpl.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/AgilaProcess.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/ProcessFactory.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/ProcessImpl.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/dao/ActivityDAO.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/ExecutionContext.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/ProcessInstance.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/ProcessInstanceFactory.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/BasicECImpl.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/ProcessInstanceImpl.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/StructuredECImpl.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/dao/ExecutionContextDAO.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/dao/ProcessInstanceDAO.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/xao/CorrelationXAO.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/dynamic/impl/xao/VariableXAO.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/messaging/MessageBroker.java
    incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/messaging/impl/PickECAsReceiveEC.java
    incubator/agila/trunk/modules/bpel/engine/core/src/test/resources/agila-configuration.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/test/resources/hibernate.cfg.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/test/resources/loop-defs.xml
    incubator/agila/trunk/modules/bpel/engine/core/src/test/resources/loop.xml
    incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/AgilaDeployerImpl.java
    incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/InvokeDeployer.java
    incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/ReceiveDeployer.java
    incubator/agila/trunk/modules/bpel/engine/deployer/src/java/org/apache/agila/bpel/deployer/priv/ReplyDeployer.java
    incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestBPELValidator.java
    incubator/agila/trunk/modules/bpel/engine/deployer/src/test/junit/org/apache/agila/bpel/deployer/TestDeployer.java
    incubator/agila/trunk/modules/bpel/engine/user/src/test/junit/org/apache/agila/bpel/user/TestAgilaUserLdapImpl.java
    incubator/agila/trunk/modules/bpel/engine/wsa/project.xml
    incubator/agila/trunk/modules/bpel/engine/wsa/src/java/org/apache/agila/bpel/wsa/EngineAdminWSA.java
    incubator/agila/trunk/modules/bpel/engine/wsa/src/java/org/apache/agila/bpel/wsa/EngineWSA.java
    incubator/agila/trunk/modules/bpel/engine/wsa/src/test/resources/hibernate.cfg.xml
    incubator/agila/trunk/modules/bpel/engine/wsa/src/webapp/WEB-INF/server-config.wsdd
    incubator/agila/trunk/modules/bpel/samples/src/xml/example1/wsdef.xml

Modified: incubator/agila/trunk/modules/bpel/client/api/src/java/org/apache/agila/bpel/client/AgilaEngineAdmin.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/api/src/java/org/apache/agila/bpel/client/AgilaEngineAdmin.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/api/src/java/org/apache/agila/bpel/client/AgilaEngineAdmin.java (original)
+++ incubator/agila/trunk/modules/bpel/client/api/src/java/org/apache/agila/bpel/client/AgilaEngineAdmin.java Wed Jan  4 13:19:47 2006
@@ -15,13 +15,6 @@
  */
 package org.apache.agila.bpel.client;
 
-import com.thoughtworks.xstream.XStream;
-import org.apache.axis.client.Call;
-import org.apache.axis.client.Service;
-import org.apache.log4j.Logger;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ServiceException;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.rmi.RemoteException;
@@ -30,6 +23,15 @@
 import java.util.Map;
 import java.util.Properties;
 
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ServiceException;
+
+import org.apache.axis.client.Call;
+import org.apache.axis.client.Service;
+import org.apache.log4j.Logger;
+
+import com.thoughtworks.xstream.XStream;
+
 /**
  * Client stub to the Agila's administration service interface, encapsulates
  * remote calls to the engine administration service.
@@ -59,6 +61,35 @@
     log.debug("Process deleted " + sb.toString());
   }
 
+  /**
+   * Deletes a terminated process instance
+   * 
+   * @param instanceId process instance id
+   * @throws EngineException
+   */
+	public void deleteTerminatedInstance(String instanceId)  throws ServiceException, RemoteException {
+		Call call = getCall();
+		log.debug("Deleting terminated instance " + instanceId);
+		call.setOperation("deleteTerminatedInstance");
+		call.invoke(new Object[]{new Long(instanceId)});
+		log.debug("Terminated instance deleted" + instanceId);
+	} 
+	
+	/**
+	 * Terminates a active process instance
+	 * 
+	 * @param instanceId process instance id
+	 * @throws EngineException
+	 */
+	public void terminateInstance(String instanceId)  throws ServiceException, RemoteException {
+		Call call = getCall();
+		log.debug("Terminateing instance " + instanceId);
+		call.setOperation("terminateInstance");
+		call.invoke(new Object[]{new Long(instanceId)});
+		log.debug("Terminated instance " + instanceId);
+	} 
+	
+  
   /**
    * Returns the deployed xml description of a process.
    *

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/common/AbstractAction.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/common/AbstractAction.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/common/AbstractAction.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/common/AbstractAction.java Wed Jan  4 13:19:47 2006
@@ -25,12 +25,12 @@
 
 public abstract class AbstractAction extends Action {
 
-    protected Logger log = Logger.getLogger(getClass());
+	protected static final Logger log = Logger.getLogger("web");
 
     protected HttpServletRequest request;
     protected HttpServletResponse response;
     protected ActionForm actionForm;
-    protected ActionMapping actionMapping;
+    private ActionMapping actionMapping;
     protected ActionErrors actionErrors = null;
     protected HttpSession session;
     private ActionForward actionForward;

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/DeleteProcess.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/DeleteProcess.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/DeleteProcess.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/DeleteProcess.java Wed Jan  4 13:19:47 2006
@@ -17,34 +17,21 @@
 
 import java.rmi.RemoteException;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
 import javax.xml.rpc.ServiceException;
 
-import org.apache.log4j.Logger;
-
-import org.apache.struts.action.Action;
+import org.apache.agila.bpel.client.AgilaEngineAdmin;
+import org.apache.agila.bpel.web.common.AbstractAction;
 import org.apache.struts.action.ActionError;
 import org.apache.struts.action.ActionErrors;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-import org.apache.agila.bpel.client.AgilaEngineAdmin;
 
 /**
  * @author mriou
  */
-public class DeleteProcess extends Action {
+public class DeleteProcess extends AbstractAction {
 
-    private static final Logger log = Logger.getLogger("web");
 
-    public ActionForward execute(ActionMapping actionMapping,
-                                 ActionForm ActionForm,
-                                 HttpServletRequest request,
-                                 HttpServletResponse response) {
+    public void execute() {
 
-        HttpSession session = request.getSession();
         ActionErrors errors = new ActionErrors();
         session.setAttribute("currentMenu", "Deployer");
 
@@ -62,9 +49,9 @@
 
         if (errors.size() != 0) {
             saveErrors(request, errors);
-            return actionMapping.findForward("error");
+            setForward("error");
         }
-        return actionMapping.findForward("success");
+        setForward("success");
     }
 
 }

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/DeployProcess.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/DeployProcess.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/DeployProcess.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/DeployProcess.java Wed Jan  4 13:19:47 2006
@@ -15,33 +15,27 @@
  */
 package org.apache.agila.bpel.web.deployer.action;
 
-import org.apache.struts.action.*;
-import org.apache.struts.upload.FormFile;
-import org.apache.agila.bpel.client.AgilaDeployer;
-import org.apache.agila.bpel.web.deployer.form.DeployerForm;
-
-import org.apache.log4j.Logger;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import javax.xml.rpc.ServiceException;
-
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.rmi.RemoteException;
 
-public class DeployProcess extends Action {
+import javax.xml.rpc.ServiceException;
+
+import org.apache.agila.bpel.client.AgilaDeployer;
+import org.apache.agila.bpel.web.common.AbstractAction;
+import org.apache.agila.bpel.web.deployer.form.DeployerForm;
+import org.apache.log4j.Logger;
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.upload.FormFile;
+
+public class DeployProcess extends AbstractAction {
 
     private static final Logger log = Logger.getLogger("web");
 
-    public ActionForward execute(ActionMapping actionMapping,
-                                 ActionForm actionForm,
-                                 HttpServletRequest request,
-                                 HttpServletResponse response) {
-        HttpSession session = request.getSession();
+    public void execute()
+    {
         session.setAttribute("currentMenu", "Deployer");
         ActionErrors errors = new ActionErrors();
 
@@ -96,7 +90,8 @@
         if (errors.size() != 0) {
             saveErrors(request, errors);
         }
-        return actionMapping.findForward("success");
+        setForward("success");
+
     }
 
     private StringBuffer getFileContent(FormFile formFile, ActionErrors errors) {

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/LoadDeployerForm.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/LoadDeployerForm.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/LoadDeployerForm.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/LoadDeployerForm.java Wed Jan  4 13:19:47 2006
@@ -15,30 +15,23 @@
  */
 package org.apache.agila.bpel.web.deployer.action;
 
-import org.apache.struts.action.*;
-import org.apache.agila.bpel.client.AgilaEngineAdmin;
-
-import org.apache.log4j.Logger;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.xml.rpc.ServiceException;
 import java.rmi.RemoteException;
 import java.util.Collection;
 import java.util.HashSet;
 
-public class LoadDeployerForm extends Action {
+import javax.xml.rpc.ServiceException;
+
+import org.apache.agila.bpel.client.AgilaEngineAdmin;
+import org.apache.agila.bpel.web.common.AbstractAction;
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
 
-    private static final Logger log = Logger.getLogger("web");
+public class LoadDeployerForm extends AbstractAction {
+    
     private static final String NO_PROCESS_ERROR = "No process in DB";
 
-    public ActionForward execute(ActionMapping actionMapping,
-                                 ActionForm ActionForm,
-                                 HttpServletRequest request,
-                                 HttpServletResponse response) {
+    public void execute() {
         ActionErrors errors = new ActionErrors();
-        HttpSession session = request.getSession();
         session.setAttribute("currentMenu", "Deployer");
 
         AgilaEngineAdmin engineAdmin = new AgilaEngineAdmin();
@@ -64,6 +57,6 @@
         if (errors.size() != 0) {
             saveErrors(request, errors);
         }
-        return actionMapping.findForward("success");
+        setForward("success");
     }
 }

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ViewProcessAsXml.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ViewProcessAsXml.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ViewProcessAsXml.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ViewProcessAsXml.java Wed Jan  4 13:19:47 2006
@@ -18,6 +18,7 @@
 import org.apache.struts.action.*;
 
 import org.apache.agila.bpel.client.AgilaEngineAdmin;
+import org.apache.agila.bpel.web.common.AbstractAction;
 
 import org.apache.log4j.Logger;
 
@@ -27,16 +28,10 @@
 import javax.xml.rpc.ServiceException;
 import java.rmi.RemoteException;
 
-public class ViewProcessAsXml extends Action {
+public class ViewProcessAsXml extends AbstractAction {
 
-    private static final Logger log = Logger.getLogger("web");
+    public void execute() {
 
-    public ActionForward execute(ActionMapping actionMapping,
-                                 ActionForm ActionForm,
-                                 HttpServletRequest request,
-                                 HttpServletResponse response) {
-
-        HttpSession session = request.getSession();
         ActionErrors errors = new ActionErrors();
         session.setAttribute("currentMenu", "Deployer");
 
@@ -55,8 +50,8 @@
         request.setAttribute("processAsXML", processAsXML);
         if (errors.size() != 0) {
             saveErrors(request, errors);
-            return actionMapping.findForward("error");
-        }
-        return actionMapping.findForward("success");
+            setForward("error");
+        } 
+        setForward("success");
     }
 }

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ViewProcessDefAsXml.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ViewProcessDefAsXml.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ViewProcessDefAsXml.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/deployer/action/ViewProcessDefAsXml.java Wed Jan  4 13:19:47 2006
@@ -15,27 +15,18 @@
  */
 package org.apache.agila.bpel.web.deployer.action;
 
-import org.apache.struts.action.*;
-import org.apache.agila.bpel.client.AgilaEngineAdmin;
-
-import org.apache.log4j.Logger;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.xml.rpc.ServiceException;
 import java.rmi.RemoteException;
 
-public class ViewProcessDefAsXml extends Action {
+import javax.xml.rpc.ServiceException;
 
-    private static final Logger log = Logger.getLogger("web");
+import org.apache.agila.bpel.client.AgilaEngineAdmin;
+import org.apache.agila.bpel.web.common.AbstractAction;
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
 
-    public ActionForward execute(ActionMapping actionMapping,
-                                 ActionForm ActionForm,
-                                 HttpServletRequest request,
-                                 HttpServletResponse response) {
+public class ViewProcessDefAsXml extends AbstractAction {
 
-        HttpSession session = request.getSession();
+    public void execute() {
         ActionErrors errors = new ActionErrors();
         session.setAttribute("currentMenu", "Deployer");
 
@@ -54,8 +45,8 @@
         request.setAttribute("processAsXML", processAsXML);
         if (errors.size() != 0) {
             saveErrors(request, errors);
-            return actionMapping.findForward("error");
+            setForward("error");
         }
-        return actionMapping.findForward("success");
+        setForward("success");
     }
 }

Added: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/DeleteInstance.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/DeleteInstance.java?rev=365997&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/DeleteInstance.java (added)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/DeleteInstance.java Wed Jan  4 13:19:47 2006
@@ -0,0 +1,58 @@
+/*
+ * 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.web.engine.action;
+
+import java.rmi.RemoteException;
+
+import javax.xml.rpc.ServiceException;
+
+import org.apache.agila.bpel.client.AgilaEngineAdmin;
+import org.apache.agila.bpel.web.common.AbstractAction;
+
+/**
+ * @author jan.faber@pansoft.de
+ */
+public class DeleteInstance extends AbstractAction {
+
+	protected void execute() throws Exception {
+		setSessionAttribute("currentMenu", "Instance");
+
+		String instanceId;
+		if ((instanceId = getRequestParam("instanceId")) != null) {
+			deleteInstance(instanceId);
+			setForward("success");
+		}
+	} 
+
+	private void deleteInstance(String instanceId) {
+	
+			AgilaEngineAdmin engineAdmin = new AgilaEngineAdmin();
+			try {
+				engineAdmin.deleteTerminatedInstance(instanceId);
+			} catch (RemoteException e) {
+	            log.error(e.getMessage(), e);
+	            addGlobalError(e.getMessage());
+			} catch (ServiceException e) {
+	            log.error(e.getMessage(), e);
+	            addGlobalError(e.getMessage());
+			}
+		
+	}
+
+
+
+
+}

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadInstanceAuditView.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadInstanceAuditView.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadInstanceAuditView.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadInstanceAuditView.java Wed Jan  4 13:19:47 2006
@@ -15,30 +15,28 @@
  */
 package org.apache.agila.bpel.web.engine.action;
 
-import org.apache.agila.bpel.client.AgilaEngineAdmin;
-import org.apache.agila.bpel.client.Audit;
-import org.apache.agila.bpel.common.util.XMLUtil;
-import org.apache.agila.bpel.common.util.logger.Logger;
-import org.apache.agila.bpel.web.common.AbstractAction;
-import org.apache.agila.bpel.web.util.ServletContextURIResolver;
+import java.io.StringWriter;
+import java.net.URLConnection;
+import java.rmi.RemoteException;
 
 import javax.servlet.ServletContext;
 import javax.xml.rpc.ServiceException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-import java.io.StringWriter;
-import java.net.URLConnection;
-import java.rmi.RemoteException;
+
+import org.apache.agila.bpel.client.AgilaEngineAdmin;
+import org.apache.agila.bpel.client.Audit;
+import org.apache.agila.bpel.common.util.XMLUtil;
+import org.apache.agila.bpel.web.common.AbstractAction;
+import org.apache.agila.bpel.web.util.ServletContextURIResolver;
 
 /**
  * Action class for loading the audit view of a process instance.
  *
- * @author <a href="mailto:norman.schoeneich@anybet.de">Norman Schöneich</a>
+ * @author <a href="mailto:norman.schoeneich@anybet.de">Norman Schöneich</a>
  */
 public class LoadInstanceAuditView extends AbstractAction {
-
-  private static final Logger log = Logger.getLogger("web");
 
   protected void execute() {
     setSessionAttribute("currentMenu", "UsersManagement");

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadInstanceView.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadInstanceView.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadInstanceView.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadInstanceView.java Wed Jan  4 13:19:47 2006
@@ -15,20 +15,6 @@
  */
 package org.apache.agila.bpel.web.engine.action;
 
-import org.apache.log4j.Logger;
-import org.apache.struts.action.*;
-import org.apache.agila.bpel.client.AgilaEngineAdmin;
-import org.apache.agila.bpel.common.util.XMLUtil;
-import org.apache.agila.bpel.web.util.ServletContextURIResolver;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.xml.rpc.ServiceException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
 import java.io.IOException;
 import java.io.StringWriter;
 import java.net.MalformedURLException;
@@ -37,17 +23,24 @@
 import java.util.HashMap;
 import java.util.Map;
 
-public class LoadInstanceView extends Action {
+import javax.servlet.ServletContext;
+import javax.xml.rpc.ServiceException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.agila.bpel.client.AgilaEngineAdmin;
+import org.apache.agila.bpel.common.util.XMLUtil;
+import org.apache.agila.bpel.web.common.AbstractAction;
+import org.apache.agila.bpel.web.util.ServletContextURIResolver;
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
 
-  private static final Logger log = Logger.getLogger("web");
+public class LoadInstanceView extends AbstractAction {
 
-  public ActionForward execute(ActionMapping actionMapping,
-                               ActionForm actionForm,
-                               HttpServletRequest request,
-                               HttpServletResponse response) {
+  public void execute() {
 
     ActionErrors errors = new ActionErrors();
-    HttpSession session = request.getSession();
     session.setAttribute("currentMenu", "Instance");
 
     AgilaEngineAdmin engineAdmin = new AgilaEngineAdmin();
@@ -103,6 +96,6 @@
     request.setAttribute("terminatedInstances", terminatedInstances);
 
     saveErrors(request, errors);
-    return actionMapping.findForward("success");
+    setForward("success");
   }
 }

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadSentMessagesList.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadSentMessagesList.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadSentMessagesList.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/LoadSentMessagesList.java Wed Jan  4 13:19:47 2006
@@ -15,31 +15,23 @@
  */
 package org.apache.agila.bpel.web.engine.action;
 
-import org.apache.struts.action.*;
-
-import org.apache.log4j.Logger;
-
-import org.apache.agila.bpel.client.AgilaEngineAdmin;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.xml.rpc.ServiceException;
 import java.rmi.RemoteException;
 import java.util.HashMap;
 import java.util.Map;
 
-public class LoadSentMessagesList extends Action {
+import javax.xml.rpc.ServiceException;
+
+import org.apache.agila.bpel.client.AgilaEngineAdmin;
+import org.apache.agila.bpel.web.common.AbstractAction;
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
 
-    private static final Logger log = Logger.getLogger("web");
 
-    public ActionForward execute(ActionMapping actionMapping,
-                                 ActionForm actionForm,
-                                 HttpServletRequest request,
-                                 HttpServletResponse response) {
+public class LoadSentMessagesList extends AbstractAction {
+
+    public void execute() {
 
         ActionErrors errors = new ActionErrors();
-        HttpSession session = request.getSession();
         session.setAttribute("currentMenu", "SentMessages");
 
         AgilaEngineAdmin engineAdmin = new AgilaEngineAdmin();
@@ -57,6 +49,7 @@
         session.setAttribute("xmlmap", sentMessages);
 
         saveErrors(request, errors);
-        return actionMapping.findForward("success");
+        setForward("success");
     }
+
 }

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/SendMessageToEngine.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/SendMessageToEngine.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/SendMessageToEngine.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/SendMessageToEngine.java Wed Jan  4 13:19:47 2006
@@ -15,39 +15,32 @@
  */
 package org.apache.agila.bpel.web.engine.action;
 
-import org.apache.log4j.Logger;
-import org.apache.struts.action.*;
-import org.apache.struts.upload.FormFile;
-import org.apache.agila.bpel.client.AgilaEngine;
-import org.apache.agila.bpel.web.engine.form.SendMessageForm;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
+import java.io.StringReader;
+import java.rmi.RemoteException;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.rpc.ServiceException;
-import java.io.StringReader;
-import java.rmi.RemoteException;
 
-public class SendMessageToEngine extends Action {
+import org.apache.agila.bpel.client.AgilaEngine;
+import org.apache.agila.bpel.web.common.AbstractAction;
+import org.apache.agila.bpel.web.engine.form.SendMessageForm;
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.upload.FormFile;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
 
-  private static final Logger log = Logger.getLogger("web");
+public class SendMessageToEngine extends AbstractAction {
 
-  public ActionForward execute(ActionMapping actionMapping,
-                               ActionForm ActionForm,
-                               HttpServletRequest request,
-                               HttpServletResponse response) {
-    HttpSession session = request.getSession();
+  public void execute() {
     session.setAttribute("currentMenu", "SendMessage");
     ActionErrors errors = new ActionErrors();
 
-    SendMessageForm form = (SendMessageForm) ActionForm;
+    SendMessageForm form = (SendMessageForm) actionForm;
     String load = request.getParameter("loadForm");
     if (load != null) {
-      return actionMapping.findForward("success");
+    	  setForward("success");
     } else if (form.getMessageString() != null && form.getMessageString().length() > 0) {
       sendMessageToProcess(form, parse(form), errors);
     } else if (form.getPartner() != null && form.getPartner().length() > 0 && isProcessFormValid(form, errors)) {
@@ -57,7 +50,7 @@
     }
     saveErrors(request, errors);
 
-    return actionMapping.findForward("success");
+    setForward("success");
   }
 
   private void sendMessageToEngine(Document msgDoc, ActionErrors errors) {

Added: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/TerminateInstance.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/TerminateInstance.java?rev=365997&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/TerminateInstance.java (added)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/engine/action/TerminateInstance.java Wed Jan  4 13:19:47 2006
@@ -0,0 +1,64 @@
+/*
+ * 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.web.engine.action;
+
+import java.rmi.RemoteException;
+
+import javax.xml.rpc.ServiceException;
+
+import org.apache.agila.bpel.client.AgilaEngineAdmin;
+import org.apache.agila.bpel.web.common.AbstractAction;
+import org.apache.log4j.Logger;
+
+/**
+ * Terminate instance action 
+ *
+ * @author jan.faber@pansoft.de
+ */
+public class TerminateInstance extends AbstractAction {
+
+	private static final Logger log = Logger.getLogger("web");
+
+	protected void execute() throws Exception {
+		setSessionAttribute("currentMenu", "Instance");
+
+		String instanceId;
+		if ((instanceId = getRequestParam("instanceId")) != null) {
+			terminateInstance(instanceId);
+			setForward("success");
+		}
+	}
+
+	private void terminateInstance(String instanceId) {
+		try {
+			AgilaEngineAdmin engineAdmin = new AgilaEngineAdmin();
+			engineAdmin.terminateInstance(instanceId);
+		} catch (ServiceException e) { 
+			log.error(
+					"A problem occured when loading a process instance audit with id "
+							+ instanceId, e);
+			addGlobalError("error.generic.server");
+		} catch (RemoteException e) {
+			log.error(
+					"A problem occured when loading a process instance audit with id "
+							+ instanceId, e);
+			addGlobalError("error.remote.exception");
+		}
+	}
+
+
+
+}

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/CompleteOrCancel.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/CompleteOrCancel.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/CompleteOrCancel.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/CompleteOrCancel.java Wed Jan  4 13:19:47 2006
@@ -15,31 +15,27 @@
  */
 package org.apache.agila.bpel.web.worklist.action;
 
-import org.apache.struts.action.*;
-import org.dom4j.Document;
-import org.dom4j.DocumentHelper;
-import org.dom4j.Element;
-import org.apache.agila.bpel.client.AgilaWorkList;
-import org.apache.agila.bpel.client.User;
-
-import org.apache.log4j.Logger;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.rpc.ServiceException;
 import java.rmi.RemoteException;
 import java.util.Iterator;
 import java.util.Map;
 
+import javax.xml.rpc.ServiceException;
+
+import org.apache.agila.bpel.client.AgilaWorkList;
+import org.apache.agila.bpel.client.User;
+import org.apache.agila.bpel.web.common.AbstractAction;
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+
 /**
  * Either complete a workitem of just forwards to the worklist page.
  */
-public class CompleteOrCancel extends Action {
-
-    private static final Logger log = Logger.getLogger("web");
+public class CompleteOrCancel extends AbstractAction {
 
-    public ActionForward execute(ActionMapping mapping, ActionForm form,
-                                 HttpServletRequest request, HttpServletResponse response) throws Exception {
+    public void execute() throws Exception {
         ActionErrors errors = new ActionErrors();
 
         String completion = request.getParameter("completion");
@@ -94,8 +90,8 @@
 
         if (!errors.isEmpty()) {
             saveErrors(request, errors);
-            return (mapping.findForward("home"));
+            setForward("home");
         }
-        return (mapping.findForward("success"));
+        setForward("success");
     }
 }

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/LoadWorkItem.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/LoadWorkItem.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/LoadWorkItem.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/LoadWorkItem.java Wed Jan  4 13:19:47 2006
@@ -15,33 +15,34 @@
  */
 package org.apache.agila.bpel.web.worklist.action;
 
-import org.apache.struts.action.*;
-import org.dom4j.*;
-import org.apache.agila.bpel.client.AgilaEngineAdmin;
-import org.apache.agila.bpel.client.AgilaWorkList;
-import org.apache.agila.bpel.client.WorkItem;
-import org.apache.agila.bpel.common.util.NSUtil;
-
-import org.apache.log4j.Logger;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.rpc.ServiceException;
 import java.rmi.RemoteException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.xml.rpc.ServiceException;
+
+import org.apache.agila.bpel.client.AgilaEngineAdmin;
+import org.apache.agila.bpel.client.AgilaWorkList;
+import org.apache.agila.bpel.client.WorkItem;
+import org.apache.agila.bpel.common.util.NSUtil;
+import org.apache.agila.bpel.web.common.AbstractAction;
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+import org.dom4j.Node;
+import org.dom4j.XPath;
+
 /**
  * Loads a specific work item retrieving its id from the request and
  * stores this work item in the request.
  */
-public class LoadWorkItem extends Action {
-
-    private static final Logger log = Logger.getLogger("web");
+public class LoadWorkItem extends AbstractAction {
 
-    public ActionForward execute(ActionMapping mapping, ActionForm form,
-                                 HttpServletRequest request, HttpServletResponse response) throws Exception {
+    public void execute() throws Exception {
         ActionErrors errors = new ActionErrors();
 
         Long wid = new Long(request.getParameter("wid"));
@@ -144,10 +145,10 @@
 
         if (!errors.isEmpty()) {
             saveErrors(request, errors);
-            return (mapping.findForward("home"));
+            setForward("home");
         }
 
-        return (mapping.findForward("success"));
+        setForward("success");
     }
 
 }

Modified: incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/LoadWorkList.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/LoadWorkList.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/LoadWorkList.java (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/java/org/apache/agila/bpel/web/worklist/action/LoadWorkList.java Wed Jan  4 13:19:47 2006
@@ -15,20 +15,17 @@
  */
 package org.apache.agila.bpel.web.worklist.action;
 
+import java.util.Collection;
+
 import org.apache.agila.bpel.client.AgilaWorkList;
 import org.apache.agila.bpel.web.common.AbstractAction;
 
-import org.apache.log4j.Logger;
-
-import java.util.Collection;
-
 /**
  * This action is called before the worklist is displayed to load the work list
  * in the request so that the following jsp can directly display it.
  */
 public class LoadWorkList extends AbstractAction {
 
-    private static final Logger log = Logger.getLogger("web");
 
     public void execute() throws Exception {
 

Modified: incubator/agila/trunk/modules/bpel/client/web/src/webapp/WEB-INF/struts-config-engine.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/webapp/WEB-INF/struts-config-engine.xml?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/webapp/WEB-INF/struts-config-engine.xml (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/webapp/WEB-INF/struts-config-engine.xml Wed Jan  4 13:19:47 2006
@@ -31,6 +31,14 @@
         </action>
         <action path="/loadSendMessageForm" type="org.apache.struts.actions.ForwardAction" parameter="sendMessageForm"/>
 
+        <action path="/deleteInstance" type="org.apache.agila.bpel.web.engine.action.DeleteInstance">
+            <forward name="success" path="/loadInstanceView.do"/>
+        </action>
+
+        <action path="/terminateInstance" type="org.apache.agila.bpel.web.engine.action.TerminateInstance">
+            <forward name="success" path="/loadInstanceView.do"/>
+        </action>
+        
     </action-mappings>
 
 </struts-config>

Modified: incubator/agila/trunk/modules/bpel/client/web/src/webapp/instanceView.jsp
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/webapp/instanceView.jsp?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/webapp/instanceView.jsp (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/webapp/instanceView.jsp Wed Jan  4 13:19:47 2006
@@ -32,6 +32,10 @@
                             <a href='loadInstanceAuditView.do?instanceId=<%=actInstId%>'>
                                 Audit
                             </a>
+                            &nbsp;
+                            <a href='terminateInstance.do?instanceId=<%=actInstId%>'>
+                                Terminate
+                            </a>
                             </nobr>
                             </th>
                         </tr>
@@ -77,6 +81,10 @@
                             <th><bean:message key="text.instance.label"/><%=termInstId%>
                             <a href='loadInstanceAuditView.do?instanceId=<%=termInstId%>'>
                                 Audit
+                            </a>
+                            &nbsp;
+                            <a href='deleteInstance.do?instanceId=<%=termInstId%>'>
+                                Delete
                             </a>
                             </nobr>
                             </th>

Modified: incubator/agila/trunk/modules/bpel/client/web/src/webapp/sentMessagesList.jsp
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/webapp/sentMessagesList.jsp?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/webapp/sentMessagesList.jsp (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/webapp/sentMessagesList.jsp Wed Jan  4 13:19:47 2006
@@ -5,10 +5,28 @@
 <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
 <%!
 public String[] parseKey(String str) {
+	// Sample: asyncSenderLink/{http://localhost:9090/axis/services/AxisAsyncSenderService}AsyncSender/send
     String [] res = new String [3];
+
+	String ns = "";
+	int bopen = str.indexOf("{");
+	int bclose = str.indexOf("}");
+	if(bopen > 0)
+	{
+		// get ns
+		ns = str.substring( bopen , bclose + 1 );
+		// remove ns form string
+		str = str.substring(0, bopen) + str.substring(bclose + 1 ,str.length());
+	}
+		
     StringTokenizer st = new StringTokenizer(str,"/");
-    for(int i = 0 ; i < 3 ; i++) {
-        res[i] = st.nextToken();
+    for(int i = 0 ; i < res.length ; i++) 
+    {
+    		res[i] = st.nextToken();
+    		if(i == 1)
+    		{ 
+    			res[i] += ns;
+    		}
     }
     return res;
 }

Modified: incubator/agila/trunk/modules/bpel/client/web/src/webapp/xmlbody.jsp
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/client/web/src/webapp/xmlbody.jsp?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/client/web/src/webapp/xmlbody.jsp (original)
+++ incubator/agila/trunk/modules/bpel/client/web/src/webapp/xmlbody.jsp Wed Jan  4 13:19:47 2006
@@ -1,10 +1,12 @@
+<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
 <%@ page import="java.util.Map"%>
 <%
     String fromMap = null;
-    if((fromMap=(String) request.getParameter("fromMap"))!=null){%>
-        <%=((Map)session.getAttribute("xmlmap")).get(fromMap)%>
-    <%} else {%>
-        <?xml version="1.0" encoding="UTF-8"?>
-        <%=session.getAttribute("xmlstring")%>
-    <%}
-%>
\ No newline at end of file
+    if((fromMap=(String) request.getParameter("fromMap"))!=null){
+        request.setAttribute("xmlstring",(String)((Map)session.getAttribute("xmlmap")).get(fromMap));
+    }
+    else {%>
+        &lt;?xml version="1.0" encoding="UTF-8"?&gt;
+    <%}%>
+    <bean:write name="xmlstring" filter="true" />
+

Modified: incubator/agila/trunk/modules/bpel/common/src/java/org/apache/agila/bpel/common/util/NSUtil.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/common/src/java/org/apache/agila/bpel/common/util/NSUtil.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/common/src/java/org/apache/agila/bpel/common/util/NSUtil.java (original)
+++ incubator/agila/trunk/modules/bpel/common/src/java/org/apache/agila/bpel/common/util/NSUtil.java Wed Jan  4 13:19:47 2006
@@ -15,15 +15,23 @@
  */
 package org.apache.agila.bpel.common.util;
 
-import org.dom4j.*;
-
 import java.util.HashMap;
 import java.util.List;
 
-/**
- * Utility class for namespace manipulation.
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+import org.dom4j.Node;
+import org.dom4j.QName;
+import org.dom4j.XPath;
+
+/**  
+ * Utility class for namespace manipulation.  
  */
-public class NSUtil {
+public class NSUtil { 
+	
+    public static final String NS_SEPARATOR = ":";
 
     public static String extractFileNameFromNS(String targetNS) {
         // Removing http:
@@ -43,7 +51,7 @@
 
     /**
      * Analyzes the namespace declarations of a WS-BPEL document to get the corresponding
-     * WSDL document namespace.
+     * WSDL document namespace. 
      * @param doc
      * @return
      */
@@ -76,5 +84,104 @@
         return wsdlNS;
     }
 
+    /**
+     * looks for namespaces according to prefixes, it search recursively to the root element
+     * @param childElement element, from which we are looking for namespace
+     * @param prefix prefix, for which we want to find defined namespace
+     * @return namespace defined for prefix or null
+     */
+    
+    public static Namespace findNS(Element childElement,String prefix)
+    {
+        Namespace retNS = childElement.getNamespaceForPrefix(prefix); 
+        if(retNS==null  && !childElement.isRootElement())
+        {
+            //Element parent = childElement.getParent();
+            retNS = findNS(childElement.getParent(),prefix);
+        }
+        return retNS;
+    }
+    
+    /**
+     * tries to find targetNamespace for element, or xmlns of root element, if no targetNamespace was found
+     * 
+     * @param childElement element, from which we are looking for namespace
+     * @return targetNamespace or xmlns or null
+     */
+    
+    public static Namespace findTargetNS(Element childElement)
+    {
+        String strNS = childElement.valueOf("@targetNamespace");
+        Namespace retNS; 
+        if(strNS.equals(""))
+        {
+            if(childElement.isRootElement())
+            {
+                retNS = childElement.getNamespace();
+            }
+            else
+            {
+                retNS = findTargetNS(childElement.getParent());
+            }
+        }
+        else
+            retNS = new Namespace("",strNS);
+        return retNS;
+    }    
+    
+    /**
+     * Returns a QName representation of the element specified by the 
+     * parameter name. element is used for resolving the namespace associated 
+     * with the element's name prefix.
+     *  
+     * @param elementName an elements name with "prefix:name" or just "name"
+     * @param searchElement element in document from which to start searching for the namespace
+     *  
+     * @return QName representation of the element
+     * @throws Exception 
+     */
+    public static QName findAsQname(String elementName, Element searchElement ) throws Exception
+    {
+    	
+    	    String strNS = null;
+    	
+        int sepIndex = elementName.indexOf(NSUtil.NS_SEPARATOR);
+        // prefix empty?
+        if (sepIndex > 0) {
+            strNS = elementName.substring(0,sepIndex);
+            elementName = elementName.substring(sepIndex + 1, elementName.length());
+            
+            Namespace foundNS = findNS(searchElement,strNS); //strNS acts first as prefix
+            if(foundNS == null)
+                    throw new Exception("Could not find Namespace for prefix " +  strNS);
+            strNS = foundNS.getURI();   
+        }
+        else
+        {
+            Namespace foundNS = findTargetNS(searchElement); //strNS acts first as prefix
+            if(foundNS == null)
+                    throw new Exception("Could not find targetNamespace or default Namespace xmlns");
+            strNS = foundNS.getURI();
+        }
+        return QName.get(elementName,"",strNS); 
+    }
+    
+    /**
+     * Extracts the element name from its prefix
+     * 
+     * @param element element name as String with or without prefix
+     * @return element name
+     */
+    public static String extractElementName(String element)
+    {
+    			int sepIndex = element.indexOf(NSUtil.NS_SEPARATOR);
+    		    if (sepIndex > 0) {
+    		    		return element.substring(sepIndex + 1, element.length());
+    		    }else
+    		    {
+    		    		return element;
+    		    }
+    	
+    }
 
 }

Modified: incubator/agila/trunk/modules/bpel/dependencies.ent
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/dependencies.ent?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/dependencies.ent (original)
+++ incubator/agila/trunk/modules/bpel/dependencies.ent Wed Jan  4 13:19:47 2006
@@ -6,6 +6,15 @@
   <properties>&property-war-bundle;</properties>
 ">
 
+<!ENTITY dependency-addressing "
+        <dependency>
+            <groupId>addressing</groupId>
+            <artifactId>addressing</artifactId>
+            <version>1.0</version>
+	    &properties-war-bundle;	
+        </dependency>
+">
+
 <!ENTITY dependency-jta "
     <dependency>
         <id>jta</id>
@@ -466,9 +475,9 @@
 
           <id>wsdl4j</id>
 
-          <version>1.4</version>
+          <version>1.5.2</version>
 
-          <url>http://www-124.ibm.com/developerworks/projects/wsdl4j/</url>
+          <url>http://wsdl4j.sourceforge.net/downloads/</url>
 
           &properties-war-bundle;
 
@@ -484,7 +493,7 @@
 
           <artifactId>wsdl4j-qname</artifactId>
 
-          <version>1.4</version>
+          <version>1.5.2</version>
 
           <url>http://www-124.ibm.com/developerworks/projects/wsdl4j/</url>
 

Modified: incubator/agila/trunk/modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/persistence/XMLDataAccess.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/persistence/XMLDataAccess.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/persistence/XMLDataAccess.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/common/src/java/org/apache/agila/bpel/engine/common/persistence/XMLDataAccess.java Wed Jan  4 13:19:47 2006
@@ -17,12 +17,13 @@
 
 import java.text.MessageFormat;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.agila.bpel.common.configuration.CommonConfiguration;
 import org.apache.xindice.client.xmldb.services.CollectionManager;
 import org.apache.xindice.util.XindiceException;
 import org.apache.xindice.xml.dom.DOMParser;
@@ -35,7 +36,6 @@
 import org.jaxen.dom4j.Dom4jXPath;
 import org.jaxen.expr.DefaultAbsoluteLocationPath;
 import org.jaxen.expr.DefaultNameStep;
-import org.apache.agila.bpel.common.configuration.CommonConfiguration;
 import org.xmldb.api.DatabaseManager;
 import org.xmldb.api.base.Collection;
 import org.xmldb.api.base.Resource;
@@ -351,6 +351,25 @@
         try {
             XMLResource document = (XMLResource) parent.getResource(docId);
             parent.removeResource(document);
+        } catch (XMLDBException e) {
+            throw new XMLSessionException("An error occured when trying to delete the document with id " + docId +
+                    " from collection " + parent, e);
+        }
+    }
+
+    /**
+     * Tries to remove the given document from the parent collection
+     * 
+     * @param parent collection from which to delete the document
+     * @param docId a documents id
+     */
+    public static void deleteDocumentIfExists(Collection parent, String docId) throws XMLSessionException {
+        try {
+            XMLResource document = (XMLResource) parent.getResource(docId);
+            if(document != null)
+            {
+            		parent.removeResource(document);
+            }
         } catch (XMLDBException e) {
             throw new XMLSessionException("An error occured when trying to delete the document with id " + docId +
                     " from collection " + parent, e);

Modified: incubator/agila/trunk/modules/bpel/engine/core/project.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/project.xml?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/project.xml (original)
+++ incubator/agila/trunk/modules/bpel/engine/core/project.xml Wed Jan  4 13:19:47 2006
@@ -17,6 +17,7 @@
     </description>
 
     <dependencies>
+        &dependency-addressing;
         &dependency-agila-agila-common;
         &dependency-agila-agila-client-api;
         &dependency-agila-agila-engine-common;

Modified: incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/activity.hbm.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/activity.hbm.xml?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/activity.hbm.xml (original)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/activity.hbm.xml Wed Jan  4 13:19:47 2006
@@ -116,11 +116,13 @@
             </subclass>
 
 			<subclass name="org.apache.agila.bpel.engine.priv.core.definition.impl.SwitchImpl" discriminator-value="SWITCH">
+				<!-- renamed because mysql cannot create a table named stwich_cond -->
 				<list name="conditions" table="SWITCH_COND">
                     <jcs-cache usage="read-write"/> 
 					<key column="SWITCH_ID"/>
 					<index column="IDX"/>
-					<element column="CONDITION" type="string"/>
+					<!-- renamed column as condition is a reserved word in mysql -->
+					<element column="COND" type="string"/>
 				</list>
 			</subclass>
 

Added: incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/partnerlink.hbm.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/partnerlink.hbm.xml?rev=365997&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/partnerlink.hbm.xml (added)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/partnerlink.hbm.xml Wed Jan  4 13:19:47 2006
@@ -0,0 +1,25 @@
+<?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.engine.priv.core.definition.impl.PartnerLinkImpl" table="PARTNERLINK">
+        <cache usage="read-write"/>
+        <id name="id" column="id" type="long">
+            <generator class="hilo">
+                <param name="table">PARTNERLINK_ID</param>
+                <param name="column">NEXTID</param>
+            </generator>
+        </id>
+         
+        <property name="name" type="string" not-null="true"/>
+        <property name="partnerLinkType" type="string" not-null="true"/>
+
+      <many-to-one name="myRole" not-null="false" 
+            class="org.apache.agila.bpel.engine.priv.core.definition.impl.PartnerLinkRoleImpl" column="MYROLE_ID"/>
+      <many-to-one name="partnerRole" not-null="false"
+            class="org.apache.agila.bpel.engine.priv.core.definition.impl.PartnerLinkRoleImpl" column="PART_ROLE_ID"/>
+
+    </class>
+</hibernate-mapping>
\ No newline at end of file

Added: incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/partnerlinkrole.hbm.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/partnerlinkrole.hbm.xml?rev=365997&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/partnerlinkrole.hbm.xml (added)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/partnerlinkrole.hbm.xml Wed Jan  4 13:19:47 2006
@@ -0,0 +1,19 @@
+<?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.engine.priv.core.definition.impl.PartnerLinkRoleImpl" table="PLK_ROLE">
+        <cache usage="read-write"/>
+        <id name="id" column="id" type="long">
+            <generator class="hilo">
+                <param name="table">PLK_ROLE_ID</param>
+                <param name="column">NEXTID</param>
+            </generator>
+        </id>
+        <property name="name" type="string" not-null="true"/>
+        <property name="portType" type="string" not-null="true"/>
+        <property name="namespace" type="string" not-null="true"/>
+    </class>
+</hibernate-mapping>
\ No newline at end of file

Modified: incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/process.hbm.xml
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/process.hbm.xml?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/process.hbm.xml (original)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/hibernate/org/apache/agila/bpel/engine/process.hbm.xml Wed Jan  4 13:19:47 2006
@@ -29,6 +29,11 @@
             <key column="PROC_ID"/>
             <one-to-many class="org.apache.agila.bpel.engine.priv.core.definition.impl.CorrelationSetImpl"/>
         </set>
+        <set name="partnerLinks" cascade="save-update">
+            <cache usage="read-write"/> 
+            <key column="PROC_ID"/>
+            <one-to-many class="org.apache.agila.bpel.engine.priv.core.definition.impl.PartnerLinkImpl"/>
+        </set>
         <set name="properties" cascade="save-update">
             <cache usage="read-write"/>
             <key column="PROC_ID"/>

Modified: incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/AgilaEngineAdmin.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/AgilaEngineAdmin.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/AgilaEngineAdmin.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/AgilaEngineAdmin.java Wed Jan  4 13:19:47 2006
@@ -101,4 +101,21 @@
    * @throws EngineException
    */
   Collection getEventLog() throws EngineException;
+  
+  /**
+   * Deletes a completed instance
+   *
+   * @return
+   * @throws EngineException
+   */
+  public void deleteTerminatedInstance(long instanceId) throws EngineException;
+  
+  /**
+   * Terminates an instance
+   *
+   * @return
+   * @throws EngineException
+   */
+  public void terminateInstance(long instanceId) throws EngineException;
+  
 }

Modified: incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/AgilaEngineAdminImpl.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/AgilaEngineAdminImpl.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/AgilaEngineAdminImpl.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/AgilaEngineAdminImpl.java Wed Jan  4 13:19:47 2006
@@ -158,7 +158,7 @@
         try {
             instances = ProcessInstanceFactory.findActiveInstances();
         } catch (DBSessionException e) {
-            throw new EngineException("An error occured when trying to find instances.", e);
+            throw new EngineException("An error occurred when trying to find instances.", e);
         }
         return extractInstancesWithCorrelation(instances);
     }
@@ -172,7 +172,7 @@
         try {
             return ExecutionEventFactory.findLastLogEntries();
         } catch (Throwable e) {
-            throw new EngineException("An error occured when trying to find instance by id.", e);
+            throw new EngineException("An error occurred when trying to find instance by id.", e);
         }
     }
 
@@ -195,7 +195,7 @@
             }
             return audit;
         } catch (Throwable e) {
-            throw new EngineException("An error occured when trying to find instance by id.", e);
+            throw new EngineException("An error occurred when trying to find instance by id.", e);
         }
     }
 
@@ -208,7 +208,7 @@
         try {
             return ProcessFactory.findAll();
         } catch (DBSessionException e) {
-            throw new EngineException("An error occured when trying to find instances.", e);
+            throw new EngineException("An error occurred when trying to find instances.", e);
         }
     }
 
@@ -222,7 +222,7 @@
         try {
             instances = ProcessInstanceFactory.findCompletedInstances();
         } catch (DBSessionException e) {
-            throw new EngineException("An error occured when trying to find instances.", e);
+            throw new EngineException("An error occurred when trying to find instances.", e);
         }
         return extractInstancesWithCorrelation(instances);
     }
@@ -305,7 +305,7 @@
                 } catch (MalformedURLException e) {
                     log.warn("A document that has already been deployed couldn't be parsed: " + documents[m].getAbsolutePath());
                 } catch (DBSessionException e) {
-                    log.warn("A database exception occured: " + documents[m].getAbsolutePath());
+                    log.warn("A database exception occurred: " + documents[m].getAbsolutePath());
                 } catch (FinderException e) {
 //                     Only thrown if a process could not be found in DB. That could be perfectly normal if the process
 //                     has been deleted, in this case we're just not adding it in the process list.
@@ -322,4 +322,33 @@
         }
         return reader;
     }
+
+    /**
+     * deletes a process instance with all it's referenced  
+     * elements (variables, correlations..) permanently
+     * @@org.apache.agila.bpel.engine.common.aspect.Transactional
+     */
+	public void deleteTerminatedInstance(long instanceId) throws EngineException {
+	      try {
+	          ProcessInstanceFactory.deleteInstance(new Long(instanceId));
+	      } catch (FinderException e) {
+	          throw new EngineException("An error occurred when trying to delete a instance." + e);
+	      } catch (DeletionException e) {
+	          throw new EngineException("An error occurred when trying to delete a instance." + e);
+	      }
+	}
+	
+    /** 
+     * terminates an active process instance
+     * @@org.apache.agila.bpel.engine.common.aspect.Transactional
+     */
+	public void terminateInstance(long instanceId) throws EngineException {
+		try {
+			ProcessInstanceFactory.terminateInstance(new Long(instanceId)); 
+		} catch (NumberFormatException e) {
+	          throw new EngineException("An error occurred when trying to terminate a instance." + e);
+		} catch (FinderException e) {
+	          throw new EngineException("An error occurred when trying to terminate a instance." + e);
+		}
+	}
 }

Modified: incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/AgilaProcess.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/AgilaProcess.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/AgilaProcess.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/AgilaProcess.java Wed Jan  4 13:19:47 2006
@@ -43,4 +43,7 @@
 
     public Collection getProperties();
     public Property getProperty(String propName);
+
+    public Collection getPartnerLinks();
+    public PartnerLink getPartnerLink(String partnerLinkName);
 }

Added: incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/PartnerLink.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/PartnerLink.java?rev=365997&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/PartnerLink.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/PartnerLink.java Wed Jan  4 13:19:47 2006
@@ -0,0 +1,45 @@
+/*
+ * 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.engine.priv.core.definition;
+
+/**
+ * a partner link element with roles
+ * 
+ * @author steffen.horlacher@pansoft.de
+ */
+public interface PartnerLink {
+
+	public Long getId();
+
+	public void setId(Long id);
+
+	public String getName();
+
+	public void setName(String name);
+
+	public String getPartnerLinkType();
+
+	public void setPartnerLinkType(String partnerLinkType);
+
+	public PartnerLinkRole getMyRole();
+
+	public void setMyRole(PartnerLinkRole myRole);
+
+	public PartnerLinkRole getPartnerRole();
+
+	public void setPartnerRole(PartnerLinkRole partnerRole);
+
+}
\ No newline at end of file

Added: incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/PartnerLinkRole.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/PartnerLinkRole.java?rev=365997&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/PartnerLinkRole.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/PartnerLinkRole.java Wed Jan  4 13:19:47 2006
@@ -0,0 +1,42 @@
+/*
+ * 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.engine.priv.core.definition;
+
+/**
+ * a partner link's role element
+ * 
+ * @author steffen.horlacher@pansoft.de
+ *
+ */
+public interface PartnerLinkRole {
+
+	public Long getId();
+
+	public void setId(Long id);
+
+	public String getName();
+
+	public void setName(String name);
+
+	public String getPortType();
+
+	public void setPortType(String portType);
+	 
+	public String getNamespace();
+
+	public void setNamespace(String namespace);
+
+}
\ No newline at end of file

Modified: incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/ProcessFactory.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/ProcessFactory.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/ProcessFactory.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/ProcessFactory.java Wed Jan  4 13:19:47 2006
@@ -20,6 +20,8 @@
 import org.apache.agila.bpel.engine.common.persistence.DeletionException;
 import org.apache.agila.bpel.engine.common.persistence.FinderException;
 import org.apache.agila.bpel.engine.priv.core.definition.impl.CorrelationSetImpl;
+import org.apache.agila.bpel.engine.priv.core.definition.impl.PartnerLinkImpl;
+import org.apache.agila.bpel.engine.priv.core.definition.impl.PartnerLinkRoleImpl;
 import org.apache.agila.bpel.engine.priv.core.definition.impl.ProcessImpl;
 import org.apache.agila.bpel.engine.priv.core.definition.impl.PropertyAliasImpl;
 import org.apache.agila.bpel.engine.priv.core.definition.impl.PropertyImpl;
@@ -188,6 +190,56 @@
         ProcessDAO.create(alias);
 
         return alias;
+    }
+    
+
+    /**
+     * Adds a partnerLink to an existing process.
+     *
+     * @param process
+     * @param name
+     * @param partnerLinkType
+     * @param myRole
+     * @param partnerRole
+     * @return
+     * @throws DBSessionException
+     * @throws FinderException
+     */
+    public static PartnerLink addPartnerLink(AgilaProcess process, String name,
+                                       String partnerLinkType, PartnerLinkRole myRole, PartnerLinkRole partnerRole) throws DBSessionException, FinderException {
+
+    	    PartnerLinkImpl plink = new PartnerLinkImpl();
+    	    plink.setName(name);
+    	    plink.setPartnerLinkType(partnerLinkType);
+    	    plink.setMyRole(myRole);
+    	    plink.setPartnerRole(partnerRole);
+
+        AgilaProcess persistentProcess = getByName(process.getName(), process.getNamespace());
+        ((ProcessImpl) persistentProcess).addPartnerLink(plink);
+
+        ProcessDAO.create(plink);
+
+        return plink;
+    }
+    
+    /**
+     * Adds a persistent Partner Link Role
+     *
+     * @param name
+     * @param portType
+     * @return newly created PartnerLinkRole
+     * @throws DBSessionException
+     */
+    public static PartnerLinkRole addPartnerLinkRole(String name, String portType, String namespace) throws DBSessionException {
+    	
+    	    PartnerLinkRoleImpl plkRole = new PartnerLinkRoleImpl();
+    	    plkRole.setName(name);
+    	    plkRole.setPortType(portType);
+    	    plkRole.setNamespace(namespace);
+    		
+        ProcessDAO.create(plkRole);
+
+        return plkRole;
     }
 
     /**

Added: incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/PartnerLinkImpl.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/PartnerLinkImpl.java?rev=365997&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/PartnerLinkImpl.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/PartnerLinkImpl.java Wed Jan  4 13:19:47 2006
@@ -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.engine.priv.core.definition.impl;
+
+import org.apache.agila.bpel.engine.priv.core.definition.PartnerLink;
+import org.apache.agila.bpel.engine.priv.core.definition.PartnerLinkRole;
+
+/**
+ * @author steffen.horlacher@pansoft.de
+ */
+public class PartnerLinkImpl implements PartnerLink {
+
+	private Long id;
+
+	private String name;
+
+	private String partnerLinkType;
+
+	private PartnerLinkRole myRole;
+
+	private PartnerLinkRole partnerRole;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getPartnerLinkType() {
+		return partnerLinkType;
+	}
+
+	public void setPartnerLinkType(String partnerLinkType) {
+		this.partnerLinkType = partnerLinkType;
+	}
+
+	public PartnerLinkRole getMyRole() {
+		return myRole;
+	}
+
+	public void setMyRole(PartnerLinkRole myRole) {
+		this.myRole = myRole;
+	}
+
+	public PartnerLinkRole getPartnerRole() {
+		return partnerRole;
+	}
+
+	public void setPartnerRole(PartnerLinkRole partnerRole) {
+		this.partnerRole = partnerRole;
+	}
+
+	public String toString() {
+		final StringBuffer buf = new StringBuffer();
+		buf.append("PartnerLinkImpl");
+		buf.append("{id=").append(id);
+		buf.append(",name=").append(name);
+		buf.append(",type=").append(partnerLinkType);
+		if(myRole != null)
+			buf.append(",myRole=").append(myRole.getName());
+		if(partnerRole != null)
+			buf.append(",partnerRole=").append(partnerRole.getName());
+		buf.append('}');
+		return buf.toString();
+	}
+
+}

Added: incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/PartnerLinkRoleImpl.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/PartnerLinkRoleImpl.java?rev=365997&view=auto
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/PartnerLinkRoleImpl.java (added)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/PartnerLinkRoleImpl.java Wed Jan  4 13:19:47 2006
@@ -0,0 +1,72 @@
+/*
+ * 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.engine.priv.core.definition.impl;
+
+import org.apache.agila.bpel.engine.priv.core.definition.PartnerLinkRole;
+
+/**
+ * @author steffen.horlacher@pansoft.de
+ */
+public class PartnerLinkRoleImpl implements PartnerLinkRole {
+
+	private Long id;
+	private String name; 
+	private String portType;
+	private String namespace;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getPortType() {
+		return portType;
+	}
+
+	public void setPortType(String portType) {
+		this.portType = portType;
+	}
+
+	public String getNamespace() {
+		return namespace;
+	}
+
+	public void setNamespace(String namespace) {
+		this.namespace = namespace;
+	}
+
+	public String toString() {
+		final StringBuffer buf = new StringBuffer();
+		buf.append("PartnerLinkRoleImpl");
+		buf.append("{id=").append(id);
+		buf.append(",name=").append(name);
+		buf.append(",portType=").append(portType);
+		buf.append(",namespace=").append(namespace);
+		buf.append('}');
+		return buf.toString();
+	}
+}

Modified: incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/ProcessImpl.java
URL: http://svn.apache.org/viewcvs/incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/ProcessImpl.java?rev=365997&r1=365996&r2=365997&view=diff
==============================================================================
--- incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/ProcessImpl.java (original)
+++ incubator/agila/trunk/modules/bpel/engine/core/src/java/org/apache/agila/bpel/engine/priv/core/definition/impl/ProcessImpl.java Wed Jan  4 13:19:47 2006
@@ -21,6 +21,7 @@
 import org.apache.agila.bpel.engine.exception.EngineException;
 import org.apache.agila.bpel.engine.priv.core.definition.Activity;
 import org.apache.agila.bpel.engine.priv.core.definition.CorrelationSet;
+import org.apache.agila.bpel.engine.priv.core.definition.PartnerLink;
 import org.apache.agila.bpel.engine.priv.core.definition.Property;
 import org.apache.agila.bpel.engine.priv.core.definition.AgilaProcess;
 import org.apache.agila.bpel.engine.priv.core.dynamic.ProcessInstance;
@@ -47,6 +48,7 @@
   private Collection instances = new HashSet();
   private Collection correlationSets = new HashSet();
   private Collection properties = new HashSet();
+  private Collection partnerLinks = new HashSet();
 
   private ProcessInstanceFactory piFactory = new ProcessInstanceFactory();
 
@@ -150,6 +152,30 @@
 
   public void addProperty(Property prop) {
     this.properties.add(prop);
+  }
+  
+  public Collection getPartnerLinks() {
+	return partnerLinks;
+  }
+
+  public PartnerLink getPartnerLink(String partnerLinkName) {
+	PartnerLink result = null;
+	for (Iterator plinkIter = partnerLinks.iterator(); plinkIter.hasNext();) {
+		PartnerLink plink = (PartnerLink) plinkIter.next();
+		if (plink.getName().equals(partnerLinkName)) {
+			result = plink;
+			break;
+		}
+	}
+	return result;
+  }
+
+  public void setPartnerLinks(Collection partnerLinks) {
+	  this.partnerLinks = partnerLinks;
+  }
+
+  public void addPartnerLink(PartnerLink partnerLink) {
+	  this.partnerLinks.add(partnerLink);
   }
 
   public ProcessInstance execute(String correlationSetName, Map correlation) throws EngineException {



Mime
View raw message