[jbpm-commits] JBoss JBPM SVN: r1845 - in jbpm4/pvm/trunk: modules/core and 2 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Aug 7 07:12:10 EDT 2008
Author: tom.baeyens at jboss.com
Date: 2008-08-07 07:12:10 -0400 (Thu, 07 Aug 2008)
New Revision: 1845
Modified:
jbpm4/pvm/trunk/.classpath
jbpm4/pvm/trunk/modules/core/pom.xml
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/embedded/EmbeddedPersistenceTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/embedded/Order.java
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/api/db/embedded/Order.hbm.xml
jbpm4/pvm/trunk/pom.xml
Log:
pom cleanup
Modified: jbpm4/pvm/trunk/.classpath
===================================================================
--- jbpm4/pvm/trunk/.classpath 2008-08-07 07:55:35 UTC (rev 1844)
+++ jbpm4/pvm/trunk/.classpath 2008-08-07 11:12:10 UTC (rev 1845)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="modules/core/target/classes" path="modules/core/src/main/java"/>
+ <classpathentry kind="src" output="modules/core/target/classes" path="modules/core/src/main/resources"/>
<classpathentry kind="src" output="modules/core/target/test-classes" path="modules/core/src/test/java"/>
- <classpathentry kind="src" output="modules/core/target/classes" path="modules/core/src/main/resources"/>
<classpathentry kind="src" output="modules/core/target/test-classes" path="modules/core/src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER/modules"/>
Modified: jbpm4/pvm/trunk/modules/core/pom.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/pom.xml 2008-08-07 07:55:35 UTC (rev 1844)
+++ jbpm4/pvm/trunk/modules/core/pom.xml 2008-08-07 11:12:10 UTC (rev 1845)
@@ -11,301 +11,281 @@
<!-- $Id$ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <name>JBoss jBPM - PVM Core</name>
- <groupId>org.jboss.jbpm.pvm</groupId>
- <artifactId>pvm</artifactId>
- <packaging>jar</packaging>
-
- <!-- Parent -->
- <parent>
- <groupId>org.jboss.jbpm.pvm</groupId>
- <artifactId>pvm-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
-
- <!-- Properties -->
- <properties>
- <table.prefix>JBPM_</table.prefix>
- <surefire.gc.args>-XX:MaxPermSize=128m</surefire.gc.args>
- <surefire.jdwp.args>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</surefire.jdwp.args>
- <test.resources.directory>${project.build.directory}/test-resources</test.resources.directory>
- </properties>
-
- <!-- Dependencies -->
- <dependencies>
- <!-- jBPM Dependencies -->
-
- <!-- Compile Dependencies -->
-
- <dependency>
- <groupId>juel</groupId>
- <artifactId>juel</artifactId>
- </dependency>
-
- <dependency>
- <groupId>juel</groupId>
- <artifactId>juel-engine</artifactId>
- </dependency>
-
- <dependency>
- <groupId>juel</groupId>
- <artifactId>juel-impl</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- </dependency>
-
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.cenqua.clover</groupId>
- <artifactId>clover</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
-<!--
- Not in scope test because org.jbpm.pvm.test.base package is in main source: see JBPM-1416
- <scope>test</scope>
--->
- </dependency>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.livetribe</groupId>
- <artifactId>livetribe-jsr223</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <exclusions>
- <exclusion>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
- </dependency>
-
- <dependency>
- <groupId>cactus</groupId>
- <artifactId>cactus</artifactId>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <!-- Plugins -->
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ### GENERAL PROJECT INFO ########################################### -->
+ <name>JBoss jBPM 4 - PVM</name>
+ <groupId>org.jbpm</groupId>
+ <artifactId>pvm</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- ### PARENT ######################################################### -->
+ <parent>
+ <groupId>org.jbpm</groupId>
+ <artifactId>pvm-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <!-- ### PROPERTIES ##################################################### -->
+ <properties>
+ <table.prefix>JBPM_</table.prefix>
+ <surefire.gc.args>-XX:MaxPermSize=128m</surefire.gc.args>
+ <surefire.jdwp.args>-Xdebug -Xnoagent -Djava.compiler=NONE
+ -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</surefire.jdwp.args>
+ <test.resources.directory>${project.build.directory}/test-resources</test.resources.directory>
+ </properties>
+
+ <!-- ### DEPENDENCIES ################################################### -->
+ <dependencies>
+ <dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.cenqua.clover</groupId>
+ <artifactId>clover</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <!-- Not in scope test because org.jbpm.pvm.test.base package is in main source: see JBPM-1416 -->
+ <!-- <scope>test</scope> -->
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.livetribe</groupId>
+ <artifactId>livetribe-jsr223</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>cactus</groupId>
+ <artifactId>cactus</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <!-- ### PLUGINS ###################################################### -->
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <showDeprecation>false</showDeprecation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>hibernate.cfg.xml</exclude>
+ <exclude>jbpm.cfg.xml</exclude>
+ <exclude>jbpm.mail.templates.xml</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <applicationXml>${basedir}/src/main/etc/ear/META-INF/application.xml</applicationXml>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${surefire.jvm.args}</argLine>
+ <includes>
+ <include>org/jbpm/pvm/CheckInTests.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build-jars</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
<configuration>
- <showDeprecation>false</showDeprecation>
-
+ <tasks>
+ <property name="tests.output.dir" value="${project.build.directory}" />
+ <property name="tests.resources.dir" value="${basedir}/src/test/resources" />
+ <ant antfile="scripts/build-jars-pvm.xml" target="build-jars-pvm" />
+ </tasks>
</configuration>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
+ </execution>
+ <execution>
+ <id>rename-tables</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
<configuration>
- <excludes>
- <exclude>hibernate.cfg.xml</exclude>
- <exclude>jbpm.cfg.xml</exclude>
- <exclude>jbpm.mail.templates.xml</exclude>
- </excludes>
+ <tasks>
+ <replace dir="target/classes" includes="**/hibernate.*.hbm.xml"
+ token="table="JBPM_" value="table="${table.prefix}" />
+ </tasks>
</configuration>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-ear-plugin</artifactId>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.agilejava.docbkx</groupId>
+ <artifactId>docbkx-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>doc-reference html</id>
+ <goals>
+ <goal>generate-html</goal>
+ </goals>
+ <phase>package</phase>
<configuration>
- <applicationXml>${basedir}/src/main/etc/ear/META-INF/application.xml</applicationXml>
+ <sourceDirectory>${basedir}/src/docbook/doc-reference/en</sourceDirectory>
+ <targetDirectory>${basedir}/target/manual/html_single/reference</targetDirectory>
+ <postProcess>
+ <copy
+ todir="${basedir}/target/manual/html_single/reference/images">
+ <fileset
+ dir="${basedir}/src/docbook/doc-reference/en/images">
+ <include name="**/*.png" />
+ <include name="**/*.gif" />
+ <include name="**/*.jpg" />
+ </fileset>
+ </copy>
+ </postProcess>
</configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
+ </execution>
+ <execution>
+ <id>doc-reference chunk html</id>
+ <goals>
+ <goal>generate-html</goal>
+ </goals>
+ <phase>package</phase>
<configuration>
- <argLine>${surefire.jvm.args}</argLine>
- <includes>
- <include>org/jbpm/pvm/CheckInTests.java</include>
- </includes>
+ <sourceDirectory>${basedir}/src/docbook/doc-reference/en</sourceDirectory>
+ <targetDirectory>${basedir}/target/manual/html/reference</targetDirectory>
+ <chunkedOutput>true</chunkedOutput>
+ <postProcess>
+ <copy todir="${basedir}/target/manual/html/reference/images">
+ <fileset
+ dir="${basedir}/src/docbook/doc-reference/en/images">
+ <include name="**/*.png" />
+ <include name="**/*.gif" />
+ <include name="**/*.jpg" />
+ </fileset>
+ </copy>
+ </postProcess>
</configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>build-jars</id>
- <phase>test-compile</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <property name="tests.output.dir" value="${project.build.directory}"/>
- <property name="tests.resources.dir" value="${basedir}/src/test/resources"/>
- <ant antfile="scripts/build-jars-pvm.xml" target="build-jars-pvm"/>
- </tasks>
- </configuration>
- </execution>
- <execution>
- <id>rename-tables</id>
- <phase>compile</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <replace dir="target/classes" includes="**/hibernate.*.hbm.xml" token="table="JBPM_" value="table="${table.prefix}" />
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>com.agilejava.docbkx</groupId>
- <artifactId>docbkx-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>doc-reference html</id>
- <goals>
- <goal>generate-html</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <sourceDirectory>${basedir}/src/docbook/doc-reference/en</sourceDirectory>
- <targetDirectory>${basedir}/target/manual/html_single/reference</targetDirectory>
- <postProcess>
- <copy todir="${basedir}/target/manual/html_single/reference/images">
- <fileset dir="${basedir}/src/docbook/doc-reference/en/images">
- <include name="**/*.png"/>
- <include name="**/*.gif"/>
- <include name="**/*.jpg"/>
- </fileset>
- </copy>
- </postProcess>
- </configuration>
- </execution>
- <execution>
- <id>doc-reference chunk html</id>
- <goals>
- <goal>generate-html</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <sourceDirectory>${basedir}/src/docbook/doc-reference/en</sourceDirectory>
- <targetDirectory>${basedir}/target/manual/html/reference</targetDirectory>
- <chunkedOutput>true</chunkedOutput>
- <postProcess>
- <copy todir="${basedir}/target/manual/html/reference/images">
- <fileset dir="${basedir}/src/docbook/doc-reference/en/images">
- <include name="**/*.png"/>
- <include name="**/*.gif"/>
- <include name="**/*.jpg"/>
- </fileset>
- </copy>
- </postProcess>
- </configuration>
- </execution>
- <execution>
- <id>doc-reference pdf</id>
- <goals>
- <goal>generate-pdf</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <sourceDirectory>${basedir}/src/docbook/doc-reference/en</sourceDirectory>
- <targetDirectory>${basedir}/target/manual/pdf/reference</targetDirectory>
- <imgSrcPath>${basedir}/src/docbook/doc-reference/en/</imgSrcPath>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.docbook</groupId>
- <artifactId>docbook-xml</artifactId>
- <version>4.4</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
-
- <!-- Profiles -->
- <profiles>
-
- <!--
- Name: debug
- Descr: Enable remote debuging for tests
- -->
- <profile>
- <id>debug</id>
- <activation>
- <property>
- <name>debug</name>
- </property>
- </activation>
- <properties>
- <surefire.jvm.args>${surefire.jdwp.args} ${surefire.gc.args}</surefire.jvm.args>
- </properties>
- </profile>
- <profile>
- <id>no-debug</id>
- <activation>
- <property>
- <name>!debug</name>
- </property>
- </activation>
- <properties>
- <surefire.jvm.args>${surefire.gc.args}</surefire.jvm.args>
- </properties>
- </profile>
-
- </profiles>
-
-</project>
+ </execution>
+ <execution>
+ <id>doc-reference pdf</id>
+ <goals>
+ <goal>generate-pdf</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <sourceDirectory>${basedir}/src/docbook/doc-reference/en</sourceDirectory>
+ <targetDirectory>${basedir}/target/manual/pdf/reference</targetDirectory>
+ <imgSrcPath>${basedir}/src/docbook/doc-reference/en/</imgSrcPath>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.docbook</groupId>
+ <artifactId>docbook-xml</artifactId>
+ <version>4.4</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- ### PROFILES ####################################################### -->
+ <profiles>
+ <profile>
+ <id>debug</id>
+ <activation>
+ <property>
+ <name>debug</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jvm.args>${surefire.jdwp.args} ${surefire.gc.args}</surefire.jvm.args>
+ </properties>
+ </profile>
+ <profile>
+ <id>no-debug</id>
+ <activation>
+ <property>
+ <name>!debug</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jvm.args>${surefire.gc.args}</surefire.jvm.args>
+ </properties>
+ </profile>
+ </profiles>
+
+</project>
\ No newline at end of file
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/embedded/EmbeddedPersistenceTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/embedded/EmbeddedPersistenceTest.java 2008-08-07 07:55:35 UTC (rev 1844)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/embedded/EmbeddedPersistenceTest.java 2008-08-07 11:12:10 UTC (rev 1845)
@@ -32,41 +32,64 @@
*/
public class EmbeddedPersistenceTest extends JbpmTestCase {
+ SessionFactory sessionFactory;
+ Session session;
+ Transaction transaction;
+
public void testOrder() {
Configuration configuration = new Configuration();
configuration.configure("org/jbpm/pvm/api/db/embedded/hibernate.cfg.xml");
- SessionFactory sessionFactory = configuration.buildSessionFactory();
+ sessionFactory = configuration.buildSessionFactory();
- // start transaction
- Session session = sessionFactory.openSession();
- Transaction transaction = session.beginTransaction();
+ startTransaction();
Order order = new Order();
session.save(order);
- assertEquals("child", order.getState().getNode().getName());
+ assertEquals("arrived", order.getState());
- // new transaction
- transaction.commit();
- session.close();
- session = sessionFactory.openSession();
- transaction = session.beginTransaction();
+ newTransaction();
order = (Order) session.get(Order.class, order.getDbid());
- assertEquals("child", order.getState().getNode().getName());
- order.growUp();
- assertEquals("adult", order.getState().getNode().getName());
+ assertEquals("arrived", order.getState());
+ order.receive();
+ assertEquals("validate", order.getState());
- // new transaction
- transaction.commit();
- session.close();
- session = sessionFactory.openSession();
- transaction = session.beginTransaction();
+ newTransaction();
order = (Order) session.get(Order.class, order.getDbid());
- assertEquals("adult", order.getState().getNode().getName());
+ assertEquals("validate", order.getState());
+ order.approve();
+ assertEquals("ship goods", order.getState());
+ newTransaction();
+
+ order = (Order) session.get(Order.class, order.getDbid());
+ assertEquals("ship goods", order.getState());
+ order.paymentReceived();
+ assertEquals("archive", order.getState());
+
+ newTransaction();
+
+ order = (Order) session.get(Order.class, order.getDbid());
+ assertEquals("archive", order.getState());
+ order.archived();
+ assertEquals("end", order.getState());
+
+ commitTransaction();
+ }
+
+ void newTransaction() {
+ commitTransaction();
+ startTransaction();
+ }
+
+ void startTransaction() {
+ session = sessionFactory.openSession();
+ transaction = session.beginTransaction();
+ }
+
+ void commitTransaction() {
transaction.commit();
session.close();
}
-
}
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/embedded/Order.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/embedded/Order.java 2008-08-07 07:55:35 UTC (rev 1844)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/api/db/embedded/Order.java 2008-08-07 11:12:10 UTC (rev 1845)
@@ -22,72 +22,87 @@
package org.jbpm.pvm.api.db.embedded;
+import java.util.Map;
+
+import org.jbpm.pvm.activity.ActivityExecution;
+import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.client.ClientProcessInstance;
-import org.jbpm.pvm.model.OpenExecution;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.activity.ExternalActivity;
-import org.jbpm.pvm.activity.ActivityExecution;
-import java.util.Map;
-
/**
* @author Tom Baeyens
*/
public class Order {
- private static final ClientProcessDefinition processDefinition = createProcessDefinition();
+ private static final ClientProcessDefinition processDefinition = createProcessDefinition();
- long dbid;
- ClientProcessInstance state;
+ long dbid;
+ ClientProcessInstance processInstance;
- public Order() {
- state = getProcessDefinition().beginProcessInstance();
- }
+ public Order() {
+ processInstance = getProcessDefinition().beginProcessInstance();
+ }
- public static ClientProcessDefinition getProcessDefinition() {
- return processDefinition;
- }
+ public static ClientProcessDefinition getProcessDefinition() {
+ return processDefinition;
+ }
- private static ClientProcessDefinition createProcessDefinition() {
- ClientProcessDefinition processDefinition = ProcessFactory.build("the meaning of life")
- .node("child").initial().behaviour(WaitState.class)
- .transition("grow up").to("adult")
- .node("adult").behaviour(new WaitState())
- .transition("find a jobImpl").to("employee")
- .node("employee").behaviour(new WaitState())
- .transition("wrinkles").to("retired")
- .node("retired").behaviour(new WaitState())
- .transition("had enough").to("dead")
- .node("dead")
- .done();
+ private static ClientProcessDefinition createProcessDefinition() {
+ ClientProcessDefinition processDefinition = ProcessFactory.build("order")
+ .node("arrived").initial().behaviour(WaitState.class)
+ .transition("receive").to("validate")
+ .node("validate").behaviour(new WaitState())
+ .transition("approve").to("ship goods")
+ .transition("reject").to("end")
+ .node("ship goods").behaviour(new WaitState())
+ .transition("payment received").to("archive")
+ .node("archive").behaviour(new WaitState())
+ .transition("archived").to("end")
+ .node("end").behaviour(new WaitState())
+ .done();
- return processDefinition;
- }
+ return processDefinition;
+ }
- public long getDbid() {
- return dbid;
- }
+ public long getDbid() {
+ return dbid;
+ }
- public void setDbid(long dbid) {
- this.dbid = dbid;
- }
+ public void setDbid(long dbid) {
+ this.dbid = dbid;
+ }
+
+ public void receive() {
+ processInstance.signal("receive");
+ }
- public void growUp() {
- state.signal("grow up");
- }
+ public void approve() {
+ processInstance.signal("approve");
+ }
- public OpenExecution getState() {
- return state;
- }
+ public void reject() {
+ processInstance.signal("reject");
+ }
- public static class WaitState implements ExternalActivity
- {
- private static final long serialVersionUID = 1L;
- public void execute(ActivityExecution execution) {
- execution.waitForSignal();
- }
- public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters){
- }
- }
+ public void paymentReceived() {
+ processInstance.signal("payment received");
+ }
+
+ public void archived() {
+ processInstance.signal("archived");
+ }
+
+ public String getState() {
+ return processInstance.getNode().getName();
+ }
+
+ public static class WaitState implements ExternalActivity {
+ private static final long serialVersionUID = 1L;
+ public void execute(ActivityExecution execution) {
+ execution.waitForSignal();
+ }
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters){
+ }
+ }
}
Modified: jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/api/db/embedded/Order.hbm.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/api/db/embedded/Order.hbm.xml 2008-08-07 07:55:35 UTC (rev 1844)
+++ jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/api/db/embedded/Order.hbm.xml 2008-08-07 11:12:10 UTC (rev 1845)
@@ -11,7 +11,7 @@
<generator class="sequence"/>
</id>
- <property name="state" type="execution" />
+ <property name="processInstance" type="execution" />
</class>
Modified: jbpm4/pvm/trunk/pom.xml
===================================================================
--- jbpm4/pvm/trunk/pom.xml 2008-08-07 07:55:35 UTC (rev 1844)
+++ jbpm4/pvm/trunk/pom.xml 2008-08-07 11:12:10 UTC (rev 1845)
@@ -1,12 +1,13 @@
<?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.
- ======================================================================
--->
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
<!-- $Id$ -->
@@ -15,10 +16,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
-
+
<!-- ### GENERAL PROJECT INFO ########################################### -->
- <name>JBoss jBPM</name>
- <groupId>org.jboss.jbpm.pvm</groupId>
+ <name>JBoss jBPM 4 - PVM Parent</name>
+ <groupId>org.jbpm</groupId>
<artifactId>pvm-parent</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
@@ -27,13 +28,12 @@
<url>http://www.jboss.org</url>
</organization>
<url>http://jbpm.org/</url>
-
+
<!-- ### MODULES ######################################################## -->
<modules>
<module>modules/core</module>
- <module>modules/minimal</module>
</modules>
-
+
<!-- ### PROPERTIES ##################################################### -->
<properties>
<junit.version>3.8.1</junit.version>
@@ -51,7 +51,7 @@
<cactus.version>13-1.7.1</cactus.version>
<juel.version>2.1.0</juel.version>
</properties>
-
+
<!-- ### DEPENDENCY MANAGEMENT ########################################## -->
<dependencyManagement>
<dependencies>
@@ -127,7 +127,7 @@
</dependency>
</dependencies>
</dependencyManagement>
-
+
<!-- ### SOURCE CONTROL MANAGEMENT ###################################### -->
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/jbpm/jbpm4</connection>
@@ -137,7 +137,7 @@
<prerequisites>
<maven>2.0.9</maven>
</prerequisites>
-
+
<!-- ### ISSUE MANAGEMENT ############################################### -->
<issueManagement>
<system>jira</system>
@@ -223,7 +223,7 @@
</configuration>
</plugin>
</plugins>
-
+
<!-- ### PLUGIN MANAGEMENT ############################################## -->
<pluginManagement>
<plugins>
@@ -272,7 +272,7 @@
</plugins>
</pluginManagement>
</build>
-
+
<!-- ### DISTRIBUTION MANAGEMENT ######################################## -->
<distributionManagement>
<site>
@@ -285,7 +285,7 @@
</repository>
</distributionManagement>
- <!-- Profiles -->
+ <!-- ### PROFILES ####################################################### -->
<profiles>
<profile>
<id>skiptests</id>
@@ -350,7 +350,7 @@
</snapshots>
</repository>
</repositories>
-
+
<!-- ### PLUGIN REPOSITORIES ############################################ -->
<pluginRepositories>
<pluginRepository>
More information about the jbpm-commits
mailing list