[jbpm-commits] JBoss JBPM SVN: r5092 - in jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal: hibernate and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Jun 23 07:52:47 EDT 2009


Author: jbarrez
Date: 2009-06-23 07:52:47 -0400 (Tue, 23 Jun 2009)
New Revision: 5092

Removed:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionsCmd.java
Modified:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
Log:
Cleanup up usage of findExecutionByKey, since it does not makes sense (only the root execution has a key). Operation was already removed from executionService, but not yet from dbSession and commands.

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java	2009-06-23 10:24:40 UTC (rev 5091)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java	2009-06-23 11:52:47 UTC (rev 5092)
@@ -35,19 +35,6 @@
   private static final long serialVersionUID = 1L;
   
   protected String executionId;
-  protected String processDefinitionName;
-  protected String executionKey;
-  
-  public FindExecutionCmd(String processDefinitionName, String executionKey) {
-    if (processDefinitionName==null) {
-      throw new JbpmException("processDefinitionName is null");
-    }
-    this.processDefinitionName = processDefinitionName;
-    if (executionKey==null) {
-      throw new JbpmException("executionKey is null");
-    }
-    this.executionKey = executionKey;
-  }
 
   public FindExecutionCmd(String executionId) {
     if (executionId==null) {
@@ -58,10 +45,7 @@
 
   public Execution execute(Environment environment) throws Exception {
     DbSession dbSession = environment.get(DbSession.class);
-    if (executionId!=null) {
-      return dbSession.findExecutionById(executionId);
-    } 
-    Execution execution = dbSession.findExecutionByKey(processDefinitionName, executionKey);
-    return execution;
+    return dbSession.findExecutionById(executionId);
   }
+  
 }

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionsCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionsCmd.java	2009-06-23 10:24:40 UTC (rev 5091)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionsCmd.java	2009-06-23 11:52:47 UTC (rev 5092)
@@ -1,73 +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.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.jbpm.api.Execution;
-import org.jbpm.api.JbpmException;
-import org.jbpm.api.client.ClientExecution;
-import org.jbpm.api.env.Environment;
-import org.jbpm.pvm.internal.session.DbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindExecutionsCmd extends AbstractCommand<List<Execution>> {
-
-  private static final long serialVersionUID = 1L;
-  
-  protected String executionId;
-
-  public FindExecutionsCmd(String executionId) {
-    if (executionId==null) {
-      throw new JbpmException("executionId is null");
-    }
-    this.executionId = executionId;
-  }
-
-
-  public List<Execution> execute(Environment environment) throws Exception {
-    List<Execution> executions = new ArrayList<Execution>();
-    
-    DbSession dbSession = environment.get(DbSession.class);
-    ClientExecution execution = dbSession.findExecutionById(executionId);
-    scanExecutions(execution, executions);
-    
-    return executions;
-  }
-
-  public void scanExecutions(Execution execution, List<Execution> executions) {
-
-    executions.add(execution);
-    
-    Collection<? extends Execution> childExecutions = execution.getExecutions();
-    if (childExecutions!=null) {
-      for (Execution childExecution: childExecutions) {
-        scanExecutions(childExecution, executions);
-      }
-    }
-  }
-}

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java	2009-06-23 10:24:40 UTC (rev 5091)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java	2009-06-23 11:52:47 UTC (rev 5092)
@@ -207,15 +207,6 @@
     query.setMaxResults(1);
     return (ClientExecution) query.uniqueResult();
   }
-
-  public ClientExecution findExecutionByKey(String processDefinitionName, String executionKey) {
-    // query definition can be found at the bottom of resource jbpm.pvm.execution.hbm.xml
-    Query query = session.getNamedQuery("findExecutionByKey");
-    query.setString("processDefinitionName", processDefinitionName);
-    query.setString("executionKey", executionKey);
-    query.setMaxResults(1);
-    return (ClientExecution) query.uniqueResult();
-  }
   
   public List<String> findProcessInstanceIds(String processDefinitionId) {
     // query definition can be found at the bottom of resource jbpm.pvm.job.hbm.xml

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java	2009-06-23 10:24:40 UTC (rev 5091)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java	2009-06-23 11:52:47 UTC (rev 5092)
@@ -33,7 +33,6 @@
 import org.jbpm.pvm.internal.query.HistoryActivityInstanceQueryImpl;
 import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
 import org.jbpm.pvm.internal.query.JobQueryImpl;
-import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
 import org.jbpm.pvm.internal.query.ProcessInstanceQueryImpl;
 import org.jbpm.pvm.internal.task.TaskQueryImpl;
 
@@ -90,10 +89,6 @@
 
   /** the process instance uniquely identified by the given executionKey. */ 
   ClientExecution findProcessInstanceById(String processInstanceId);
-
-  /** the execution uniquely identified by the given processDefinition name 
-   * and the execution key. */
-  ClientExecution findExecutionByKey(String processDefinitionName, String executionKey);
   
   /* find ids for all process instances for a given process definition. */
   List<String> findProcessInstanceIds(String processDefinitionId);




More information about the jbpm-commits mailing list