Author: tom.baeyens(a)jboss.com
Date: 2009-02-11 16:02:22 -0500 (Wed, 11 Feb 2009)
New Revision: 3841
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HistorySessionBinding.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java
jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.cfg.xml
jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.common.xml
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/hibernate/HibernatePvmDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.bindings.xml
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/process/ProcessServiceTest.java
jbpm4/trunk/modules/test-db/src/main/resources/jbpm.cfg.xml
Log:
first history test
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java 2009-02-11 20:37:56
UTC (rev 3840)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java 2009-02-11 21:02:22
UTC (rev 3841)
@@ -51,11 +51,11 @@
ProcessDefinitionQuery createProcessDefinitionQuery();
/** deletes process definition if there are no existing executions.
- * @throws JbpmException if there are existing executions. */
+ * @throws JbpmException if there are existing executions or history. */
void deleteProcessDefinition(String processDefinitionId);
- /** deletes process definition and the existing executions. */
- void deleteProcessDefinitionAndInstances(String processDefinitionId);
+ /** deletes process definition, the existing executions and the history. */
+ void deleteProcessDefinitionCascade(String processDefinitionId);
/** retrieves an attachment of a process definition */
byte[] getAttachment(String processDefinitionId, String name);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java 2009-02-11
20:37:56 UTC (rev 3840)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -59,7 +59,7 @@
String findProcessDefinitionNameByKey(String processDefinitionKey);
/** delete process definition */
- void deleteProcessDefinition(String processDefinitionId, boolean
deleteProcessInstances);
+ void deleteProcessDefinition(String processDefinitionId, boolean
deleteProcessInstances, boolean deleteHistory);
// process execution queries ////////////////////////////////////////////////
Modified:
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java
===================================================================
---
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java 2009-02-11
20:37:56 UTC (rev 3840)
+++
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -77,7 +77,7 @@
public List<ProcessDefinitionRef> removeProcessDefinition(long procDefId)
{
ProcessService processService = this.processEngine.getProcessService();
- processService.deleteProcessDefinitionAndInstances(String.valueOf(procDefId));
+ processService.deleteProcessDefinitionCascade(String.valueOf(procDefId));
return getProcessDefinitions();
}
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.cfg.xml 2009-02-11 20:37:56 UTC
(rev 3840)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.cfg.xml 2009-02-11 21:02:22 UTC
(rev 3841)
@@ -13,6 +13,7 @@
<mapping resource="jbpm.pvm.execution.hbm.xml" />
<mapping resource="jbpm.pvm.variable.hbm.xml" />
<mapping resource="jbpm.pvm.job.hbm.xml" />
+ <mapping resource="jbpm.pvm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
<mapping resource="jbpm.jpdl.hbm.xml" />
</session-factory>
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.common.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.common.xml 2009-02-11 20:37:56
UTC (rev 3840)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.common.xml 2009-02-11 21:02:22
UTC (rev 3841)
@@ -37,5 +37,6 @@
<mapping resource="jbpm.pvm.execution.hbm.xml" />
<mapping resource="jbpm.pvm.variable.hbm.xml" />
<mapping resource="jbpm.pvm.job.hbm.xml" />
+ <mapping resource="jbpm.pvm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
<mapping resource="jbpm.jpdl.hbm.xml" />
Modified:
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 2009-02-11
20:37:56 UTC (rev 3840)
+++
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -37,14 +37,16 @@
String processDefinitionId;
boolean deleteProcessInstances;
+ boolean deleteHistory;
public DeleteProcessDefinitionCmd(String processDefinitionId) {
- this(processDefinitionId, false);
+ this(processDefinitionId, false, false);
}
- public DeleteProcessDefinitionCmd(String processDefinitionId, boolean
deleteProcessInstances) {
+ public DeleteProcessDefinitionCmd(String processDefinitionId, boolean
deleteProcessInstances, boolean deleteHistory) {
this.processDefinitionId = processDefinitionId;
this.deleteProcessInstances = deleteProcessInstances;
+ this.deleteHistory = deleteHistory;
}
public Void execute(Environment environment) {
@@ -52,7 +54,7 @@
if (pvmDbSession==null) {
throw new JbpmException("no "+PvmDbSessionBinding.TAG+"
configured");
}
- pvmDbSession.deleteProcessDefinition(processDefinitionId, deleteProcessInstances);
+ pvmDbSession.deleteProcessDefinition(processDefinitionId, deleteProcessInstances,
deleteHistory);
return null;
}
}
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-02-11
20:37:56 UTC (rev 3840)
+++
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -33,6 +33,8 @@
import org.jbpm.job.Message;
import org.jbpm.job.Timer;
import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.history.HistorySession;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstance;
import org.jbpm.session.PvmDbSession;
/**
@@ -93,7 +95,7 @@
return (String) query.uniqueResult();
}
- public void deleteProcessDefinition(String processDefinitionId, boolean
deleteProcessInstances) {
+ public void deleteProcessDefinition(String processDefinitionId, boolean
deleteProcessInstances, boolean deleteHistory) {
List<String> processInstanceIds = findProcessInstanceIds(processDefinitionId);
if (deleteProcessInstances) {
@@ -106,6 +108,17 @@
}
}
+ List<String> historyProcessInstanceIds =
findHistoryProcessInstanceIds(processDefinitionId);
+ if (deleteHistory) {
+ for (String historyProcessInstanceId: historyProcessInstanceIds) {
+ deleteHistoryProcessInstance(historyProcessInstanceId);
+ }
+ } else {
+ if (historyProcessInstanceIds.size()>0) {
+ throw new JbpmException("still
"+historyProcessInstanceIds.size()+" history process instances for process
definition "+processDefinitionId);
+ }
+ }
+
ProcessDefinition processDefinition =
findProcessDefinitionById(processDefinitionId);
session.delete(processDefinition);
}
@@ -190,4 +203,15 @@
log.debug("deleting process instance "+processInstanceId);
session.delete(processInstance);
}
+
+ public List<String> findHistoryProcessInstanceIds(String processDefinitionId) {
+ Query query = session.getNamedQuery("findHistoryProcessInstanceIds");
+ query.setString("processDefinitionId", processDefinitionId);
+ return query.list();
+ }
+
+ public void deleteHistoryProcessInstance(String historyProcessInstanceId) {
+ HistoryProcessInstance historyProcessInstance = (HistoryProcessInstance)
session.load(HistoryProcessInstance.class, historyProcessInstanceId);
+ session.delete(historyProcessInstance);
+ }
}
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java
(rev 0)
+++
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -0,0 +1,33 @@
+/*
+ * 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.history;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistorySessionImpl implements HistorySession {
+
+ public void process(HistoryEvent historyEvent) {
+ historyEvent.process();
+ }
+}
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java 2009-02-11
20:37:56 UTC (rev 3840)
+++
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -35,9 +35,11 @@
private static final long serialVersionUID = 1L;
public void process() {
- long dbid = execution.getDbid();
- Session session = Environment.getFromCurrent(Session.class);
- HistoryProcessInstance historyProcessInstance = (HistoryProcessInstance)
session.load(HistoryProcessInstance.class, dbid);
- historyProcessInstance.setEndTime(Clock.getCurrentTime());
+ String executionId = execution.getId();
+ if (executionId!=null) {
+ Session session = Environment.getFromCurrent(Session.class);
+ HistoryProcessInstance historyProcessInstance = (HistoryProcessInstance)
session.load(HistoryProcessInstance.class, executionId);
+ historyProcessInstance.setEndTime(Clock.getCurrentTime());
+ }
}
}
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java 2009-02-11
20:37:56 UTC (rev 3840)
+++
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -37,9 +37,11 @@
private static final long serialVersionUID = 1L;
public void process() {
- HistoryProcessInstance historyProcessInstance = new
HistoryProcessInstance(execution);
+ if (execution.getId()!=null) {
+ HistoryProcessInstance historyProcessInstance = new
HistoryProcessInstance(execution);
- Session session = Environment.getFromCurrent(Session.class);
- session.save(historyProcessInstance);
+ Session session = Environment.getFromCurrent(Session.class);
+ session.save(historyProcessInstance);
+ }
}
}
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-02-11
20:37:56 UTC (rev 3840)
+++
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -53,6 +53,7 @@
import org.jbpm.model.Transition;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.HistorySession;
+import org.jbpm.pvm.internal.history.events.ProcessInstanceEnd;
import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
@@ -193,7 +194,6 @@
this.state = STATE_ACTIVE;
ExecutionImpl scopedExecution = initializeScopes();
-
fireHistoryEvent(new ProcessInstanceStart());
fire(Event.START, processDefinition);
if (activity!=null) {
@@ -319,6 +319,7 @@
parent.removeExecution(this);
} else { // this is a process instance
+ fireHistoryEvent(new ProcessInstanceEnd());
fire(Event.END, processDefinition);
if (superProcessExecution!=null) {
log.trace(toString()+" signals super process execution");
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java 2009-02-11
20:37:56 UTC (rev 3840)
+++
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -71,8 +71,8 @@
commandService.execute(new DeleteProcessDefinitionCmd(processDefinitionId));
}
- public void deleteProcessDefinitionAndInstances(String processDefinitionId) {
- commandService.execute(new DeleteProcessDefinitionCmd(processDefinitionId, true));
+ public void deleteProcessDefinitionCascade(String processDefinitionId) {
+ commandService.execute(new DeleteProcessDefinitionCmd(processDefinitionId, true,
true));
}
public byte[] getAttachment(String processDefinitionId, String name) {
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HistorySessionBinding.java
===================================================================
---
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HistorySessionBinding.java
(rev 0)
+++
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HistorySessionBinding.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -0,0 +1,44 @@
+/*
+ * 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.wire.binding;
+
+import org.jbpm.pvm.internal.history.HistorySessionImpl;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistorySessionBinding extends WireDescriptorBinding {
+
+ public HistorySessionBinding() {
+ super("history-session");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ return new ObjectDescriptor(HistorySessionImpl.class);
+ }
+
+}
Added: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml
(rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml 2009-02-11
21:02:22 UTC (rev 3841)
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.jbpm.pvm.internal.history.model"
default-access="field">
+
+ <!-- ### HISTORY PROCESS INSTANCE ####################################### -->
+ <class name="HistoryProcessInstance"
table="JBPM_HIST_PROC_INST">
+ <id name="id" column="ID_">
+ <generator class="assigned" />
+ </id>
+ <version name="dbversion" column="DBVERSION_" />
+
+ <property name="key" column="KEY_" />
+ <property name="startTime" column="START_"
type="timestamp" />
+ <property name="endTime" column="END_"
type="timestamp" />
+ <property name="duration" column="DURATION_" />
+
+ <many-to-one name="processDefinition"
+ class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
+ column="PROCDEF_"
+ foreign-key="FK_HPI_PROCDEF"
+ index="IDX_HPI_PROCDEF" />
+ </class>
+
+ <query name="findHistoryProcessInstanceIds">
+ <![CDATA[
+ select historyExecution.id
+ from org.jbpm.pvm.internal.history.model.HistoryProcessInstance historyExecution
+ where historyExecution.processDefinition.id = :processDefinitionId
+ ]]>
+ </query>
+
+
+</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.bindings.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.bindings.xml 2009-02-11
20:37:56 UTC (rev 3840)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.bindings.xml 2009-02-11
21:02:22 UTC (rev 3841)
@@ -46,6 +46,7 @@
<!-- sessions -->
<binding class="org.jbpm.pvm.internal.wire.binding.MessageSessionBinding"
/>
<binding class="org.jbpm.pvm.internal.wire.binding.TimerSessionBinding"
/>
+ <binding class="org.jbpm.pvm.internal.wire.binding.HistorySessionBinding"
/>
<binding class="org.jbpm.pvm.internal.wire.binding.IdentitySessionBinding"
/>
<binding
class="org.jbpm.pvm.internal.wire.binding.IdentitySessionFactoryBinding" />
<!-- db sessions -->
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java 2009-02-11
20:37:56 UTC (rev 3840)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -87,7 +87,7 @@
protected void tearDown() throws Exception {
if (registeredProcessDefinitions!=null) {
for (ProcessDefinition processDefinition : registeredProcessDefinitions) {
- processService.deleteProcessDefinitionAndInstances(processDefinition.getId());
+ processService.deleteProcessDefinitionCascade(processDefinition.getId());
}
}
Added:
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
===================================================================
---
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
(rev 0)
+++
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -0,0 +1,49 @@
+/*
+ * 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.test.history;
+
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessInstanceHistoryTest extends DbTestCase {
+
+ public void testSignalExecutionByKey() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <flow to='end' />" +
+ " </start>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ executionService.startExecutionByKey("ICL");
+ executionService.startExecutionByKey("ICL");
+ executionService.startExecutionByKey("ICL");
+
+
+ }
+
+}
Modified:
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/process/ProcessServiceTest.java
===================================================================
---
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/process/ProcessServiceTest.java 2009-02-11
20:37:56 UTC (rev 3840)
+++
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/process/ProcessServiceTest.java 2009-02-11
21:02:22 UTC (rev 3841)
@@ -170,7 +170,7 @@
executionService.startExecutionByKey("deleteme");
// delete it all
- processService.deleteProcessDefinitionAndInstances("deleteme:33");
+ processService.deleteProcessDefinitionCascade("deleteme:33");
// check if the db is empty
assertEquals(0, processService.createProcessDefinitionQuery().execute().size());
Modified: jbpm4/trunk/modules/test-db/src/main/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/main/resources/jbpm.cfg.xml 2009-02-11 20:37:56 UTC
(rev 3840)
+++ jbpm4/trunk/modules/test-db/src/main/resources/jbpm.cfg.xml 2009-02-11 21:02:22 UTC
(rev 3841)
@@ -64,6 +64,7 @@
<task-db-session />
<message-session />
<timer-session />
+ <history-session />
</environment>
</jbpm-configuration>