[jbpm-commits] JBoss JBPM SVN: r2129 - in jbpm4/pvm/trunk/modules/core/src: main/java/org/jbpm/pvm/internal/svc and 4 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Sep 5 05:48:09 EDT 2008


Author: tom.baeyens at jboss.com
Date: 2008-09-05 05:48:08 -0400 (Fri, 05 Sep 2008)
New Revision: 2129

Removed:
   jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/ActivityInstanceCmd.java
Modified:
   jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java
   jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java
   jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java
   jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java
   jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java
   jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java
   jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java
   jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/pvm.cache.xml
   jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java
   jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java
   jbpm4/pvm/trunk/modules/core/src/test/resources/logging.properties
Log:
cleaned up obsolete dbid stuff from the commands and services

Deleted: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/ActivityInstanceCmd.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/ActivityInstanceCmd.java	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/ActivityInstanceCmd.java	2008-09-05 09:48:08 UTC (rev 2129)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cmd;
-
-import java.util.Map;
-
-import org.jbpm.pvm.Execution;
-import org.jbpm.pvm.env.Environment;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ActivityInstanceCmd extends AbstractCommand<Execution> {
-
-  private static final long serialVersionUID = 1L;
-  
-  protected long activityInstanceDbid;
-  protected String signalName;
-  protected Map<String, Object> parameters;
-  
-  public ActivityInstanceCmd(long activityInstanceDbid, String signalName, Map<String, Object> parameters) {
-    this.activityInstanceDbid = activityInstanceDbid;
-    this.signalName = signalName;
-    this.parameters = parameters;
-  }
-
-  public Execution execute(Environment environment) throws Exception {
-    return null;
-  }
-}

Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java	2008-09-05 09:48:08 UTC (rev 2129)
@@ -22,6 +22,7 @@
 package org.jbpm.pvm.internal.cmd;
 
 import org.jbpm.pvm.Execution;
+import org.jbpm.pvm.PvmException;
 import org.jbpm.pvm.env.Environment;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.session.PvmDbSession;
@@ -34,22 +35,25 @@
   
   private static final long serialVersionUID = 1L;
   
-  protected long executionDbid;
   protected String executionId;
   protected String processDefinitionName;
   protected String executionKey;
   
   public FindExecutionCmd(String processDefinitionName, String executionKey) {
+    if (processDefinitionName==null) {
+      throw new PvmException("processDefinitionName is null");
+    }
     this.processDefinitionName = processDefinitionName;
+    if (executionKey==null) {
+      throw new PvmException("executionKey is null");
+    }
     this.executionKey = executionKey;
   }
 
-  // TODO: REMOVE
-  public FindExecutionCmd(long executionDbid) {
-    this.executionDbid = executionDbid;
-  }
-
   public FindExecutionCmd(String executionId) {
+    if (executionId==null) {
+      throw new PvmException("executionId is null");
+    }
     this.executionId = executionId;
   }
 
@@ -57,10 +61,7 @@
     PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
     if (executionId!=null) {
       return pvmDbSession.findExecutionById(executionId);
-    } else if (processDefinitionName!=null && executionKey!=null){
-      return pvmDbSession.findExecutionByKey(processDefinitionName, executionKey);
-    }
-    return pvmDbSession.get(ExecutionImpl.class, executionDbid);
+    } 
+    return pvmDbSession.findExecutionByKey(processDefinitionName, executionKey);
   }
-
 }

Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java	2008-09-05 09:48:08 UTC (rev 2129)
@@ -21,6 +21,7 @@
  */
 package org.jbpm.pvm.internal.cmd;
 
+import org.jbpm.pvm.PvmException;
 import org.jbpm.pvm.env.Environment;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.pvm.model.OpenProcessDefinition;
@@ -34,25 +35,19 @@
 
   private static final long serialVersionUID = 1L;
 
-  protected long processDefinitionDbid;
   protected String processDefinitionName;
   protected int processDefinitionVersion;
   
   public FindProcessDefinitionCmd(String processDefinitionName, int processDefinitionVersion) {
+    if (processDefinitionName==null) {
+      throw new PvmException("processDefinitionName is null");
+    }
     this.processDefinitionName = processDefinitionName;
     this.processDefinitionVersion = processDefinitionVersion;
   }
 
-  public FindProcessDefinitionCmd(long processDefinitionDbid) {
-    this.processDefinitionDbid = processDefinitionDbid;
-  }
-
   public OpenProcessDefinition execute(Environment environment) throws Exception {
     PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
-    if (processDefinitionName!=null) {
-      return pvmDbSession.findProcessDefinitionByName(processDefinitionName, processDefinitionVersion);
-    } else {
-      return pvmDbSession.get(ProcessDefinitionImpl.class, processDefinitionDbid);
-    }
+    return pvmDbSession.findProcessDefinitionByName(processDefinitionName, processDefinitionVersion);
   }
 }

Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetVariablesCmd.java	2008-09-05 09:48:08 UTC (rev 2129)
@@ -25,9 +25,9 @@
 import java.util.List;
 import java.util.Map;
 
+import org.jbpm.pvm.PvmException;
 import org.jbpm.pvm.client.ClientExecution;
 import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.session.PvmDbSession;
 
 /**
@@ -37,31 +37,25 @@
 
   private static final long serialVersionUID = 1L;
   
-  protected long executionDbid = -1;
   protected String executionId;
   protected List<String> variableNames;
   
-  public GetVariablesCmd(long executionDbid, List<String> variableNames) {
-    this.executionDbid = executionDbid;
-    this.variableNames = variableNames;
-  }
-
   public GetVariablesCmd(String executionId, List<String> variableNames) {
+    if (executionId==null) {
+      throw new PvmException("executionId is null");
+    }
     this.executionId = executionId;
+    if (variableNames==null) {
+      throw new PvmException("variableNames is null");
+    }
     this.variableNames = variableNames;
   }
 
   public Map<String, Object> execute(Environment environment) throws Exception {
     PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
     
-    ClientExecution execution = null;
+    ClientExecution execution = pvmDbSession.findExecutionById(executionId);
     
-    if (executionId!=null) {
-      execution = pvmDbSession.findExecutionById(executionId);
-    } else {
-      execution = pvmDbSession.get(ExecutionImpl.class, executionDbid);
-    }
-    
     Map<String, Object> variables = new HashMap<String, Object>();
     for (String variableName : variableNames) {
       Object value = execution.getVariable(variableName);

Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/SetVariablesCmd.java	2008-09-05 09:48:08 UTC (rev 2129)
@@ -22,6 +22,7 @@
 package org.jbpm.pvm.internal.cmd;
 
 import org.jbpm.pvm.Execution;
+import org.jbpm.pvm.PvmException;
 import org.jbpm.pvm.client.ClientExecution;
 import org.jbpm.pvm.env.Environment;
 
@@ -33,48 +34,27 @@
   
   private static final long serialVersionUID = 1L;
   
-  protected long executionDbid;
   protected String executionId = null;
   
-  public SetVariablesCmd() {
-  }
-
-  // TODO: REMOVE
-  public SetVariablesCmd(long executionDbid) {
-    this.executionDbid = executionDbid;
-  }
-
-  // TODO: REMOVE
-  public SetVariablesCmd(long executionDbid, String key, Object variable) {
-    this.executionDbid = executionDbid;
-    addVariable(key, variable);
-  }
-
   public SetVariablesCmd(String executionId) {
+    if (executionId==null) {
+      throw new PvmException("executionId is null"); 
+    }
     this.executionId = executionId;
   }
 
   public SetVariablesCmd(String executionId, String key, Object variable) {
-    this.executionId = executionId;
+    this(executionId);
     addVariable(key, variable);
   }
 
   public Execution execute(Environment environment) throws Exception {
-    ClientExecution execution = null;
-    if (executionId!=null) {
-      execution = getExecution(environment, executionId);
-    } else {
-      execution = getExecution(environment, executionDbid);
-    }
-    
+    ClientExecution execution = getExecution(environment, executionId);
     execution.setVariables(variables);
     return execution;
   }
 
-  public long getExecutionId() {
-    return executionDbid;
+  public String getExecutionId() {
+    return executionId;
   }
-  public void setExecutionId(long executionId) {
-    this.executionDbid = executionId;
-  }
 }

Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/StartExecutionCmd.java	2008-09-05 09:48:08 UTC (rev 2129)
@@ -28,7 +28,6 @@
 import org.jbpm.pvm.client.ClientProcessDefinition;
 import org.jbpm.pvm.client.ClientProcessInstance;
 import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.pvm.session.PvmDbSession;
 
 /**

Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java	2008-09-05 09:48:08 UTC (rev 2129)
@@ -22,13 +22,11 @@
 package org.jbpm.pvm.internal.svc;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import org.jbpm.pvm.Execution;
 import org.jbpm.pvm.ExecutionService;
-import org.jbpm.pvm.internal.cmd.ActivityInstanceCmd;
 import org.jbpm.pvm.internal.cmd.CommandService;
 import org.jbpm.pvm.internal.cmd.FindExecutionCmd;
 import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
@@ -127,26 +125,6 @@
     return commandService.execute(new SignalCmd(processDefinitionName, executionKey, null, parameters));
   }
 
-  public Execution signalActivityInstance(long activityInstanceDbid) {
-    return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, null, null));
-  }
-
-  public Execution signalActivityInstance(long activityInstanceDbid, String signalName) {
-    return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, signalName, null));
-  }
-
-  public Execution signalActivityInstance(long activityInstanceDbid, String signalName, Map<String, Object> parameters) {
-    return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, signalName, parameters));
-  }
-
-  public Execution signalActivityInstance(long activityInstanceDbid, Map<String, Object> parameters) {
-    return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, null, parameters));
-  }
-
-  public Execution findExecution(long executionDbid) {
-    return commandService.execute(new FindExecutionCmd(executionDbid));
-  }
-
   public Execution findExecution(String processDefinitionName, String key) {
     return commandService.execute(new FindExecutionCmd(processDefinitionName, key));
   }
@@ -155,26 +133,6 @@
     return commandService.execute(new FindExecutionCmd(executionId));
   }
 
-  // TODO: REMOVE
-  public Map<String, Object> getVariables(long executionDbid, List<String> variableNames) {
-    return commandService.execute(new GetVariablesCmd(executionDbid, variableNames));
-  }
-
-  // TODO: REMOVE
-  public Execution setVariable(long executionDbid, String name, Object value) {
-    Map<String, Object> variables = new HashMap<String, Object>();
-    variables.put(name, value);
-    return setVariables(executionDbid, variables);
-  }
-
-  // TODO: REMOVE
-  public Execution setVariables(long executionDbid, Map<String, Object> variables) {
-    SetVariablesCmd cmd = new SetVariablesCmd(executionDbid);
-    cmd.setVariables(variables);
-    return commandService.execute(cmd);
-  }
-
-  
   public Object getVariable(String executionId, String variableName) {
     List<String> variableNames = new ArrayList<String>();
     variableNames.add(variableName);

Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java	2008-09-05 09:48:08 UTC (rev 2129)
@@ -68,10 +68,6 @@
     return (List)commandService.execute(new FindProcessDefinitionsCmd(processDefinitionName));
   }
 
-  public ProcessDefinition findProcessDefinition(long processDefinitionDbid) {
-    return commandService.execute(new FindProcessDefinitionCmd(processDefinitionDbid));
-  }
-
   public CommandService getCommandService() {
     return commandService;
   }

Modified: jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/pvm.cache.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/pvm.cache.xml	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/pvm.cache.xml	2008-09-05 09:48:08 UTC (rev 2129)
@@ -8,6 +8,7 @@
 	<class-cache class="org.jbpm.pvm.internal.model.ObjectReference" />
   <class-cache class="org.jbpm.pvm.internal.model.VariableDefinitionImpl" />
   <class-cache class="org.jbpm.pvm.internal.model.TimerDefinitionImpl" />
+  <class-cache class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
 
 	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.exceptionHandlers" />
 	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.events" />
@@ -30,5 +31,8 @@
 	<collection-cache collection="org.jbpm.pvm.internal.model.EventImpl.listenerReferences" />
 	  
 	<collection-cache collection="org.jbpm.pvm.internal.model.ExceptionHandlerImpl.eventListenerReferences" />
-	  
+
+  <collection-cache collection="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.argDescriptors" />
+  <collection-cache collection="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.operations" />
+	
 </hibernate-cache>

Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/basicfeatures/BasicExecutionFlowDbTest.java	2008-09-05 09:48:08 UTC (rev 2129)
@@ -77,7 +77,9 @@
 
     Deployment deployment = new Deployment(processDefinition);
     processService.deploy(deployment);
-    
+
+    executionService.startExecution("myProcess:1", "zero");
+
     Execution processInstance = executionService.startExecution("myProcess:1", "one");
     
     List<String> expectedEvents = new ArrayList<String>();

Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java	2008-09-05 09:48:08 UTC (rev 2129)
@@ -31,8 +31,7 @@
  * @author Guillaume Porcher
  *
  */
-public class ProcessCacheDbTest extends EnvironmentDbTestCase
-{
+public class ProcessCacheDbTest extends EnvironmentDbTestCase {
   
   /**
    * Defines a simple process: only nodes.

Modified: jbpm4/pvm/trunk/modules/core/src/test/resources/logging.properties
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/resources/logging.properties	2008-09-05 09:46:46 UTC (rev 2128)
+++ jbpm4/pvm/trunk/modules/core/src/test/resources/logging.properties	2008-09-05 09:48:08 UTC (rev 2129)
@@ -22,7 +22,7 @@
 org.hibernate.cfg.HbmBinder.level=SEVERE
 org.hibernate.cfg.SettingsFactory.level=SEVERE
 # org.hibernate.level=FINE
-# org.hibernate.SQL.level=FINEST
+org.hibernate.SQL.level=FINEST
 # org.hibernate.type.level=FINEST
 # org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
 # org.hibernate.transaction.level=FINEST




More information about the jbpm-commits mailing list