[jbpm-commits] JBoss JBPM SVN: r6403 - 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
Thu Jun 10 15:17:24 EDT 2010
Author: alex.guizar at jboss.com
Date: 2010-06-10 15:17:23 -0400 (Thu, 10 Jun 2010)
New Revision: 6403
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionKeysCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionsByKeyCmd.java
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/session/DbSession.java
Log:
JBPM-2584: remove obsolete, database-related, process definition commands
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java 2010-06-10 18:43:18 UTC (rev 6402)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java 2010-06-10 19:17:23 UTC (rev 6403)
@@ -1,59 +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 org.jbpm.api.JbpmException;
-import org.jbpm.api.cmd.Environment;
-import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.wire.binding.DbSessionBinding;
-
-
-/**
- * @author Tom Baeyens
- */
-public class DeleteProcessDefinitionCmd extends AbstractCommand<Void> {
-
- private static final long serialVersionUID = 1L;
-
- String processDefinitionId;
- boolean deleteProcessInstances;
- boolean deleteHistory;
-
- public DeleteProcessDefinitionCmd(String processDefinitionId) {
- this(processDefinitionId, false, false);
- }
-
- public DeleteProcessDefinitionCmd(String processDefinitionId, boolean deleteProcessInstances, boolean deleteHistory) {
- this.processDefinitionId = processDefinitionId;
- this.deleteProcessInstances = deleteProcessInstances;
- this.deleteHistory = deleteHistory;
- }
-
- public Void execute(Environment environment) {
- DbSession dbSession = environment.get(DbSession.class);
- if (dbSession==null) {
- throw new JbpmException("no "+DbSessionBinding.TAG+" configured");
- }
- dbSession.deleteProcessDefinition(processDefinitionId, deleteProcessInstances, deleteHistory);
- return null;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java 2010-06-10 18:43:18 UTC (rev 6402)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java 2010-06-10 19:17:23 UTC (rev 6403)
@@ -1,48 +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 org.jbpm.api.ProcessDefinition;
-import org.jbpm.api.cmd.Environment;
-import org.jbpm.pvm.internal.model.OpenProcessDefinition;
-import org.jbpm.pvm.internal.session.DbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindLatestProcessDefinitionByKeyCmd extends AbstractCommand<ProcessDefinition> {
-
- private static final long serialVersionUID = 1L;
-
- protected String processDefinitionKey;
-
- public FindLatestProcessDefinitionByKeyCmd(String processDefinitionKey) {
- this.processDefinitionKey = processDefinitionKey;
- }
-
- public OpenProcessDefinition execute(Environment environment) throws Exception {
- return environment
- .get(DbSession.class)
- .findLatestProcessDefinitionByKey(processDefinitionKey);
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java 2010-06-10 18:43:18 UTC (rev 6402)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java 2010-06-10 19:17:23 UTC (rev 6403)
@@ -1,47 +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 org.jbpm.api.cmd.Environment;
-import org.jbpm.pvm.internal.model.OpenProcessDefinition;
-import org.jbpm.pvm.internal.session.DbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindProcessDefinitionByIdCmd extends AbstractCommand<OpenProcessDefinition> {
-
- private static final long serialVersionUID = 1L;
-
- protected String processDefinitionId;
-
- public FindProcessDefinitionByIdCmd(String processDefinitionId) {
- this.processDefinitionId = processDefinitionId;
- }
-
- public OpenProcessDefinition execute(Environment environment) throws Exception {
- return environment
- .get(DbSession.class)
- .findProcessDefinitionById(processDefinitionId);
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionKeysCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionKeysCmd.java 2010-06-10 18:43:18 UTC (rev 6402)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionKeysCmd.java 2010-06-10 19:17:23 UTC (rev 6403)
@@ -1,43 +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.List;
-
-import org.jbpm.api.cmd.Environment;
-import org.jbpm.pvm.internal.session.DbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindProcessDefinitionKeysCmd extends AbstractCommand<List<String>> {
-
- private static final long serialVersionUID = 1L;
-
- public List<String> execute(Environment environment) throws Exception {
- return environment
- .get(DbSession.class)
- .findProcessDefinitionKeys();
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionsByKeyCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionsByKeyCmd.java 2010-06-10 18:43:18 UTC (rev 6402)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionsByKeyCmd.java 2010-06-10 19:17:23 UTC (rev 6403)
@@ -1,49 +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.List;
-
-import org.jbpm.api.cmd.Environment;
-import org.jbpm.pvm.internal.client.ClientProcessDefinition;
-import org.jbpm.pvm.internal.session.DbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindProcessDefinitionsByKeyCmd extends AbstractCommand<List<ClientProcessDefinition>> {
-
- private static final long serialVersionUID = 1L;
-
- protected String processDefinitionKey;
-
- public FindProcessDefinitionsByKeyCmd(String processDefinitionKey) {
- this.processDefinitionKey = processDefinitionKey;
- }
-
- public List<ClientProcessDefinition> execute(Environment environment) throws Exception {
- return environment
- .get(DbSession.class)
- .findProcessDefinitionsByKey(processDefinitionKey);
- }
-}
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 2010-06-10 18:43:18 UTC (rev 6402)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java 2010-06-10 19:17:23 UTC (rev 6403)
@@ -29,15 +29,14 @@
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.metadata.ClassMetadata;
+
import org.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.history.HistoryComment;
import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.task.Task;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
@@ -109,62 +108,6 @@
this.session = session;
}
- public List<String> findProcessDefinitionKeys() {
- return session.getNamedQuery("findProcessDefinitionKeys").list();
- }
-
- public ClientProcessDefinition findLatestProcessDefinitionByKey(String processDefinitionKey) {
- Query query = session.getNamedQuery("findProcessDefinitionsByKey");
- query.setString("key", processDefinitionKey);
- query.setMaxResults(1);
- ClientProcessDefinition processDefinition = (ClientProcessDefinition) query.uniqueResult();
- return processDefinition;
- }
-
- public List<ClientProcessDefinition> findProcessDefinitionsByKey(String processDefinitionKey) {
- Query query = session.getNamedQuery("findProcessDefinitionsByKey");
- query.setString("key", processDefinitionKey);
- return query.list();
- }
-
- public ClientProcessDefinition findProcessDefinitionById(String processDefinitionId) {
- Query query = session.getNamedQuery("findProcessDefinitionById");
- query.setString("id", processDefinitionId);
- query.setMaxResults(1);
- ClientProcessDefinition processDefinition = (ClientProcessDefinition) query.uniqueResult();
- return processDefinition;
- }
-
- public void deleteProcessDefinition(String processDefinitionId, boolean deleteProcessInstances, boolean deleteHistory) {
- List<String> processInstanceIds = findProcessInstanceIds(processDefinitionId);
-
- if ( deleteHistory
- // and if hibernate knows about the history class
- && (isHistoryEnabled())
- ) {
- List<HistoryProcessInstance> historyProcessInstances = createHistoryProcessInstanceQuery()
- .processDefinitionId(processDefinitionId)
- .list();
-
- for (HistoryProcessInstance historyProcessInstance : historyProcessInstances) {
- session.delete(historyProcessInstance);
- }
- }
-
- if (deleteProcessInstances) {
- for (String processInstanceId : processInstanceIds) {
- deleteProcessInstance(processInstanceId, deleteHistory);
- }
- } else {
- if (processInstanceIds.size()>0) {
- throw new JbpmException("still "+processInstanceIds.size()+" process instances for process definition "+processDefinitionId);
- }
- }
-
- ProcessDefinition processDefinition = findProcessDefinitionById(processDefinitionId);
- session.delete(processDefinition);
- }
-
public void deleteProcessDefinitionHistory(String processDefinitionId) {
List<HistoryProcessInstanceImpl> historyProcessInstances =
session.createQuery(
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 2010-06-10 18:43:18 UTC (rev 6402)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java 2010-06-10 19:17:23 UTC (rev 6403)
@@ -26,11 +26,9 @@
import org.jbpm.api.Execution;
import org.jbpm.api.history.HistoryComment;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.job.StartProcessTimer;
import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.query.DeploymentQueryImpl;
import org.jbpm.pvm.internal.query.HistoryActivityInstanceQueryImpl;
import org.jbpm.pvm.internal.query.HistoryDetailQueryImpl;
@@ -39,11 +37,7 @@
import org.jbpm.pvm.internal.query.ProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.query.TaskQueryImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
-import org.jbpm.pvm.internal.tx.JtaTransaction;
-import org.jbpm.pvm.internal.tx.StandardTransaction;
-import org.jbpm.pvm.internal.type.Variable;
-
/**
* @author Tom Baeyens
*/
@@ -56,22 +50,6 @@
void delete(Object entity);
void flush();
- /** all deployed process names. */
- List<String> findProcessDefinitionKeys();
-
- /** latest version of the processDefinition for the given key. */
- ClientProcessDefinition findLatestProcessDefinitionByKey(String processDefinitionKey);
-
- /** all versions of the processDefinition for the given key. */
- List<ClientProcessDefinition> findProcessDefinitionsByKey(String processDefinitionKey);
-
- /** the process definition uniquely identified by the given
- * processDefinition id. */
- ClientProcessDefinition findProcessDefinitionById(String processDefinitionId);
-
- /** delete process definition */
- void deleteProcessDefinition(String processDefinitionId, boolean deleteProcessInstances, boolean deleteHistory);
-
// process execution queries ////////////////////////////////////////////////
/** create a process instance query */
More information about the jbpm-commits
mailing list