JBoss JBPM SVN: r3980 - jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/src/main/resources/database/hypersonic.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-02-20 08:16:03 -0500 (Fri, 20 Feb 2009)
New Revision: 3980
Modified:
jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/src/main/resources/database/hypersonic/jbpmDB.script
Log:
[JBPM-2057] Adjust installed hsqldb script
Modified: jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/src/main/resources/database/hypersonic/jbpmDB.script
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/src/main/resources/database/hypersonic/jbpmDB.script 2009-02-20 13:05:19 UTC (rev 3979)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/distribution/src/main/resources/database/hypersonic/jbpmDB.script 2009-02-20 13:16:03 UTC (rev 3980)
@@ -21,7 +21,7 @@
CREATE INDEX IDX_JOB_TSKINST ON JBPM_JOB(TASKINSTANCE_)
CREATE INDEX IDX_JOB_TOKEN ON JBPM_JOB(TOKEN_)
CREATE INDEX IDX_JOB_PRINST ON JBPM_JOB(PROCESSINSTANCE_)
-CREATE MEMORY TABLE JBPM_LOG(ID_ BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,CLASS_ CHAR(1) NOT NULL,INDEX_ INTEGER,DATE_ TIMESTAMP,TOKEN_ BIGINT,PARENT_ BIGINT,MESSAGE_ VARCHAR(4000),EXCEPTION_ VARCHAR(4000),ACTION_ BIGINT,NODE_ BIGINT,ENTER_ TIMESTAMP,LEAVE_ TIMESTAMP,DURATION_ BIGINT,NEWLONGVALUE_ BIGINT,TRANSITION_ BIGINT,CHILD_ BIGINT,SOURCENODE_ BIGINT,DESTINATIONNODE_ BIGINT,VARIABLEINSTANCE_ BIGINT,OLDBYTEARRAY_ BIGINT,NEWBYTEARRAY_ BIGINT,OLDDATEVALUE_ TIMESTAMP,NEWDATEVALUE_ TIMESTAMP,OLDDOUBLEVALUE_ DOUBLE,NEWDOUBLEVALUE_ DOUBLE,OLDLONGIDCLASS_ VARCHAR(255),OLDLONGIDVALUE_ BIGINT,NEWLONGIDCLASS_ VARCHAR(255),NEWLONGIDVALUE_ BIGINT,OLDSTRINGIDCLASS_ VARCHAR(255),OLDSTRINGIDVALUE_ VARCHAR(255),NEWSTRINGIDCLASS_ VARCHAR(255),NEWSTRINGIDVALUE_ VARCHAR(255),OLDLONGVALUE_ BIGINT,OLDSTRINGVALUE_ VARCHAR(4000),NEWSTRINGVALUE_ VARCHAR(4000),TASKINSTANCE_ BIGINT,TASKACTORID_ VARCHAR(255),TASKOLDACTORID_ VARCHAR(255),SWIMLANEINSTANCE_ BIGINT,C!
ONSTRAINT FK_LOG_OLDBYTES FOREIGN KEY(OLDBYTEARRAY_) REFERENCES JBPM_BYTEARRAY(ID_),CONSTRAINT FK_LOG_NEWBYTES FOREIGN KEY(NEWBYTEARRAY_) REFERENCES JBPM_BYTEARRAY(ID_),CONSTRAINT FK_LOG_ACTION FOREIGN KEY(ACTION_) REFERENCES JBPM_ACTION(ID_),CONSTRAINT FK_LOG_PARENT FOREIGN KEY(PARENT_) REFERENCES JBPM_LOG(ID_))
+CREATE MEMORY TABLE JBPM_LOG(ID_ BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,CLASS_ CHAR(1) NOT NULL,INDEX_ INTEGER,DATE_ TIMESTAMP,TOKEN_ BIGINT,PARENT_ BIGINT,MESSAGE_ VARCHAR(4000),EXCEPTION_ VARCHAR(4000),EXCEPTION_EXT_ LONGVARCHAR,ACTION_ BIGINT,NODE_ BIGINT,ENTER_ TIMESTAMP,LEAVE_ TIMESTAMP,DURATION_ BIGINT,NEWLONGVALUE_ BIGINT,TRANSITION_ BIGINT,CHILD_ BIGINT,SOURCENODE_ BIGINT,DESTINATIONNODE_ BIGINT,VARIABLEINSTANCE_ BIGINT,OLDBYTEARRAY_ BIGINT,NEWBYTEARRAY_ BIGINT,OLDDATEVALUE_ TIMESTAMP,NEWDATEVALUE_ TIMESTAMP,OLDDOUBLEVALUE_ DOUBLE,NEWDOUBLEVALUE_ DOUBLE,OLDLONGIDCLASS_ VARCHAR(255),OLDLONGIDVALUE_ BIGINT,NEWLONGIDCLASS_ VARCHAR(255),NEWLONGIDVALUE_ BIGINT,OLDSTRINGIDCLASS_ VARCHAR(255),OLDSTRINGIDVALUE_ VARCHAR(255),NEWSTRINGIDCLASS_ VARCHAR(255),NEWSTRINGIDVALUE_ VARCHAR(255),OLDLONGVALUE_ BIGINT,OLDSTRINGVALUE_ VARCHAR(4000),NEWSTRINGVALUE_ VARCHAR(4000),TASKINSTANCE_ BIGINT,TASKACTORID_ VARCHAR(255),TASKOLDACTORID_ VARCHAR(255)!
,SWIMLANEINSTANCE_ BIGINT,CONSTRAINT FK_LOG_OLDBYTES FOREIGN KEY(OLDBYTEARRAY_) REFERENCES JBPM_BYTEARRAY(ID_),CONSTRAINT FK_LOG_NEWBYTES FOREIGN KEY(NEWBYTEARRAY_) REFERENCES JBPM_BYTEARRAY(ID_),CONSTRAINT FK_LOG_ACTION FOREIGN KEY(ACTION_) REFERENCES JBPM_ACTION(ID_),CONSTRAINT FK_LOG_PARENT FOREIGN KEY(PARENT_) REFERENCES JBPM_LOG(ID_))
CREATE MEMORY TABLE JBPM_MODULEDEFINITION(ID_ BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,CLASS_ CHAR(1) NOT NULL,NAME_ VARCHAR(4000),PROCESSDEFINITION_ BIGINT,STARTTASK_ BIGINT)
CREATE INDEX IDX_MODDEF_PROCDF ON JBPM_MODULEDEFINITION(PROCESSDEFINITION_)
CREATE MEMORY TABLE JBPM_MODULEINSTANCE(ID_ BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,CLASS_ CHAR(1) NOT NULL,VERSION_ INTEGER NOT NULL,PROCESSINSTANCE_ BIGINT,TASKMGMTDEFINITION_ BIGINT,NAME_ VARCHAR(255),CONSTRAINT FK_TASKMGTINST_TMD FOREIGN KEY(TASKMGMTDEFINITION_) REFERENCES JBPM_MODULEDEFINITION(ID_))
17 years, 2 months
JBoss JBPM SVN: r3979 - in jbpm4/trunk/modules/jpdl: scripts and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-20 08:05:19 -0500 (Fri, 20 Feb 2009)
New Revision: 3979
Added:
jbpm4/trunk/modules/jpdl/scripts/antrun-patch-hsql-properties.xml
Removed:
jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml
Modified:
jbpm4/trunk/modules/jpdl/pom.xml
jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.properties.hsqldb.xml
Log:
Create portable hsqdl DB file url
Modified: jbpm4/trunk/modules/jpdl/pom.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/pom.xml 2009-02-20 11:57:46 UTC (rev 3978)
+++ jbpm4/trunk/modules/jpdl/pom.xml 2009-02-20 13:05:19 UTC (rev 3979)
@@ -82,20 +82,21 @@
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
- <execution>
+ <!--execution>
<id>ant-copy-resources</id>
- <phase>process-resources</phase>
+ <phase>process-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
- <property name="build.dir" value="${project.build.directory}" />
- <property name="user.home" value="${user.home}" />
- <ant antfile="scripts/antrun-copy-resources.xml" target="copy" />
+ <property name="build.path.system" value="${project.build.directory}" />
+ <property name="from.dir" value="src/main/resources" />
+ <property name="to.dir" value="target/classes"/>
+ <ant antfile="scripts/antrun-patch-hsql-properties.xml" target="patch" />
</tasks>
</configuration>
- </execution>
+ </execution-->
<execution>
<phase>compile</phase>
<goals>
@@ -103,10 +104,18 @@
</goals>
<configuration>
<tasks>
+
+ <!-- Patch the Hsql DB Url to make it portable -->
+ <property name="build.path.system" value="${project.build.directory}" />
+ <property name="from.dir" value="${basedir}/src/main/resources" />
+ <property name="to.dir" value="${project.build.directory}/classes"/>
+ <ant antfile="scripts/antrun-patch-hsql-properties.xml" target="patch" />
+
<echo>============================</echo>
<echo>Database config: ${database}</echo>
<echo>============================</echo>
<property name="database" value="${database}" />
+ <property name="build.path.system" value="${project.build.directory}" />
<ant antfile="scripts/antrun-jbpm-config.xml" target="concat" />
</tasks>
</configuration>
Deleted: jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml 2009-02-20 11:57:46 UTC (rev 3978)
+++ jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml 2009-02-20 13:05:19 UTC (rev 3979)
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ====================================================================== -->
-<!-- -->
-<!-- JBoss, the OpenSource J2EE webOS -->
-<!-- -->
-<!-- Distributable under LGPL license. -->
-<!-- See terms of license at http://www.gnu.org. -->
-<!-- -->
-<!-- ====================================================================== -->
-
-<!-- $Id: antrun-jbpm-config.xml 3602 2009-01-08 04:27:48Z alex.guizar(a)jboss.com $ -->
-
-<project>
-
- <target name="copy">
-
- <!--makeurl file="${build.dir}" property="system.agnostic.path"/-->
-
- <path id="build.path">
- <pathelement location="${build.dir}"/>
- </path>
-
-
- <pathconvert targetos="unix" property="build.path.unix" refid="build.path">
- <!--map from="${build.dir}" to="${build.dir.unix}"/-->
- <map from="c:" to=""/>
- </pathconvert>
-
-
- <echo>***</echo>
- <echo>Build dir: ${build.path.unix} </echo>
- <echo>***</echo>
- </target>
-</project>
\ No newline at end of file
Copied: jbpm4/trunk/modules/jpdl/scripts/antrun-patch-hsql-properties.xml (from rev 3976, jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml)
===================================================================
--- jbpm4/trunk/modules/jpdl/scripts/antrun-patch-hsql-properties.xml (rev 0)
+++ jbpm4/trunk/modules/jpdl/scripts/antrun-patch-hsql-properties.xml 2009-02-20 13:05:19 UTC (rev 3979)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id: antrun-jbpm-config.xml 3602 2009-01-08 04:27:48Z alex.guizar(a)jboss.com $ -->
+
+<project>
+
+ <path id="build.path">
+ <pathelement location="${build.path.system}"/>
+ </path>
+
+ <target name="patch">
+
+ <pathconvert targetos="unix" property="build.path.unix" refid="build.path"/>
+ <echo>DEBUG: Build path: ${build.path.unix} </echo>
+
+ <mkdir dir="${to.dir}"/>
+
+ <copy todir="${to.dir}" filtering="true" verbose="true" overwrite="true">
+ <filterset>
+ <filter token="project.build.directory" value="${build.path.unix}"/>
+ </filterset>
+ <fileset dir="${from.dir}">
+ <include name="**/hibernate.properties.hsqldb.xml"/>
+ </fileset>
+ </copy>
+
+ </target>
+</project>
\ No newline at end of file
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.properties.hsqldb.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.properties.hsqldb.xml 2009-02-20 11:57:46 UTC (rev 3978)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.properties.hsqldb.xml 2009-02-20 13:05:19 UTC (rev 3979)
@@ -4,7 +4,7 @@
<!-- JDBC connection properties (begin) -->
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
- <property name="hibernate.connection.url">jdbc:hsqldb:file:${project.build.directory}/hypersonic/jbpm4DB</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:file:@project.build.directory@/hypersonic/jbpm4DB</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<!-- JDBC connection properties (end) -->
17 years, 2 months
JBoss JBPM SVN: r3978 - jbpm4/trunk/modules/distro/src/main/resources/installer.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-20 06:57:46 -0500 (Fri, 20 Feb 2009)
New Revision: 3978
Modified:
jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml
Log:
added docs, examples and sources to runtime directory installation
Modified: jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml 2009-02-20 11:32:52 UTC (rev 3977)
+++ jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml 2009-02-20 11:57:46 UTC (rev 3978)
@@ -114,24 +114,23 @@
<file src="@{deploy.artifacts.dir}/release.notes.html" targetdir="$INSTALL_PATH" override="true" />
<file src="@{deploy.artifacts.dir}/jboss.eula.txt" targetdir="$INSTALL_PATH" override="true" />
- <!--
- jbpm4/config
- -->
+ <!-- jbpm4/config -->
<file src="@{deploy.artifacts.dir}/lib/jbpm-jpdl-config.jar" targetdir="$INSTALL_PATH/config"
unpack="true" override="true" />
- <!--
- jbpm4/docs
- -->
- <!--file src="@{deploy.artifacts.dir}/lib/jbpm-userguide.jdocbook" targetdir="$INSTALL_PATH/docs/userguide" unpack="true" override="true" />
- <fileset dir="@{deploy.artifacts.dir}/javadoc" targetdir="$INSTALL_PATH/docs" override="true"/-->
+ <!-- jbpm4/doc -->
+ <fileset dir="@{deploy.artifacts.dir}/doc" targetdir="$INSTALL_PATH/doc" />
- <!--
- jbpm4/lib
- -->
+ <!-- jbpm4/examples -->
+ <fileset dir="@{deploy.artifacts.dir}/examples" targetdir="$INSTALL_PATH/examples" />
+
+ <!-- jbpm4/lib -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/lib" override="true">
<include name="*.jar" />
</fileset>
+
+ <!-- jbpm4/src -->
+ <fileset dir="@{deploy.artifacts.dir}/src" targetdir="$INSTALL_PATH/src" />
</pack>
<!--
17 years, 2 months
JBoss JBPM SVN: r3977 - jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-20 06:32:52 -0500 (Fri, 20 Feb 2009)
New Revision: 3977
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
Log:
removed obsolete javadocs
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-02-20 11:13:30 UTC (rev 3976)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-02-20 11:32:52 UTC (rev 3977)
@@ -195,10 +195,8 @@
*
* <p>The execution will be removed from it's parent. Potentially this can cause
* a parent execution to start executing in case this is the last concurrent
- * execution for which the parent is waiting.</p>
- *
- * <p>This method should not be called in {@link ActivityBehaviour}s. It can be called from
- * outside the process execution and in {@link ExternalActivityBehaviour}s. </p> */
+ * execution for which the parent is waiting.</p>
+ */
void end();
/** ends this execution and all it's child executions with a user defined
17 years, 2 months
JBoss JBPM SVN: r3976 - jbpm4/trunk/modules/jpdl/scripts.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-20 06:13:30 -0500 (Fri, 20 Feb 2009)
New Revision: 3976
Modified:
jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml
Log:
Share pathcpnvert tests with tom
Modified: jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml 2009-02-20 11:11:25 UTC (rev 3975)
+++ jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml 2009-02-20 11:13:30 UTC (rev 3976)
@@ -14,8 +14,22 @@
<project>
<target name="copy">
+
+ <!--makeurl file="${build.dir}" property="system.agnostic.path"/-->
+
+ <path id="build.path">
+ <pathelement location="${build.dir}"/>
+ </path>
+
+
+ <pathconvert targetos="unix" property="build.path.unix" refid="build.path">
+ <!--map from="${build.dir}" to="${build.dir.unix}"/-->
+ <map from="c:" to=""/>
+ </pathconvert>
+
+
<echo>***</echo>
- <echo>Build dir: ${build.dir} </echo>
+ <echo>Build dir: ${build.path.unix} </echo>
<echo>***</echo>
</target>
</project>
\ No newline at end of file
17 years, 2 months
JBoss JBPM SVN: r3975 - jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/jar/src/test/java/org/jbpm/perf.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-02-20 06:11:25 -0500 (Fri, 20 Feb 2009)
New Revision: 3975
Added:
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/jar/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
Removed:
jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/jar/src/test/java/org/jbpm/perf/AsyncCallTest.java
Log:
[JBPM-2043] Cleanup performance test
Deleted: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/jar/src/test/java/org/jbpm/perf/AsyncCallTest.java
===================================================================
--- jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/jar/src/test/java/org/jbpm/perf/AsyncCallTest.java 2009-02-20 10:59:23 UTC (rev 3974)
+++ jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/jar/src/test/java/org/jbpm/perf/AsyncCallTest.java 2009-02-20 11:11:25 UTC (rev 3975)
@@ -1,114 +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.perf;
-
-// $Id: AsyncCallTest.java 3930 2009-02-18 17:19:18Z thomas.diesler(a)jboss.com $
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jbpm.command.CommandService;
-import org.jbpm.command.StartProcessInstanceCommand;
-import org.jbpm.command.impl.CommandServiceImpl;
-import org.jbpm.db.AbstractDbTestCase;
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * This tests creates a constant number of process instances.
- * Every instance has an async call to an ActionHandler.
- *
- * See JIRA bugs SOA-1175 and JBPM-2043.
- *
- * @author mvecera(a)redhat.com
- * @author pmacik(a)redhat.com
- * @author thomas.diesler(a)jboss.com
- * @since 18-Feb-2009
- */
-public class AsyncCallTest extends AbstractDbTestCase
-{
- private static final Log log = LogFactory.getLog(AsyncCallTest.class);
-
- private CommandService commandService = new CommandServiceImpl(getJbpmConfiguration());
- private static final int INSTANCES = 1000;
- private static int count;
-
- ProcessDefinition processDefinition;
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition xmlns='urn:jbpm.org:jpdl-3.1' name='processDefinition1'>" +
- " <start-state name='start'>" +
- " <transition name='to_state' to='end'>" +
- " <action class='" + PerfActionHandler.class.getName() + "'/>" +
- " </transition>" +
- " </start-state>" +
- " <end-state name='end'/>" +
- "</process-definition>");
-
- saveAndReload(processDefinition);
- }
-
- public void tearDown() throws Exception
- {
- beginSessionTransaction();
- jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
- super.tearDown();
- }
-
- public void testAsyncCall()
- {
- long start = System.currentTimeMillis();
-
- commitAndCloseSession();
- startJobExecutor();
-
- for (count = 0; count < INSTANCES; count++)
- {
- beginSessionTransaction();
- StartProcessInstanceCommand startCommand = new StartProcessInstanceCommand();
- startCommand.setProcessId(processDefinition.getId());
- startCommand.setProcessName("processDefinition1");
- ProcessInstance pi = (ProcessInstance)commandService.execute(startCommand);
- commitAndCloseSession();
- }
-
- stopJobExecutor();
-
- long stop = System.currentTimeMillis();
- System.out.println("=== Test finished processing " + INSTANCES + " instances in " + (stop - start) + "ms ===");
- System.out.println("=== This is " + Math.round(1000 * INSTANCES / (stop - start)) + " instances per second ===");
- }
-
- public static class PerfActionHandler implements ActionHandler
- {
- public void execute(ExecutionContext executionContext) throws Exception
- {
- //System.out.println(count);
- }
- }
-}
-
Added: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/jar/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
===================================================================
--- jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/jar/src/test/java/org/jbpm/perf/SimplePerformanceTest.java (rev 0)
+++ jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/jar/src/test/java/org/jbpm/perf/SimplePerformanceTest.java 2009-02-20 11:11:25 UTC (rev 3975)
@@ -0,0 +1,110 @@
+/*
+ * 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.perf;
+
+// $Id$
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.command.CommandService;
+import org.jbpm.command.StartProcessInstanceCommand;
+import org.jbpm.command.impl.CommandServiceImpl;
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * This tests creates a number of process instances.
+ * Every instance has a call to an ActionHandler.
+ *
+ * https://jira.jboss.org/jira/browse/JBPM-2043
+ *
+ * @author mvecera(a)redhat.com
+ * @author pmacik(a)redhat.com
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Feb-2009
+ */
+public class SimplePerformanceTest extends AbstractDbTestCase
+{
+ private static final Log log = LogFactory.getLog(SimplePerformanceTest.class);
+
+ private CommandService commandService = new CommandServiceImpl(getJbpmConfiguration());
+ private static final int INSTANCES = 1000;
+ private static int count;
+
+ ProcessDefinition processDefinition;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ processDefinition = ProcessDefinition.parseXmlString(
+ "<process-definition xmlns='urn:jbpm.org:jpdl-3.1' name='processDefinition1'>" +
+ " <start-state name='start'>" +
+ " <transition name='to_state' to='end'>" +
+ " <action class='" + PerfActionHandler.class.getName() + "'/>" +
+ " </transition>" +
+ " </start-state>" +
+ " <end-state name='end'/>" +
+ "</process-definition>");
+
+ saveAndReload(processDefinition);
+ }
+
+ public void tearDown() throws Exception
+ {
+ beginSessionTransaction();
+ jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
+ super.tearDown();
+ }
+
+ public void testAsyncCall()
+ {
+ long start = System.currentTimeMillis();
+
+ commitAndCloseSession();
+
+ for (count = 0; count < INSTANCES; count++)
+ {
+ beginSessionTransaction();
+ StartProcessInstanceCommand startCommand = new StartProcessInstanceCommand();
+ startCommand.setProcessId(processDefinition.getId());
+ startCommand.setProcessName("processDefinition1");
+ ProcessInstance pi = (ProcessInstance)commandService.execute(startCommand);
+ commitAndCloseSession();
+ }
+
+ long stop = System.currentTimeMillis();
+ System.out.println("=== Test finished processing " + INSTANCES + " instances in " + (stop - start) + "ms ===");
+ System.out.println("=== This is " + Math.round(1000 * INSTANCES / (stop - start)) + " instances per second ===");
+ }
+
+ public static class PerfActionHandler implements ActionHandler
+ {
+ public void execute(ExecutionContext executionContext) throws Exception
+ {
+ //System.out.println(count);
+ }
+ }
+}
Property changes on: jbpm3/branches/jpdl-3.2.2-SOA-4.2/jpdl/jar/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 2 months
JBoss JBPM SVN: r3974 - in jbpm4/trunk/modules/jpdl: scripts and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-20 05:59:23 -0500 (Fri, 20 Feb 2009)
New Revision: 3974
Added:
jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml
Modified:
jbpm4/trunk/modules/jpdl/pom.xml
Log:
Try to avoid windows path information
Modified: jbpm4/trunk/modules/jpdl/pom.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/pom.xml 2009-02-20 10:56:27 UTC (rev 3973)
+++ jbpm4/trunk/modules/jpdl/pom.xml 2009-02-20 10:59:23 UTC (rev 3974)
@@ -82,6 +82,20 @@
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
+ <execution>
+ <id>ant-copy-resources</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="build.dir" value="${project.build.directory}" />
+ <property name="user.home" value="${user.home}" />
+ <ant antfile="scripts/antrun-copy-resources.xml" target="copy" />
+ </tasks>
+ </configuration>
+ </execution>
<execution>
<phase>compile</phase>
<goals>
@@ -104,6 +118,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
+ <!-- https://jira.jboss.org/jira/browse/JBPM-1759 -->
+ <exclude>org/jbpm/jpdl/controlflow/DecisionExpressionTest.java</exclude>
+ <exclude>org/jbpm/jpdl/controlflow/DecisionHandlerTest.java</exclude>
+ <exclude>org/jbpm/jpdl/parsing/JpdlSchemaTest.java</exclude>
+ <exclude>org/jbpm/jpdl/parsing/ProcessParsingTest.java</exclude>
+ <exclude>org/jbpm/jpdl/parsing/TransitionParsingTest.java</exclude>
</excludes>
</configuration>
</plugin>
Added: jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml (rev 0)
+++ jbpm4/trunk/modules/jpdl/scripts/antrun-copy-resources.xml 2009-02-20 10:59:23 UTC (rev 3974)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id: antrun-jbpm-config.xml 3602 2009-01-08 04:27:48Z alex.guizar(a)jboss.com $ -->
+
+<project>
+
+ <target name="copy">
+ <echo>***</echo>
+ <echo>Build dir: ${build.dir} </echo>
+ <echo>***</echo>
+ </target>
+</project>
\ No newline at end of file
17 years, 2 months
JBoss JBPM SVN: r3973 - jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-02-20 05:56:27 -0500 (Fri, 20 Feb 2009)
New Revision: 3973
Added:
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
Removed:
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java
Log:
[JBPM-2043] Cleanup performance test
Deleted: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java 2009-02-20 10:27:03 UTC (rev 3972)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java 2009-02-20 10:56:27 UTC (rev 3973)
@@ -1,111 +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.perf;
-
-// $Id$
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jbpm.command.CommandService;
-import org.jbpm.command.StartProcessInstanceCommand;
-import org.jbpm.command.impl.CommandServiceImpl;
-import org.jbpm.db.AbstractDbTestCase;
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * This tests creates 10000 process instances. Every instance has an async call
- * to the test class. See JIRA bugs SOA-1175 and JBPM-2043.
- *
- * @author mvecera(a)redhat.com
- * @author pmacik(a)redhat.com
- * @author thomas.diesler(a)jboss.com
- * @since 18-Feb-2009
- */
-public class AsyncCallTest extends AbstractDbTestCase
-{
- private static final Log log = LogFactory.getLog(AsyncCallTest.class);
-
- private CommandService commandService = new CommandServiceImpl(getJbpmConfiguration());
- private static final int INSTANCES = 1000;
- private static int count;
-
- ProcessDefinition processDefinition;
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition xmlns='urn:jbpm.org:jpdl-3.1' name='processDefinition1'>" +
- " <start-state name='start'>" +
- " <transition name='to_state' to='end'>" +
- " <action class='" + PerfActionHandler.class.getName() + "'/>" +
- " </transition>" +
- " </start-state>" +
- " <end-state name='end'/>" +
- "</process-definition>");
-
- saveAndReload(processDefinition);
- }
-
- public void tearDown() throws Exception
- {
- beginSessionTransaction();
- jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
- super.tearDown();
- }
-
- public void testAsyncCall()
- {
- long start = System.currentTimeMillis();
-
- commitAndCloseSession();
- startJobExecutor();
-
- for (count = 0; count < INSTANCES; count++)
- {
- beginSessionTransaction();
- StartProcessInstanceCommand startCommand = new StartProcessInstanceCommand();
- startCommand.setProcessId(processDefinition.getId());
- startCommand.setProcessName("processDefinition1");
- ProcessInstance pi = (ProcessInstance)commandService.execute(startCommand);
- commitAndCloseSession();
- }
-
- stopJobExecutor();
-
- long stop = System.currentTimeMillis();
- System.out.println("=== Test finished processing " + INSTANCES + " instances in " + (stop - start) + "ms ===");
- System.out.println("=== This is " + Math.round(1000 * INSTANCES / (stop - start)) + " instances per second ===");
- }
-
- public static class PerfActionHandler implements ActionHandler
- {
- public void execute(ExecutionContext executionContext) throws Exception
- {
- //System.out.println(count);
- }
- }
-}
Copied: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java (from rev 3969, jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/AsyncCallTest.java)
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java (rev 0)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java 2009-02-20 10:56:27 UTC (rev 3973)
@@ -0,0 +1,110 @@
+/*
+ * 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.perf;
+
+// $Id$
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.command.CommandService;
+import org.jbpm.command.StartProcessInstanceCommand;
+import org.jbpm.command.impl.CommandServiceImpl;
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * This tests creates a number of process instances.
+ * Every instance has a call to an ActionHandler.
+ *
+ * https://jira.jboss.org/jira/browse/JBPM-2043
+ *
+ * @author mvecera(a)redhat.com
+ * @author pmacik(a)redhat.com
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Feb-2009
+ */
+public class SimplePerformanceTest extends AbstractDbTestCase
+{
+ private static final Log log = LogFactory.getLog(SimplePerformanceTest.class);
+
+ private CommandService commandService = new CommandServiceImpl(getJbpmConfiguration());
+ private static final int INSTANCES = 1000;
+ private static int count;
+
+ ProcessDefinition processDefinition;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ processDefinition = ProcessDefinition.parseXmlString(
+ "<process-definition xmlns='urn:jbpm.org:jpdl-3.1' name='processDefinition1'>" +
+ " <start-state name='start'>" +
+ " <transition name='to_state' to='end'>" +
+ " <action class='" + PerfActionHandler.class.getName() + "'/>" +
+ " </transition>" +
+ " </start-state>" +
+ " <end-state name='end'/>" +
+ "</process-definition>");
+
+ saveAndReload(processDefinition);
+ }
+
+ public void tearDown() throws Exception
+ {
+ beginSessionTransaction();
+ jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
+ super.tearDown();
+ }
+
+ public void testAsyncCall()
+ {
+ long start = System.currentTimeMillis();
+
+ commitAndCloseSession();
+
+ for (count = 0; count < INSTANCES; count++)
+ {
+ beginSessionTransaction();
+ StartProcessInstanceCommand startCommand = new StartProcessInstanceCommand();
+ startCommand.setProcessId(processDefinition.getId());
+ startCommand.setProcessName("processDefinition1");
+ ProcessInstance pi = (ProcessInstance)commandService.execute(startCommand);
+ commitAndCloseSession();
+ }
+
+ long stop = System.currentTimeMillis();
+ System.out.println("=== Test finished processing " + INSTANCES + " instances in " + (stop - start) + "ms ===");
+ System.out.println("=== This is " + Math.round(1000 * INSTANCES / (stop - start)) + " instances per second ===");
+ }
+
+ public static class PerfActionHandler implements ActionHandler
+ {
+ public void execute(ExecutionContext executionContext) throws Exception
+ {
+ //System.out.println(count);
+ }
+ }
+}
17 years, 2 months
JBoss JBPM SVN: r3972 - in jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources: org/jbpm/context/exe/variableinstance and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-02-20 05:27:03 -0500 (Fri, 20 Feb 2009)
New Revision: 3972
Added:
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/hibernate.mapping.sybase.xml
jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml
Log:
Restore sybase spcific string mapping
Added: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/hibernate.mapping.sybase.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/hibernate.mapping.sybase.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/hibernate.mapping.sybase.xml 2009-02-20 10:27:03 UTC (rev 3972)
@@ -0,0 +1,142 @@
+ <!-- ###################### -->
+ <!-- # jbpm mapping files # -->
+ <!-- ###################### -->
+
+ <!-- hql queries -->
+ <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />
+
+ <!-- sybase type mappings -->
+ <mapping resource="org/jbpm/db/hibernate.types.sybase.hbm.xml" />
+
+ <!-- hql queries used in simulation for querying historical data.
+ uncomment if you want to use the GetSimulationInputCommand
+ or you want to use the queries directly.
+ beware: the queries need the stddev function to be enabled in your dialect.
+ for more information, visit:
+ http://www.camunda.com/business_process_simulation_news/mysql_and_stddev.... -->
+ <!--
+ <mapping resource="org/jbpm/sim/bam/hibernate.queries.hbm.xml" />
+ -->
+
+ <!-- graph.action mapping files -->
+ <mapping resource="org/jbpm/graph/action/MailAction.hbm.xml"/>
+
+ <!-- graph.def mapping files -->
+ <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
+ <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
+
+ <!-- ########################################### -->
+ <!-- # mapping file with external dependencies # -->
+ <!-- ########################################### -->
+ <!-- the following mapping file has a dependency on 'bsh-{version}.jar'.
+ uncomment this if bsh is not in your classpath.
+ the script element will not be available in process definition files.
+ note: this mapping must appear below org/jbpm/graph/def/Action.hbm.xml -->
+ <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
+
+ <!-- graph.node mapping files -->
+ <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/MailNode.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
+
+ <!-- context.def mapping files -->
+ <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
+
+ <!-- bytes mapping files -->
+ <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
+
+ <!-- module.def mapping files -->
+ <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
+
+ <!-- file.def mapping files -->
+ <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
+
+ <!-- taskmgmt.def mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
+
+ <!-- scheduler.def mapping files -->
+ <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
+ <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
+
+ <!-- graph.exe mapping files -->
+ <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
+
+ <!-- module.exe mapping files -->
+ <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
+
+ <!-- context.exe mapping files -->
+ <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml" />
+ <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
+
+ <!-- job mapping files -->
+ <mapping resource="org/jbpm/job/Job.hbm.xml"/>
+ <mapping resource="org/jbpm/job/Timer.hbm.xml"/>
+ <mapping resource="org/jbpm/job/ExecuteNodeJob.hbm.xml"/>
+ <mapping resource="org/jbpm/job/ExecuteActionJob.hbm.xml"/>
+ <mapping resource="org/jbpm/job/CleanUpProcessJob.hbm.xml"/>
+
+ <!-- taskmgmt.exe mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
+
+ <!-- logging mapping files -->
+ <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
Property changes on: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/hibernate.mapping.sybase.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml 2009-02-20 10:27:03 UTC (rev 3972)
@@ -0,0 +1,17 @@
+<?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 auto-import="false" default-access="field">
+ <subclass name="org.jbpm.context.exe.variableinstance.HibernateStringInstance"
+ extends="org.jbpm.context.exe.VariableInstance"
+ discriminator-value="I">
+ <!-- id-type seems to be unaware of type definitions -->
+ <any name="value" id-type="org.jbpm.db.hibernate.TextType" cascade="save-update">
+ <column name="STRINGIDCLASS_" />
+ <column name="STRINGVALUE_" length="4000"/>
+ </any>
+ </subclass>
+</hibernate-mapping>
Property changes on: jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 2 months
JBoss JBPM SVN: r3971 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/history and 10 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-20 05:14:21 -0500 (Fri, 20 Feb 2009)
New Revision: 3971
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/EndProcessInstance.java
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/EndProcessInstanceTest.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/history/HistoryProcessInstanceQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java
jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.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/ActivityStart.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/model/HistoryProcessInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
Log:
added ending of process instances
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -107,8 +107,17 @@
/** indicates that this execution is doing an asynchronous continuation. */
String STATE_ASYNC = "async";
-
+ /** this execution has been cancelled before it came to completion.
+ * Only history executions might expose this state. This state can be
+ * passed in {@link ExecutionService#endProcessInstance(String, String)}.
+ * Make sure that comparisons are
+ * done with .equals and not with '==' because if executions are
+ * loaded from persistent storage, a new string is created instead
+ * of the constants. */
+ String STATE_CANCELLED = "cancelled";
+
+
long getDbid();
/** the externally given name or id of this execution. The id of a main
* path of execution is null. Can be used to differentiate concurrent
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionQuery.java 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionQuery.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -43,4 +43,5 @@
ExecutionQuery page(int firstResult, int maxResults);
List<Execution> execute();
+ Execution executeUniqueResult();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -134,6 +134,9 @@
/** retrieves a map of variables */
Map<String, Object> getVariables(String executionId, Set<String> variableNames);
+
+ /** end a process instance */
+ void endProcessInstance(String processInstanceId, String state);
/** delete a process instance */
void deleteProcessInstance(String processInstanceId);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/history/HistoryProcessInstanceQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/history/HistoryProcessInstanceQuery.java 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/history/HistoryProcessInstanceQuery.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -36,6 +36,7 @@
String PROPERTY_STATE = "state";
String PROPERTY_DURATION = "duration";
+ HistoryProcessInstanceQuery processInstanceId(String processInstanceId);
HistoryProcessInstanceQuery processDefinitionId(String processDefinitionId);
HistoryProcessInstanceQuery state(String state);
@@ -45,4 +46,5 @@
HistoryProcessInstanceQuery page(int firstResult, int maxResults);
List<HistoryProcessInstance> execute();
+ HistoryProcessInstance executeUniqueResult();
}
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-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -23,7 +23,6 @@
import java.util.List;
-import org.jbpm.Execution;
import org.jbpm.client.ClientExecution;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.job.Job;
@@ -66,10 +65,13 @@
/** the execution uniquely identified by the given executionKey. */
ClientExecution findExecutionById(String executionId);
+ /** 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. */
- Execution findExecutionByKey(String processDefinitionName, String executionKey);
-
+ ClientExecution findExecutionByKey(String processDefinitionName, String executionKey);
+
/* find ids for all process instances for a given process definition. */
List<String> findProcessInstanceIds(String processDefinitionId);
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-02-20 10:14:21 UTC (rev 3971)
@@ -16,6 +16,7 @@
<process-service />
<execution-service />
+ <history-service />
<management-service />
<task-service />
@@ -25,7 +26,10 @@
<standard-transaction-interceptor />
</command-service>
- <hibernate-configuration resource="examples-hibernate.cfg.xml"/>
+ <hibernate-configuration resource="examples-hibernate.cfg.xml">
+ <cache-configuration resource="jbpm.pvm.cache.xml"
+ usage="nonstrict-read-write" />
+ </hibernate-configuration>
<hibernate-session-factory />
@@ -61,6 +65,7 @@
<task-db-session />
<message-session />
<timer-session />
+ <history-session />
</transaction-context>
</jbpm-configuration>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -40,7 +40,8 @@
}
public Void execute(Environment environment) throws Exception {
- Environment.getFromCurrent(PvmDbSession.class).deleteProcessInstance(processInstanceId);
+ PvmDbSession pvmDbSession = Environment.getFromCurrent(PvmDbSession.class);
+ pvmDbSession.deleteProcessInstance(processInstanceId);
return null;
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/EndProcessInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/EndProcessInstance.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/EndProcessInstance.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -0,0 +1,52 @@
+/*
+ * 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.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.session.PvmDbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EndProcessInstance implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String processInstanceId;
+ protected String state;
+
+ public EndProcessInstance(String processInstanceId, String state) {
+ super();
+ this.processInstanceId = processInstanceId;
+ this.state = state;
+ }
+
+ public Object execute(Environment environment) throws Exception {
+ PvmDbSession pvmDbSession = Environment.getFromCurrent(PvmDbSession.class);
+ ExecutionImpl processInstance = (ExecutionImpl) pvmDbSession.findProcessInstanceById(processInstanceId);
+ processInstance.end(state);
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/EndProcessInstance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
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-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -162,7 +162,7 @@
return (ClientExecution) query.uniqueResult();
}
- public Execution findExecutionByKey(String processDefinitionName, String executionKey) {
+ 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);
@@ -170,6 +170,14 @@
query.setMaxResults(1);
return (ClientExecution) query.uniqueResult();
}
+
+ public ClientExecution findProcessInstanceById(String processInstanceId) {
+ // query definition can be found at the bottom of resource jbpm.pvm.execution.hbm.xml
+ Query query = session.getNamedQuery("findProcessInstanceById");
+ query.setString("processInstanceId", processInstanceId);
+ query.setMaxResults(1);
+ return (ClientExecution) query.uniqueResult();
+ }
public List<Timer> findTimers(int firstResult, int maxResults) {
// 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/history/events/ActivityStart.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -39,8 +39,10 @@
public void process() {
Session session = Environment.getFromCurrent(Session.class);
+ String processInstanceId = execution.getProcessInstance().getId();
+
HistoryProcessInstance historyProcessInstanceImpl = (HistoryProcessInstance)
- session.load(HistoryProcessInstanceImpl.class, execution.getId());
+ session.load(HistoryProcessInstanceImpl.class, processInstanceId);
HistoryActivityInstanceImpl historyActivityInstanceImpl =
createHistoryActivityInstance(historyProcessInstanceImpl);
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-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -39,5 +39,7 @@
HistoryProcessInstanceImpl historyProcessInstanceImpl = (HistoryProcessInstanceImpl)
session.load(HistoryProcessInstanceImpl.class, execution.getId());
historyProcessInstanceImpl.setEndTime(Clock.getCurrentTime());
+ historyProcessInstanceImpl.setState(execution.getState());
+ historyProcessInstanceImpl.setEndActivityName(execution.getActivityName());
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -43,10 +43,11 @@
protected String processInstanceId;
protected String key;
protected String state;
+ protected String endActivityName;
protected Date startTime;
protected Date endTime;
protected long duration;
-
+
/** only here to get hibernate cascade deletes */
protected Set<HistoryActivityInstanceImpl> historyActivityInstances;
@@ -96,4 +97,13 @@
public String getProcessDefinitionId() {
return processDefinitionId;
}
+ public void setState(String state) {
+ this.state = state;
+ }
+ public String getEndActivityName() {
+ return endActivityName;
+ }
+ public void setEndActivityName(String endActivityName) {
+ this.endActivityName = endActivityName;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -26,6 +26,7 @@
import org.hibernate.Query;
import org.jbpm.Execution;
import org.jbpm.ExecutionQuery;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.CommandService;
import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -48,6 +49,17 @@
this.onlyProcessInstances = onlyProcessInstances;
}
+ public Execution executeUniqueResult() {
+ List<Execution> executions = execute();
+ if (executions.isEmpty()) {
+ throw new JbpmException("no execution with these criteria");
+ }
+ if (executions.size()>1) {
+ throw new JbpmException("more then 1 execution with these criteria");
+ }
+ return executions.get(0);
+ }
+
public List<Execution> execute() {
return (List<Execution>) commandService.execute(this);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -24,7 +24,10 @@
import java.util.List;
import org.hibernate.Query;
+import org.jbpm.Execution;
+import org.jbpm.JbpmException;
import org.jbpm.cmd.CommandService;
+import org.jbpm.history.HistoryProcessInstance;
import org.jbpm.history.HistoryProcessInstanceQuery;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
@@ -38,6 +41,7 @@
protected String processDefinitionId;
protected String state;
+ protected String processInstanceId;
public HistoryProcessInstanceQueryImpl(CommandService commandService) {
super(commandService);
@@ -50,6 +54,10 @@
hql.append(HistoryProcessInstanceImpl.class.getName());
hql.append(" as hpi ");
+ if (processInstanceId!=null) {
+ appendWhereClause(" hpi.id = '"+processInstanceId+"' ", hql);
+ }
+
if (processDefinitionId!=null) {
appendWhereClause(" hpi.processDefinitionId = '"+processDefinitionId+"' ", hql);
}
@@ -64,10 +72,26 @@
protected void applyParameters(Query query) {
}
- public List<org.jbpm.history.HistoryProcessInstance> execute() {
+ public List<HistoryProcessInstance> execute() {
return (List) commandService.execute(this);
}
+ public HistoryProcessInstance executeUniqueResult() {
+ List<HistoryProcessInstance> historyProcessInstances = execute();
+ if (historyProcessInstances.isEmpty()) {
+ throw new JbpmException("no history process instance with these criteria");
+ }
+ if (historyProcessInstances.size()>1) {
+ throw new JbpmException("more then 1 history process instance with these criteria");
+ }
+ return historyProcessInstances.get(0);
+ }
+
+ public HistoryProcessInstanceQuery processInstanceId(String processInstanceId) {
+ this.processInstanceId = processInstanceId;
+ return this;
+ }
+
public HistoryProcessInstanceQuery orderAsc(String property) {
addOrderByClause("hpi."+property+" asc");
return this;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -33,6 +33,7 @@
import org.jbpm.history.HistoryActivityInstanceQuery;
import org.jbpm.history.HistoryProcessInstanceQuery;
import org.jbpm.pvm.internal.cmd.DeleteProcessInstance;
+import org.jbpm.pvm.internal.cmd.EndProcessInstance;
import org.jbpm.pvm.internal.cmd.FindExecutionsCmd;
import org.jbpm.pvm.internal.cmd.FindExecutionCmd;
import org.jbpm.pvm.internal.cmd.GetVariableNamesCmd;
@@ -144,6 +145,10 @@
return new ExecutionQueryImpl(commandService, true);
}
+ public void endProcessInstance(String processInstanceId, String state) {
+ commandService.execute(new EndProcessInstance(processInstanceId, state));
+ }
+
public void deleteProcessInstance(String processInstanceId) {
commandService.execute(new DeleteProcessInstance(processInstanceId));
}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml 2009-02-20 10:14:21 UTC (rev 3971)
@@ -118,6 +118,15 @@
]]>
</query>
+ <query name="findProcessInstanceById">
+ <![CDATA[
+ select processInstance
+ from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
+ where processInstance.id = :processInstanceId
+ and processInstance.parent is null
+ ]]>
+ </query>
+
<query name="findExecutionByKey">
<![CDATA[
select execution
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml 2009-02-20 10:14:21 UTC (rev 3971)
@@ -16,6 +16,7 @@
<property name="endTime" column="END_" type="timestamp" />
<property name="duration" column="DURATION_" />
<property name="state" column="STATE_" />
+ <property name="endActivityName" column="ENDACTIVITY_" />
<many-to-one name="processDefinition"
class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
Added: jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/EndProcessInstanceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/EndProcessInstanceTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/EndProcessInstanceTest.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -0,0 +1,65 @@
+/*
+ * 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 java.util.List;
+
+import org.jbpm.Execution;
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EndProcessInstanceTest extends JbpmTestCase {
+
+ public void testCancelProcessInstance() {
+ deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start>" +
+ " <transition to='wait' />" +
+ " </start>" +
+ " <state name='wait'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startProcessInstanceByKey("ICL");
+ String processInstanceId = execution.getId();
+ executionService.endProcessInstance(processInstanceId, Execution.STATE_CANCELLED);
+
+ List<Execution> executions = executionService.createExecutionQuery()
+ .processInstanceId(processInstanceId)
+ .execute();
+ assertEquals(0, executions.size());
+
+ HistoryProcessInstance historyProcessInstance = historyService.createHistoryProcessInstanceQuery()
+ .processInstanceId(processInstanceId)
+ .executeUniqueResult();
+
+ assertNotNull(historyProcessInstance.getEndTime());
+ assertEquals(Execution.STATE_CANCELLED, historyProcessInstance.getState());
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/EndProcessInstanceTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: 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 2009-02-20 10:01:37 UTC (rev 3970)
+++ jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-02-20 10:14:21 UTC (rev 3971)
@@ -23,6 +23,7 @@
import java.util.List;
+import org.jbpm.Execution;
import org.jbpm.history.HistoryProcessInstance;
import org.jbpm.history.HistoryProcessInstanceQuery;
import org.jbpm.test.JbpmTestCase;
@@ -61,5 +62,14 @@
assertNotNull(historyProcessInstance.getStartTime());
assertNotNull(historyProcessInstance.getEndTime());
}
+
+ // also check that the ended process instances have been removed from the
+ // runtime database
+ List<Execution> executions = executionService
+ .createExecutionQuery()
+ .processDefinitionId("ICL:1")
+ .execute();
+
+ assertEquals(0, executions.size());
}
}
17 years, 2 months