JBoss JBPM SVN: r5975 - in jbpm4/trunk/modules: distro/src/main/files/install/src/cfg/hibernate/spring and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-17 04:17:28 -0500 (Thu, 17 Dec 2009)
New Revision: 5975
Added:
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/hsqldb.hibernate.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/hsqldb.inmem.hibernate.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/mysql.hibernate.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/oracle.hibernate.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/postgresql.hibernate.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/sybase.hibernate.cfg.xml
Modified:
jbpm4/trunk/modules/examples/pom.xml
jbpm4/trunk/modules/examples/src/test/resources/logging.properties
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java
Log:
JBPM-2631 spring transactions. added spring hibernate connection type in installer create cfg
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/hsqldb.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/hsqldb.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/hsqldb.hibernate.cfg.xml 2009-12-17 09:17:28 UTC (rev 5975)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.format_sql">true</property>
+ <property name="current_session_context_class">thread</property>
+ <!-- property name="hibernate.transaction.factory_class">org.springframework.orm.hibernate3.SpringTransactionFactory</property -->
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/hsqldb.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/hsqldb.inmem.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/hsqldb.inmem.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/hsqldb.inmem.hibernate.cfg.xml 2009-12-17 09:17:28 UTC (rev 5975)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="current_session_context_class">thread</property>
+ <!-- property name="hibernate.transaction.factory_class">org.springframework.orm.hibernate3.SpringTransactionFactory</property -->
+ <property name="hibernate.format_sql">true</property>
+
+ <property name="hibernate.hbm2ddl.auto">create-drop</property>
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/hsqldb.inmem.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/mysql.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/mysql.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/mysql.hibernate.cfg.xml 2009-12-17 09:17:28 UTC (rev 5975)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
+ <property name="current_session_context_class">thread</property>
+ <!-- property name="hibernate.transaction.factory_class">org.springframework.orm.hibernate3.SpringTransactionFactory</property -->
+ <property name="hibernate.format_sql">true</property>
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/mysql.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/oracle.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/oracle.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/oracle.hibernate.cfg.xml 2009-12-17 09:17:28 UTC (rev 5975)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
+ <property name="current_session_context_class">thread</property>
+ <!-- property name="hibernate.transaction.factory_class">org.springframework.orm.hibernate3.SpringTransactionFactory</property -->
+ <property name="hibernate.format_sql">true</property>
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/oracle.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/postgresql.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/postgresql.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/postgresql.hibernate.cfg.xml 2009-12-17 09:17:28 UTC (rev 5975)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+ <property name="current_session_context_class">thread</property>
+ <!-- property name="hibernate.transaction.factory_class">org.springframework.orm.hibernate3.SpringTransactionFactory</property -->
+ <property name="hibernate.format_sql">true</property>
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/postgresql.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/sybase.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/sybase.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/sybase.hibernate.cfg.xml 2009-12-17 09:17:28 UTC (rev 5975)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.SybaseDialect</property>
+ <property name="current_session_context_class">thread</property>
+ <!-- property name="hibernate.transaction.factory_class">org.springframework.orm.hibernate3.SpringTransactionFactory</property -->
+ <property name="hibernate.format_sql">true</property>
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/hibernate/spring/sybase.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/examples/pom.xml
===================================================================
--- jbpm4/trunk/modules/examples/pom.xml 2009-12-16 23:34:58 UTC (rev 5974)
+++ jbpm4/trunk/modules/examples/pom.xml 2009-12-17 09:17:28 UTC (rev 5975)
@@ -171,6 +171,7 @@
<tasks>
<ant antfile="../distro/src/main/files/install/build.xml" target="create.cfg">
<property name="tx" value="spring.testsuite" />
+ <property name="hibernate.connection.type" value="spring" />
<property name="database" value="hsqldb.inmem" />
<property name="mail.cfg" value="testsuite" />
<property name="cfg.dest.dir" value="target/test-classes" />
Modified: jbpm4/trunk/modules/examples/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/logging.properties 2009-12-16 23:34:58 UTC (rev 5974)
+++ jbpm4/trunk/modules/examples/src/test/resources/logging.properties 2009-12-17 09:17:28 UTC (rev 5975)
@@ -1,7 +1,7 @@
handlers= java.util.logging.ConsoleHandler
redirect.commons.logging = enabled
-java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter = org.jbpm.internal.log.LogFormatter
org.jbpm.level=FINE
@@ -12,7 +12,7 @@
org.hibernate.level=INFO
org.hibernate.cfg.SettingsFactory.level=SEVERE
org.hibernate.cfg.HbmBinder.level=SEVERE
-# org.hibernate.SQL.level=FINEST
-# org.hibernate.type.level=FINEST
+org.hibernate.SQL.level=FINEST
+org.hibernate.type.level=FINEST
# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
# org.hibernate.transaction.level=FINEST
\ No newline at end of file
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java 2009-12-16 23:34:58 UTC (rev 5974)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java 2009-12-17 09:17:28 UTC (rev 5975)
@@ -47,7 +47,6 @@
// find current task
EnvironmentImpl environment = EnvironmentImpl.getCurrent();
DbSession dbSession = environment.get(DbSession.class);
- dbSession.flush();
TaskImpl task = dbSession.findTaskByExecution(execution);
// make task available to mail templates through task context
16 years, 4 months
JBoss JBPM SVN: r5974 - in jbpm4/trunk/modules: bpmn/src/main/java/org/jbpm/bpmn/flownodes and 8 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-12-16 18:34:58 -0500 (Wed, 16 Dec 2009)
New Revision: 5974
Added:
jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.exclusive.gateway.png
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/gateway/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/gateway/exclusive/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/gateway/exclusive/ExclusiveGatewayTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/gateway/exclusive/ExclusiveGatewayWithDefaultSequenceFlowTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/exclusive/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway.bpmn.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway_default_seq_flow.bpmn.xml
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstance.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayActivity.java
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
Log:
JBPM-2661: BPMN 2.0 exclusive gateway
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstance.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstance.java 2009-12-16 20:46:03 UTC (rev 5973)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstance.java 2009-12-16 23:34:58 UTC (rev 5974)
@@ -69,4 +69,8 @@
/** duration of the process instance in milliseconds or null
* if the process instance has not yet ended */
Long getDuration();
+
+ /** Returns the name of the end state that was reached when the process was ended.
+ */
+ String getEndActivityName();
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java 2009-12-16 20:46:03 UTC (rev 5973)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java 2009-12-16 23:34:58 UTC (rev 5974)
@@ -58,7 +58,9 @@
* Code copied basically from jPDL fork.
*/
protected void proceed(ExecutionImpl execution, List<Transition> transitions) {
- log.debug("Proceeding");
+ if (log.isDebugEnabled()) {
+ log.debug("Proceeding from execution " + execution.getActivityName());
+ }
Activity activity = execution.getActivity();
@@ -115,7 +117,9 @@
forkingTransitions.add(transition);
}
}
- log.debug(forkingTransitions.size() + " out of " + outgoingTransitions.size() + " selected for " + activity.getName());
+ if (log.isDebugEnabled()) {
+ log.debug(forkingTransitions.size() + " out of " + outgoingTransitions.size() + " selected for " + activity.getName());
+ }
return forkingTransitions;
}
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayActivity.java 2009-12-16 20:46:03 UTC (rev 5973)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayActivity.java 2009-12-16 23:34:58 UTC (rev 5974)
@@ -27,8 +27,6 @@
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.bpmn.parser.BindingsParser;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.model.Activity;
-import org.jbpm.pvm.internal.model.Condition;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.Transition;
@@ -63,11 +61,19 @@
}
} else if (numTransitions > 2) {
transitions = transitions.subList(0, 0);
- log.info("More than one outgoing sequenceFlow conditions evaluated to true for " + execution.getActivity() + ", taking the first one ("
- + transitions.get(0).getName() + ")");
+ if (log.isInfoEnabled()) {
+ log.info("More than one outgoing sequenceFlow conditions evaluated to true for "
+ + execution.getActivity() + ", taking the first one ("
+ + transitions.get(0).getName() + ")");
+ }
}
-
- // 1 condition evaluated to true...
+
+ // We are now sure we have only one transition as result
+ Transition resultingTransition = transitions.get(0);
+ if (resultingTransition.getName() != null) {
+ execution.historyDecision(resultingTransition.getName());
+ }
+
proceed(execution, transitions);
}
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.exclusive.gateway.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.exclusive.gateway.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml 2009-12-16 20:46:03 UTC (rev 5973)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml 2009-12-16 23:34:58 UTC (rev 5974)
@@ -138,7 +138,7 @@
<section id="gettingStartedWithBpmn2" >
- <title>Getting started with BPMN 2.0</title>
+ <title>Getting started</title>
<para>
@@ -178,127 +178,134 @@
</itemizedlist>
</para>
- <section id="bpmn2Config">
+ </section>
- <title>Configuration</title>
+ <section id="bpmn2Config">
+
+ <title>Configuration</title>
- <para>
- Enabling BPMN 2.0 in your application is extremely simple: just add the following line
- to the <emphasis role="bold">jbpm.cfg.xml</emphasis> file.
- <programlisting>
+ <para>
+ Enabling BPMN 2.0 in your application is extremely simple: just add the following line
+ to the <emphasis role="bold">jbpm.cfg.xml</emphasis> file.
+ <programlisting>
<import resource="jbpm.bpmn.cfg.xml" />
- </programlisting>
- This import will enable BPMN 2.0 process deployment by installing a BPMN 2.0 deployer
- in the Process Engine. Do note that a Process Engine can cope with both JPDL and BPMN 2.0
- processes. This means that in your application, some processes can be JPDL and others
- can be BPMN 2.0.
- </para>
+ </programlisting>
+ This import will enable BPMN 2.0 process deployment by installing a BPMN 2.0 deployer
+ in the Process Engine. Do note that a Process Engine can cope with both JPDL and BPMN 2.0
+ processes. This means that in your application, some processes can be JPDL and others
+ can be BPMN 2.0.
+ </para>
- <para>
- <emphasis role="bold">Process definitions are distinguished by the process engine
- based on the extension of the definition file. For BPMN 2.0, use the *.bpmn.xml extension
- (where JPDL is having the *.jpdl.xml extension).</emphasis>
- </para>
+ <para>
+ <emphasis role="bold">Process definitions are distinguished by the process engine
+ based on the extension of the definition file. For BPMN 2.0, use the *.bpmn.xml extension
+ (where JPDL is having the *.jpdl.xml extension).</emphasis>
+ </para>
- </section>
+ </section>
- <section id="bpmn2Examples">
+ <section id="bpmn2Examples">
- <title>Examples</title>
+ <title>Examples</title>
- <para>
- The examples that are shipped with the distribution also contain examples for every
- construct that is discussed in the following sections. Look for example BPMN 2.0
- processes and test cases in the <emphasis role="bold">org.jbpm.examples.bpmn.* package
- </emphasis>.
- </para>
+ <para>
+ The examples that are shipped with the distribution also contain examples for every
+ construct that is discussed in the following sections. Look for example BPMN 2.0
+ processes and test cases in the <emphasis role="bold">org.jbpm.examples.bpmn.* package
+ </emphasis>.
+ </para>
- <para>
- See the userguide, chapter 2 (Installation), for a walktough on how to import the examples.
- Look for the section <emphasis role="bold">'Importing the Examples'</emphasis>.
- </para>
+ <para>
+ See the userguide, chapter 2 (Installation), for a walktough on how to import the examples.
+ Look for the section <emphasis role="bold">'Importing the Examples'</emphasis>.
+ </para>
- </section>
+ </section>
- <section id="basicConstructs">
+ <section id="basicConstructs">
- <title>Basic constructs</title>
+ <title>Basic constructs</title>
- <section id="basicConstructsEvents">
+ <section id="basicConstructsEvents">
- <title>Events</title>
+ <title>Events</title>
- <para>
- Together with activitites and gateways, events are used in practically every business process.
- Events allow process modelers to describe business processes in a very natural way, such as
- <emphasis role="italic">'This process starts when I receive a customer order'</emphasis>,
- <emphasis role="italic">'If the task is not finished in 2 days, terminate the process'</emphasis>
- or <emphasis role="italic">'When I receive a cancel e-mail when the process is running,
- handle the e-mail using this sub-process'</emphasis>. Notice that typical businesses
- always work in a very event-driven way. People are not hard-coded sequential creatures,
- but they tend to react on things that happen in their environment (ie. events).
- In the BPMN specification, a great number of event types are described, to cover the
- range of possible things that might occur in context of a business.
- </para>
+ <para>
+ Together with activitites and gateways, events are used in practically every business process.
+ Events allow process modelers to describe business processes in a very natural way, such as
+ <emphasis role="italic">'This process starts when I receive a customer order'</emphasis>,
+ <emphasis role="italic">'If the task is not finished in 2 days, terminate the process'</emphasis>
+ or <emphasis role="italic">'When I receive a cancel e-mail when the process is running,
+ handle the e-mail using this sub-process'</emphasis>. Notice that typical businesses
+ always work in a very event-driven way. People are not hard-coded sequential creatures,
+ but they tend to react on things that happen in their environment (ie. events).
+ In the BPMN specification, a great number of event types are described, to cover the
+ range of possible things that might occur in context of a business.
+ </para>
+
+ </section>
- <section id="noneStartEvent">
+ <section id="noneStartEvent">
- <title>None start event</title>
+ <title>Event: None start event</title>
- <para>
- A start event indicates the start of process (or a subprocess). Graphically, it is visualized
- as a circle with (possibly) a small icon inside. The icon specifies the actual type of event
- that will trigger the process instance creation.
- </para>
+ <para>
+ A start event indicates the start of process (or a subprocess). Graphically, it is visualized
+ as a circle with (possibly) a small icon inside. The icon specifies the actual type of event
+ that will trigger the process instance creation.
+ </para>
- <para>
- The 'none start event' is drawn as a circle without an icon inside, which means that the
- trigger is unknown or unspecified. The start activity of JPDL basically has the same
- semantics. Process instances whose process definition has a 'none start event' are
- created using the typical API calls on the <emphasis role="bold">executionService</emphasis>.
- </para>
-
- <para>
- A none start event is defined as follows. An id is required, a name is optional.
- <programlisting>
+ <para>
+ The 'none start event' is drawn as a circle without an icon inside, which means that the
+ trigger is unknown or unspecified. The start activity of JPDL basically has the same
+ semantics. Process instances whose process definition has a 'none start event' are
+ created using the typical API calls on the <emphasis role="bold">executionService</emphasis>.
+ </para>
+
+ <para>
+ A none start event is defined as follows. An id is required, a name is optional.
+ <programlisting>
<startEvent id="start" name="myStart" />
- </programlisting>
- </para>
+ </programlisting>
+ </para>
- </section>
-
- <section id="noneEndEvent">
-
- <title>None end event</title>
-
- <para>
- An end event indicates the end of an execution path in a process instance. Graphically,
- it is visualized as a circle with a thick border with (possibly) a small icon inside.
- The icon specifies the type of signal that is thrown when the end is reached.
- </para>
+ </section>
+
+ <section id="noneEndEvent">
+
+ <title>Event: None end event</title>
+
+ <para>
+ An end event indicates the end of an execution path in a process
+ instance. Graphically,
+ it is visualized as a circle with a thick border with (possibly) a
+ small icon inside.
+ The icon specifies the type of signal that is thrown when the end is
+ reached.
+ </para>
- <para>
- The 'none end event' is drawn as a circle with thick border with no icon inside,
- which means that no signal is thrown when the execution reaches the event.
- The end activity in JPDL has the same semantics as the none end event.
- </para>
+ <para>
+ The 'none end event' is drawn as a circle with thick border with no icon inside,
+ which means that no signal is thrown when the execution reaches the event.
+ The end activity in JPDL has the same semantics as the none end event.
+ </para>
- <para>
- A none end event is defined as follows. An id is required, a name is optional.
- <programlisting>
+ <para>
+ A none end event is defined as follows. An id is required, a name is optional.
+ <programlisting>
<endEvent id="end" name="myEnd" />
- </programlisting>
- </para>
+ </programlisting>
+ </para>
- <para>
- The following example shows a process with only a none start and end event:
- <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.none.start.end.event.png"/></imageobject></mediaobject>
- </para>
+ <para>
+ The following example shows a process with only a none start and end event:
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.none.start.end.event.png"/></imageobject></mediaobject>
+ </para>
- <para>
- The corresponding executable XML for this process looks like this (omitting the
- <emphasis role="italic">definitions</emphasis> root element for clarity)
- <programlisting>
+ <para>
+ The corresponding executable XML for this process looks like this (omitting the
+ <emphasis role="italic">definitions</emphasis> root element for clarity)
+ <programlisting>
<process id="noneStartEndEvent" name="BPMN2 Example none start and end event">
<startEvent id="start" />
@@ -309,56 +316,158 @@
<endEvent id="end" name="End" />
</process>
- </programlisting>
- </para>
+ </programlisting>
+ </para>
- <para>
- A process instances can now be created by calling the
- <emphasis role="bold">startProcessInstanceXXX</emphasis> operations.
- <programlisting>
+ <para>
+ A process instances can now be created by calling the
+ <emphasis role="bold">startProcessInstanceXXX</emphasis> operations.
+ <programlisting>
ProcessInstance processInstance = executionService.startProcessInstanceByKey("noneStartEndEvent");
- </programlisting>
- </para>
+ </programlisting>
+ </para>
- </section>
+ </section>
- <section id="terminateEndEvent">
+ <section id="terminateEndEvent">
- <title>Terminate end event</title>
+ <title>Event: Terminate end event</title>
- <para>
- The difference between a 'terminate' and a <link linkend="noneEndEvent">'none' end event</link>
- lies in the fact how a path of execution is treated (or a 'token' in BPMN 2.0 terminology).
- The 'terminate' end event will end the complete process instance, whereas the 'none'
- end event will only end the current path of execution. They both don't throw anything
- when the end event is reached.
- </para>
+ <para>
+ The difference between a 'terminate' and a <link linkend="noneEndEvent">'none' end event</link>
+ lies in the fact how a path of execution is treated (or a 'token' in BPMN 2.0 terminology).
+ The 'terminate' end event will end the complete process instance, whereas the 'none'
+ end event will only end the current path of execution. They both don't throw anything
+ when the end event is reached.
+ </para>
- <para>
- A terminate end event is defined as follows. An id is required, a name is optional.
- <programlisting>
+ <para>
+ A terminate end event is defined as follows. An id is required, a name is optional.
+ <programlisting>
<endEvent id="terminateEnd" name="myTerminateEnd">
<terminateEventDefinition/>
</endEvent>
- </programlisting>
- </para>
+ </programlisting>
+ </para>
- <para>
- A terminate end event is depicted as a typical end event (circle with thick border),
- with a full circle as icon inside. In the following example, completing the 'task1'
- will end the process instance, while completing the 'task2' will only end the path
- of execution which enters the end event.
- <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.terminate.end.event.example.png"/></imageobject></mediaobject>
- See the examples shipped with the jBPM distribution for the unit test and XML counterpart
- of this business process.
- </para>
+ <para>
+ A terminate end event is depicted as a typical end event (circle with thick border),
+ with a full circle as icon inside. In the following example, completing the 'task1'
+ will end the process instance, while completing the 'task2' will only end the path
+ of execution which enters the end event.
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.terminate.end.event.example.png"/></imageobject></mediaobject>
+ See the examples shipped with the jBPM distribution for the unit test and XML counterpart
+ of this business process.
+ </para>
- </section>
+ </section>
+
+ <section id="gateway">
+
+ <title>Gateways</title>
+
+ <para>
+ A gateway in BPMN is used to control the flow through the process. More specifically,
+ when a token (the BPMN 2.0 conceptual notion of an execution) arrives in a gateway, they can be merged
+ or split depending on the gateway type.
+ </para>
- </section> <!-- End of basic events section -->
+ <para>
+ Gateways are depicted as a diamond shape, with an icon inside specifying the type
+ (exclusive, inclusive, etc.).
+ </para>
- </section> <!-- End of basic constructs section -->
+ </section>
+
+ <section id="exclusiveGateway">
+
+ <title>Gateway: Exclusive Gateway</title>
+
+ <para>
+ An exclusive gateway represents an <emphasis role="bold">exclusive decision</emphasis>
+ in the process. Exactly one outgoing sequence flow will be taken, depending on the conditions
+ defined on the sequence flows.
+ </para>
+
+ <para>
+ The corresponding JPDL construct with the same semantics is the
+ <emphasis role="bold"><decision></emphasis> activity. The full technical name of the
+ exclusive gateway is the <emphasis role="bold">'exclusive data-based gateway'</emphasis>,
+ but it is also often called the <emphasis role="bold">XOR Gateway</emphasis>.
+ The XOR gateway is depicted as a diamond with a plus icon inside. An empty diamond
+ without a gateway also signifies an exclusive gateway.
+ </para>
+
+ <para>
+ The following diagram shows the usage of an exclusive gateway: depending on the value of the
+ amount variable, one of the three outgoing sequence flows out of the exclusive gateway
+ is chosen.
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.exclusive.gateway.png"/></imageobject></mediaobject>
+ The corresponding executable XML of this process looks as follows.
+ Note that the conditions are defined on the sequence flows. The exclusive gateway will select
+ the single sequence flow for which its condition evaluates to true. If multiple conditions
+ evaluate to true, the first one encountered will be taken (a log message will indicate
+ this situation).
+ <programlisting>
+ <process id="exclusiveGateway" name="BPMN2 Example exclusive gateway">
+
+ <startEvent id="start" />
+
+ <sequenceFlow id="flow1" name="fromStartToExclusiveGateway"
+ sourceRef="start" targetRef="decideBasedOnAmountGateway" />
+
+ <exclusiveGateway id="decideBasedOnAmountGateway" name="decideBasedOnAmount" />
+
+ <sequenceFlow id="flow2" name="fromGatewayToEndNotEnough"
+ sourceRef="decideBasedOnAmountGateway" targetRef="endNotEnough">
+ <conditionExpression xsi:type="tFormalExpression">${amount < 100}</conditionExpression>
+ </sequenceFlow>
+
+ <sequenceFlow id="flow3" name="fromGatewayToEnEnough"
+ sourceRef="decideBasedOnAmountGateway" targetRef="endEnough">
+ <conditionExpression xsi:type="tFormalExpression">${amount <= 500 && amount >= 100}</conditionExpression>
+ </sequenceFlow>
+
+ <sequenceFlow id="flow4" name="fromGatewayToMoreThanEnough"
+ sourceRef="decideBasedOnAmountGateway" targetRef="endMoreThanEnough">
+ <conditionExpression xsi:type="tFormalExpression">${amount > 500}</conditionExpression>
+ </sequenceFlow>
+
+ <endEvent id="endNotEnough" name="not enough" />
+
+ <endEvent id="endEnough" name="enough" />
+
+ <endEvent id="endMoreThanEnough" name="more than enough" />
+
+ </process>
+ </programlisting>
+ This process needs a variable such that the expression can be evauluated at runtime.
+ Variables can be provided when starting the process instance (similar to JPDL):
+ <programlisting>
+Map<String, Object> vars = new HashMap<String, Object>();
+vars.put("amount", amount);
+ProcessInstance processInstance = executionService.startProcessInstanceByKey("exclusiveGateway", vars);
+ </programlisting>
+ </para>
+
+ <para>
+ The exclusive gateway requires that all outgoing sequence flows have conditions defined
+ on them. An exception to this rule is the default sequence flow, as defined above.
+ The exclusive gateway also has a shortcut attribute to define such a default sequence flow.
+ Use the <emphasis role="bold">default attribute</emphasis> to reference an existing
+ <emphasis role="bold">id of a sequence flow</emphasis>. This sequence flow will be taken
+ when the conditions on the other outgoing sequence flows all evaluate to false.
+ <programlisting>
+<exclusiveGateway id="decision" name="decideBasedOnAmountAndBankType" default="myFlow"/>
+
+<sequenceFlow id="myFlow" name="fromGatewayToStandard"
+ sourceRef="decision" targetRef="standard">
+</sequenceFlow>
+ </programlisting>
+ </para>
+
+ </section>
- </section> <!-- End of Bpmn 2.0 execution section -->
+ </section> <!-- End of basic constructs section -->
</chapter>
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/gateway/exclusive/ExclusiveGatewayTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/gateway/exclusive/ExclusiveGatewayTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/gateway/exclusive/ExclusiveGatewayTest.java 2009-12-16 23:34:58 UTC (rev 5974)
@@ -0,0 +1,72 @@
+/*
+ * 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.examples.bpmn.gateway.exclusive;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ *
+ * @author Joram Barrez
+ */
+public class ExclusiveGatewayTest extends JbpmTestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway.bpmn.xml");
+ registerDeployment(deployment.deploy());
+ }
+
+ public void testWithAmountLowerThan100() {
+ startAndVerifyProcess(44, "endNotEnough");
+ }
+
+ public void testWithAmountBetween100And500() {
+ startAndVerifyProcess(124, "endEnough");
+ }
+
+ public void testWithAmountMoreThan500() {
+ startAndVerifyProcess(1000, "endMoreThanEnough");
+ }
+
+ private void startAndVerifyProcess(int amount, String endId) {
+ Map<String, Object> vars = new HashMap<String, Object>();
+ vars.put("amount", amount);
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("exclusiveGateway", vars);
+ assertProcessInstanceEnded(processInstance);
+
+ HistoryProcessInstance historyProcessInstance =
+ historyService.createHistoryProcessInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .uniqueResult();
+ assertEquals(endId, historyProcessInstance.getEndActivityName());
+ }
+
+}
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/gateway/exclusive/ExclusiveGatewayWithDefaultSequenceFlowTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/gateway/exclusive/ExclusiveGatewayWithDefaultSequenceFlowTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/gateway/exclusive/ExclusiveGatewayWithDefaultSequenceFlowTest.java 2009-12-16 23:34:58 UTC (rev 5974)
@@ -0,0 +1,74 @@
+/*
+ * 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.examples.bpmn.gateway.exclusive;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ *
+ * @author Joram Barrez
+ */
+public class ExclusiveGatewayWithDefaultSequenceFlowTest extends JbpmTestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway_default_seq_flow.bpmn.xml");
+ registerDeployment(deployment.deploy());
+ }
+
+ public void testWithLargeDeposit() {
+ startAndVerifyProcess(9999, "localBank", "largeDeposit");
+ }
+
+ public void testWithForeignBankt() {
+ startAndVerifyProcess(9999, "foreign", "foreignBank");
+ }
+
+ public void testDefaultSequenceFlow() {
+ startAndVerifyProcess(1, "local", "standard");
+ }
+
+ private void startAndVerifyProcess(int amount, String bankType, String endId) {
+ Map<String, Object> vars = new HashMap<String, Object>();
+ vars.put("amount", amount);
+ vars.put("bankType", bankType);
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("exclusiveGatewayDefaultSeqFlow", vars);
+ assertProcessInstanceEnded(processInstance);
+
+ HistoryProcessInstance historyProcessInstance =
+ historyService.createHistoryProcessInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .uniqueResult();
+ assertEquals(endId, historyProcessInstance.getEndActivityName());
+ }
+
+
+}
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway.bpmn.xml 2009-12-16 23:34:58 UTC (rev 5974)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../../../../../bpmn/src/main/resources/BPMN20.xsd"
+ xmlns="http://schema.omg.org/spec/BPMN/2.0"
+ typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath"
+ targetNamespace="http://jbpm.org/example/bpmn2/exclusive_gateway"
+ xmlns:jbpm="http://jbpm.org/bpmn2">
+
+ <process id="exclusiveGateway" name="BPMN2 Example exclusive gateway">
+
+ <startEvent id="start" />
+
+ <sequenceFlow id="flow1" name="fromStartToExclusiveGateway"
+ sourceRef="start" targetRef="decideBasedOnAmountGateway" />
+
+ <exclusiveGateway id="decideBasedOnAmountGateway" name="decideBasedOnAmount" />
+
+ <sequenceFlow id="flow2" name="fromGatewayToEndNotEnough"
+ sourceRef="decideBasedOnAmountGateway" targetRef="endNotEnough">
+ <conditionExpression xsi:type="tFormalExpression">${amount < 100}</conditionExpression>
+ </sequenceFlow>
+
+ <sequenceFlow id="flow3" name="fromGatewayToEnEnough"
+ sourceRef="decideBasedOnAmountGateway" targetRef="endEnough">
+ <conditionExpression xsi:type="tFormalExpression">${amount <= 500 && amount >= 100}</conditionExpression>
+ </sequenceFlow>
+
+ <sequenceFlow id="flow4" name="fromGatewayToMoreThanEnough"
+ sourceRef="decideBasedOnAmountGateway" targetRef="endMoreThanEnough">
+ <conditionExpression xsi:type="tFormalExpression">${amount > 500}</conditionExpression>
+ </sequenceFlow>
+
+ <endEvent id="endNotEnough" name="not enough" />
+
+ <endEvent id="endEnough" name="enough" />
+
+ <endEvent id="endMoreThanEnough" name="more than enough" />
+
+ </process>
+
+</definitions>
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway_default_seq_flow.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway_default_seq_flow.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway_default_seq_flow.bpmn.xml 2009-12-16 23:34:58 UTC (rev 5974)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../../../../../bpmn/src/main/resources/BPMN20.xsd"
+ xmlns="http://schema.omg.org/spec/BPMN/2.0"
+ typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath"
+ targetNamespace="http://jbpm.org/example/bpmn2/exclusive_gateway"
+ xmlns:jbpm="http://jbpm.org/bpmn2">
+
+ <process id="exclusiveGatewayDefaultSeqFlow" name="BPMN2 Example exclusive gateway with a default sequence flow">
+
+ <startEvent id="start" />
+
+ <sequenceFlow id="flow1" name="fromStartToExclusiveGateway"
+ sourceRef="start" targetRef="decision" />
+
+ <exclusiveGateway id="decision" name="decideBasedOnAmountAndBankType" default="flow2"/>
+
+ <sequenceFlow id="flow2" name="fromGatewayToStandard"
+ sourceRef="decision" targetRef="standard">
+ </sequenceFlow>
+
+ <sequenceFlow id="flow3" name="fromGatewayToEnEnough"
+ sourceRef="decision" targetRef="largeDeposit">
+ <conditionExpression xsi:type="tFormalExpression">${amount >= 500 && bankType != 'foreign'}</conditionExpression>
+ </sequenceFlow>
+
+ <sequenceFlow id="flow4" name="fromGatewayToMoreThanEnough"
+ sourceRef="decision" targetRef="foreignBank">
+ <conditionExpression xsi:type="tFormalExpression">${bankType == 'foreign'}</conditionExpression>
+ </sequenceFlow>
+
+ <endEvent id="standard" name="standard end" />
+
+ <endEvent id="largeDeposit" name="large deposit" />
+
+ <endEvent id="foreignBank" name="foreign bank" />
+
+ </process>
+
+</definitions>
16 years, 4 months
JBoss JBPM SVN: r5973 - in jbpm4/trunk/modules/pvm: src/main/java/org/jbpm/pvm/internal/tx and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-16 15:46:03 -0500 (Wed, 16 Dec 2009)
New Revision: 5973
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionFactory.java
Modified:
jbpm4/trunk/modules/pvm/pom.xml
Log:
JBPM-2631 spring transactions. added spring transaction factory (not used yet)
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2009-12-16 16:30:02 UTC (rev 5972)
+++ jbpm4/trunk/modules/pvm/pom.xml 2009-12-16 20:46:03 UTC (rev 5973)
@@ -132,6 +132,10 @@
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionFactory.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionFactory.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionFactory.java 2009-12-16 20:46:03 UTC (rev 5973)
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2002-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jbpm.pvm.internal.tx;
+
+import java.util.Properties;
+
+import org.hibernate.ConnectionReleaseMode;
+import org.hibernate.Transaction;
+import org.hibernate.jdbc.JDBCContext;
+import org.hibernate.transaction.JDBCTransaction;
+import org.hibernate.transaction.TransactionFactory;
+
+import org.springframework.transaction.support.TransactionSynchronizationManager;
+
+/**
+ * Spring-aware implementation of the Hibernate TransactionFactory interface, aware of
+ * Spring-synchronized transactions (in particular Spring-managed JTA transactions)
+ * and asking for default release mode ON_CLOSE. Otherwise identical to Hibernate's
+ * default {@link org.hibernate.transaction.JDBCTransactionFactory} implementation.
+ *
+ * @author Juergen Hoeller
+ * @since 2.5.4
+ * @see org.springframework.transaction.support.TransactionSynchronizationManager
+ * @see org.hibernate.transaction.JDBCTransactionFactory
+ */
+public class SpringTransactionFactory implements TransactionFactory {
+
+ /**
+ * Sets connection release mode "on_close" as default.
+ * <p>This was the case for Hibernate 3.0; Hibernate 3.1 changed
+ * it to "auto" (i.e. "after_statement" or "after_transaction").
+ * However, for Spring's resource management (in particular for
+ * HibernateTransactionManager), "on_close" is the better default.
+ */
+ public ConnectionReleaseMode getDefaultReleaseMode() {
+ return ConnectionReleaseMode.ON_CLOSE;
+ }
+
+ public Transaction createTransaction(JDBCContext jdbcContext, Context transactionContext) {
+ return new JDBCTransaction(jdbcContext, transactionContext);
+ }
+
+ public void configure(Properties props) {
+ }
+
+ public boolean isTransactionManagerRequired() {
+ return false;
+ }
+
+ public boolean areCallbacksLocalToHibernateTransactions() {
+ return true;
+ }
+
+ public boolean isTransactionInProgress(
+ JDBCContext jdbcContext, Context transactionContext, Transaction transaction) {
+
+ return (transaction != null && transaction.isActive()) ||
+ TransactionSynchronizationManager.isActualTransactionActive();
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 4 months
JBoss JBPM SVN: r5972 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/wire/binding and 1 other directory.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-12-16 11:30:02 -0500 (Wed, 16 Dec 2009)
New Revision: 5972
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java
Log:
JMS Activity and Binding: JMS MapMessage
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java 2009-12-16 15:56:39 UTC (rev 5971)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java 2009-12-16 16:30:02 UTC (rev 5972)
@@ -23,7 +23,9 @@
import org.jbpm.jpdl.internal.xml.JpdlParser;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.descriptor.MapDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Binding;
import org.jbpm.pvm.internal.xml.Parse;
import org.w3c.dom.Element;
@@ -71,16 +73,11 @@
Element mapElement = XmlUtil.element(element, "map", false, parse);
if (mapElement != null) {
- Binding binding = parser.getBinding(mapElement);
- if (binding != null) {
- System.out.println("Goddam f*ck!!!");
- }
- jmsActivity.setType("map");
- Object object = binding.parse(mapElement, parse, parser);
- if (object instanceof MapDescriptor) {
- jmsActivity.setMapDescriptor((MapDescriptor)object);
+ Descriptor descriptor = parser.parseObjectDescriptor(mapElement, parse);
+ if (descriptor instanceof MapDescriptor) {
+ jmsActivity.setMapDescriptor((MapDescriptor)descriptor);
} else {
- parse.addProblem("parsed object is not instanceof MapDescriptor", mapElement);
+ System.out.println("descriptor is not of class MadDescriptor");
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java 2009-12-16 15:56:39 UTC (rev 5971)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java 2009-12-16 16:30:02 UTC (rev 5972)
@@ -65,32 +65,12 @@
if ("entry".equals(XmlUtil.getTagLocalName(entryElement))) {
// key
Element keyElement = XmlUtil.element(entryElement, "key");
- if (keyElement != null) {
- System.out.println("found keyElement");
- }
Element keyDescriptorElement = (keyElement!=null ? XmlUtil.element(keyElement) : null);
- if (keyDescriptorElement != null) {
- System.out.println("found keyDescriptorElement");
- System.out.println(" element: " + keyDescriptorElement.getNodeName());
- }
Descriptor keyDescriptor = (Descriptor) parser.parseElement(keyDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
- if (keyDescriptor != null) {
- System.out.println("found keyDescriptor");
- }
// value
Element valueElement = XmlUtil.element(entryElement, "value");
- if (valueElement != null) {
- System.out.println("found valueElement");
- }
Element valueDescriptorElement = (valueElement!=null ? XmlUtil.element(valueElement) : null);
- if (valueDescriptorElement != null) {
- System.out.println("found valueDescriptorElement");
- System.out.println(" element: " + valueDescriptorElement.getNodeName());
- }
Descriptor valueDescriptor = (Descriptor) parser.parseElement(valueDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
- if (valueDescriptor != null) {
- System.out.println("found valueDescriptor");
- }
if ( (keyDescriptor!=null)
&& (valueDescriptor!=null)
16 years, 4 months
JBoss JBPM SVN: r5971 - jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-16 10:56:39 -0500 (Wed, 16 Dec 2009)
New Revision: 5971
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java
Log:
JBPM-2631 spring transactions. weird flush needed to be added. no idea why this problem only shows up in spring while it works on jboss or standalone.
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java 2009-12-16 15:38:57 UTC (rev 5970)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java 2009-12-16 15:56:39 UTC (rev 5971)
@@ -47,6 +47,7 @@
// find current task
EnvironmentImpl environment = EnvironmentImpl.getCurrent();
DbSession dbSession = environment.get(DbSession.class);
+ dbSession.flush();
TaskImpl task = dbSession.findTaskByExecution(execution);
// make task available to mail templates through task context
16 years, 4 months
JBoss JBPM SVN: r5970 - in jbpm4/trunk: modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd and 15 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-16 10:38:57 -0500 (Wed, 16 Dec 2009)
New Revision: 5970
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/AbstractTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObject.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/Transaction.java
jbpm4/trunk/qa/debug.on.jboss.setup.bat
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java
Modified:
jbpm4/trunk/modules/distro/src/main/files/install/build.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionRefBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java
jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/qa/build.xml
Log:
JBPM-2631 spring transactions
Modified: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-12-16 15:38:57 UTC (rev 5970)
@@ -72,17 +72,17 @@
<os name="sunos" />
</or>
</condition>
- <condition property="hsqldb.needed">
- <equals arg1="${database}" arg2="hsqldb" />
- </condition>
+ <condition property="is.hsqldb">
+ <equals arg1="${database}" arg2="hsqldb" />
+ </condition>
<!-- OS CONDITIONS -->
- <condition property="isWindows">
+ <condition property="is.windows">
<os family="windows"/>
</condition>
- <condition property="isNotWindows">
+ <condition property="is.not.windows">
<not>
- <isset property="isWindows" />
+ <isset property="is.windows" />
</not>
</condition>
@@ -143,7 +143,8 @@
description="installs jboss, installs jbpm into jboss, starts jboss, creates the jBPM DB schema, deploys examples, loads example identities, installs and starts eclipse">
<antcall target="internal.enable.jboss.debug.jboss500" />
<antcall target="internal.enable.jboss.debug.jboss510" />
- <antcall target="internal.install.and.start.hsqldb.if.needed" />
+ <antcall target="install.hsqldb.server" />
+ <antcall target="start.hsqldb.server" />
<antcall target="create.jbpm.schema" />
<antcall target="start.jboss" />
<antcall target="install.examples.into.jboss" />
@@ -402,7 +403,8 @@
<target name="demo.setup.tomcat"
depends="delete.tomcat, install.tomcat, install.jbpm.into.tomcat"
description="installs tomcat, installs jbpm into tomcat, starts tomcat, creates the jBPM DB schema, deploys examples, loads example identities, installs and starts eclipse">
- <antcall target="internal.install.and.start.hsqldb.if.needed" />
+ <antcall target="install.hsqldb.server" />
+ <antcall target="start.hsqldb.server" />
<antcall target="create.jbpm.schema" />
<antcall target="install.examples.into.tomcat" />
<antcall target="load.example.identities" />
@@ -413,7 +415,7 @@
<!-- ### DEMO TEARDOWN TOMCAT ################################################ -->
<target name="demo.teardown.tomcat"
- depends="stop.tomcat, internal.stop.hsqldb.server.if.needed"
+ depends="stop.tomcat, stop.hsqldb.server"
description="stops tomcat and then the hsqldb server if needed">
</target>
@@ -557,7 +559,7 @@
</target>
<!-- ### INSTALL HSQLDB SERVER ################################################ -->
- <target name="install.hsqldb.server">
+ <target name="install.hsqldb.server" if="is.hsqldb">
<delete dir="${hsqldb.server.install.dir}" /> <!-- Also deletes old data -->
<mkdir dir="${hsqldb.server.install.dir}"/>
<copy file="${jbpm.home}/lib/hsqldb.jar" todir="${hsqldb.server.install.dir}" />
@@ -572,7 +574,7 @@
</target>
<!-- ### START HSQLDB SERVER ################################################ -->
- <target name="start.hsqldb.server" >
+ <target name="start.hsqldb.server" if="is.hsqldb">
<taskdef name="start-hsqldb-server" classname="org.jbpm.pvm.internal.ant.StartHsqldbServerTask">
<classpath>
<fileset dir="${jbpm.home}">
@@ -584,7 +586,7 @@
</target>
<!-- ### SHUTDOWN HSQLDB SERVER ################################################ -->
- <target name="stop.hsqldb.server">
+ <target name="stop.hsqldb.server" if="is.hsqldb">
<sql driver="${jdbc.driver}"
password="${jdbc.password}"
url="${jdbc.url}"
@@ -772,15 +774,9 @@
<!-- ### INTERNAL TARGETS ### -->
<!-- ######################## -->
- <target name="internal.install.and.start.hsqldb.if.needed" if="hsqldb.needed">
- <antcall target="install.hsqldb.server" />
- <antcall target="start.hsqldb.server" />
- </target>
-
- <target name="internal.stop.hsqldb.server.if.needed" if="hsqldb.needed">
- <antcall target="stop.hsqldb.server" />
- </target>
-
+ <target name="enable.jboss.debug"
+ depends="internal.enable.jboss.debug.jboss500, internal.enable.jboss.debug.jboss510" />
+
<target name="internal.enable.jboss.debug.jboss500" if="is.jboss.500">
<echo message="enabling debug on ${jboss.home}" />
<replace file="${jboss.home}/bin/run.bat"
@@ -853,11 +849,11 @@
<copy file="${signavio.tmp.dir}/${signavio.war.file.name}" todir="${signavio.src.dir}" overwrite="true"/>
</target>
- <target name="internal.install.eclipse.windows" if="isWindows">
+ <target name="internal.install.eclipse.windows" if="is.windows">
<unzip src="${eclipse.distro.dir}/${eclipse.filename}" dest="${jbpm.home}" overwrite="true" />
</target>
- <target name="internal.install.eclipse.non.windows" if="isNotWindows">
+ <target name="internal.install.eclipse.non.windows" if="is.not.windows">
<gunzip src="${eclipse.distro.dir}/${eclipse.filename}" dest="${eclipse.distro.dir}" />
<untar src="${eclipse.distro.dir}/${eclipse.tarfilename}" dest="${jbpm.home}" overwrite="true" />
<delete file="${eclipse.distro.dir}/${eclipse.tarfilename}"/>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -29,10 +29,10 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.JobContext;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.jobexecutor.JobExceptionHandler;
import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.tx.Transaction;
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.env;
-
-import javax.transaction.Synchronization;
-
-
-/** provides access to the transaction in the environment.
- *
- * @author Tom Baeyens
- */
-public interface Transaction {
-
- /** register a transaction listener. This method will have no
- * effect if the transactionListener is null. */
- void registerSynchronization(Synchronization synchronization);
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -30,7 +30,6 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cal.BusinessCalendar;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.id.DbidGenerator;
import org.jbpm.pvm.internal.jobexecutor.JobAddedNotification;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
@@ -38,6 +37,7 @@
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.TimerSession;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.util.Clock;
/** a runtime timer instance.
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -31,9 +31,9 @@
import org.jbpm.api.cmd.Environment;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.tx.Transaction;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -24,9 +24,9 @@
import org.jbpm.api.job.Message;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.MessageSession;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.util.ReflectUtil;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -21,9 +21,9 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.job.Timer;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.session.TimerSession;
+import org.jbpm.pvm.internal.tx.Transaction;
/**
* Timers created with this service are committed at the end of the transaction,
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -31,9 +31,9 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.model.op.MoveToChildActivity;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.wire.Descriptor;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -28,8 +28,8 @@
import org.jbpm.api.cmd.Command;
import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.session.DbSession;
+import org.jbpm.pvm.internal.tx.Transaction;
public class ExceptionHandlerSynchronization implements Synchronization, Command<Object> {
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/AbstractTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/AbstractTransaction.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/AbstractTransaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.tx;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class AbstractTransaction implements Transaction {
+
+ List<DeserializedObject> deserializedObjects = null;
+
+ public void registerDeserializedObject(DeserializedObject deserializedObject) {
+ if (deserializedObjects==null) {
+ deserializedObjects = new ArrayList<DeserializedObject>();
+ }
+ deserializedObjects.add(deserializedObject);
+ }
+
+ public void flushDeserializedObjects() {
+ if (deserializedObjects!=null) {
+ for (DeserializedObject deserializedObject: deserializedObjects) {
+ deserializedObject.flush();
+ }
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/AbstractTransaction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObject.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObject.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObject.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -0,0 +1,67 @@
+/*
+ * 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.tx;
+
+import java.util.Arrays;
+
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter;
+import org.jbpm.pvm.internal.type.variable.BlobVariable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeserializedObject {
+
+ private static final SerializableToBytesConverter serializableToBytesConverter = new SerializableToBytesConverter();
+
+ Object deserializedObject;
+ ScopeInstanceImpl scopeInstance;
+ BlobVariable blobVariable;
+
+ public DeserializedObject(Object deserializedObject, ScopeInstanceImpl scopeInstance, BlobVariable blobVariable) {
+ this.deserializedObject = deserializedObject;
+ this.scopeInstance = scopeInstance;
+ this.blobVariable = blobVariable;
+ }
+
+ public void flush() {
+ String variableName = blobVariable.getKey();
+ Object currentValue = scopeInstance.getVariable(variableName);
+
+ // first check if the deserialized object still is the value for that variable.
+ // a different, new object (of any type) might have been set in the meantime in that key-value-pair
+ if ( (currentValue!=null)
+ && (currentValue==deserializedObject)
+ ) {
+ // next, we check if the serialized object was actually changed or not
+ byte[] newBytes = (byte[]) serializableToBytesConverter.convert(currentValue, null, null);
+ byte[] persistedBytes = blobVariable.getLob().extractBytes();
+ // if it is changed
+ if (!Arrays.equals(persistedBytes, newBytes)) {
+ // then do an automatic update
+ blobVariable.setValue(deserializedObject, scopeInstance);
+ }
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransaction.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -25,14 +25,13 @@
import javax.transaction.Synchronization;
-import org.jbpm.pvm.internal.env.Transaction;
import org.springframework.transaction.support.TransactionSynchronizationManager;
/**
* @author Tom Baeyens
*/
-public class SpringTransaction implements Transaction, Serializable {
+public class SpringTransaction extends AbstractTransaction implements Transaction, Serializable {
private static final long serialVersionUID = 1L;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -57,6 +57,10 @@
try {
returnValue = next.execute(command);
+ EnvironmentImpl
+ .getFromCurrent(SpringTransaction.class)
+ .flushDeserializedObjects();
+
completedSuccessfully = true;
} finally {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -28,7 +28,6 @@
import javax.transaction.Synchronization;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Transaction;
/** simple 2 phase commit transaction.
@@ -36,7 +35,7 @@
* non thread safe (which is ok).
* @author Tom Baeyens
*/
-public class StandardTransaction implements Transaction, Serializable {
+public class StandardTransaction extends AbstractTransaction implements Transaction, Serializable {
private static final long serialVersionUID = 1L;
private static Log log = Log.getLog(StandardTransaction.class.getName());
@@ -89,6 +88,8 @@
/** implements simplest two phase commit. */
public void commit() {
+ flushDeserializedObjects();
+
if (state!=State.ACTIVE) {
throw new TransactionException("commit on transaction in state "+state);
}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/Transaction.java (from rev 5967, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/Transaction.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/Transaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -0,0 +1,40 @@
+/*
+ * 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.tx;
+
+import javax.transaction.Synchronization;
+
+
+
+/** provides access to the transaction in the environment.
+ *
+ * @author Tom Baeyens
+ */
+public interface Transaction {
+
+ /** register a transaction listener. This method will have no
+ * effect if the transactionListener is null. */
+ void registerSynchronization(Synchronization synchronization);
+
+ /** for auto update of deserialized objects */
+ void registerDeserializedObject(DeserializedObject deserializedObject);
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/Transaction.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -30,16 +30,14 @@
import org.jbpm.api.JbpmException;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Transaction;
-import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
-import org.jbpm.pvm.internal.tx.FlushDeserializedObject;
-import org.jbpm.pvm.internal.type.Variable;
+import org.jbpm.pvm.internal.tx.AbstractTransaction;
+import org.jbpm.pvm.internal.tx.Transaction;
/**
* @author Tom Baeyens
*/
-public class JtaTransaction implements Transaction {
+public class JtaTransaction extends AbstractTransaction implements Transaction {
private static Log log = Log.getLog(JtaTransaction.class.getName());
@@ -91,6 +89,8 @@
public void commit() {
try {
+ flushDeserializedObjects();
+
lookupJeeUserTransaction().commit();
} catch (Exception e) {
throw new JbpmException("couldn't commit: "+e.getMessage(), e);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -30,11 +30,13 @@
import org.jbpm.api.JbpmException;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.tx.DeserializedObject;
import org.jbpm.pvm.internal.tx.FlushDeserializedObject;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.type.Converter;
import org.jbpm.pvm.internal.type.Variable;
+import org.jbpm.pvm.internal.type.variable.BlobVariable;
public class SerializableToBytesConverter implements Converter {
@@ -69,7 +71,7 @@
Transaction transaction = EnvironmentImpl.getFromCurrent(Transaction.class, false);
if (transaction!=null) {
- transaction.registerSynchronization(new FlushDeserializedObject(object, scopeInstance, variable));
+ transaction.registerDeserializedObject(new DeserializedObject(object, scopeInstance, (BlobVariable) variable));
}
return object;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -21,9 +21,9 @@
*/
package org.jbpm.pvm.internal.wire.binding;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.tx.SpringTransaction;
import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.tx.jta.JtaTransaction;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionRefBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionRefBinding.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionRefBinding.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.wire.binding;
-import org.jbpm.pvm.internal.env.Transaction;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.wire.descriptor.TransactionRefDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.wire.descriptor;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.wire.WireContext;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -1,9 +1,9 @@
package org.jbpm.pvm.internal.wire.operation;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.tx.StandardResource;
import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireException;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -4,7 +4,6 @@
import java.util.List;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireException;
import org.jbpm.pvm.internal.wire.WireTestCase;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -31,9 +31,9 @@
import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
+import org.jbpm.pvm.internal.tx.Transaction;
import org.jbpm.test.JbpmTestCase;
/**
Modified: jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java
===================================================================
--- jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/test-cactus/src/main/java/org/jbpm/cactustool/CactusTestGenerator.java 2009-12-16 15:38:57 UTC (rev 5970)
@@ -31,12 +31,20 @@
*/
public class CactusTestGenerator {
+ static String testFilter = System.getProperty("test.filter");
+
public static void main(String[] args) {
try {
if (args==null) {
log("syntax: java -cp ... org.jbpm.cactustool.CactusTestGenerator testdestroot testsrcroot1 testsrcroot2 ...");
}
+ if (testFilter!=null) {
+ log("################################################################################################");
+ log("# test.filter: "+testFilter);
+ log("################################################################################################");
+ }
+
String testPackageSourceDir = args[0]+"/org/jbpm/test";
new File(testPackageSourceDir).mkdirs();
@@ -85,7 +93,8 @@
String fileName = file.getName();
if ( file.isFile()
&& fileName.endsWith("Test.java")
- && ! fileName.endsWith("SQLStmtTest.java")
+ && (! fileName.endsWith("SQLStmtTest.java"))
+ && (testFilter==null || (fileName.indexOf(testFilter)!=-1))
) {
String className = packageName + "." + fileName.substring(0, fileName.length()-5)+".class";
log(" adding "+className);
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/modules/test-db/pom.xml 2009-12-16 15:38:57 UTC (rev 5970)
@@ -66,13 +66,13 @@
<artifactId>drools-compiler</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-wiser</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.subethamail</groupId>
- <artifactId>subethasmtp-wiser</artifactId>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
@@ -98,14 +98,6 @@
</execution>
</executions>
</plugin>
-
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <forkMode>never</forkMode> <!-- Without this setting, mvn 2.1.0 doesn't copy command line properties sometimes -->
- </configuration>
- </plugin>
-
</plugins>
</build>
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-12-16 13:55:09 UTC (rev 5969)
+++ jbpm4/trunk/qa/build.xml 2009-12-16 15:38:57 UTC (rev 5970)
@@ -64,7 +64,8 @@
depends="reinstall.jbpm">
<ant antfile="${jbpm.home}/install/build.xml" target="reinstall.tomcat" />
<ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="install.hsqldb.server" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="start.hsqldb.server" />
<ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
<!-- to build the jbpm test webapp we start by copying the user webapp -->
@@ -101,112 +102,43 @@
<target name="testsuite.tomcat.teardown">
<ant antfile="${jbpm.home}/install/build.xml" target="stop.tomcat" />
<ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.stop.hsqldb.server.if.needed" />
- </target>
-
+ <ant antfile="${jbpm.home}/install/build.xml" target="stop.hsqldb.server" />
+ </target>
+
<!-- JBOSS SETUP -->
<target name="testsuite.jboss.setup"
- depends="reinstall.jbpm"
+ depends="jboss.test.setup.base"
description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
- <ant antfile="${jbpm.home}/install/build.xml" target="reinstall.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="install.jbpm.into.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
-
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
+ <!-- start hsqldb -->
+ <ant antfile="${jbpm.home}/install/build.xml" target="start.hsqldb.server" />
<ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
- <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
- <mkdir dir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
- <copy file="${jbpm.home}/examples/target/examples.jar"
- todir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
-
- <!-- to build the jbpm test webapp we start by copying the user webapp -->
- <mkdir dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" />
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war">
- <fileset dir="${jbpm.home}/install/generated/user-webapp"/>
- </copy>
-
- <!-- customize the jbpm configuration for the testsuite -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm/jbpm-service.sar" overwrite="true">
- <fileset dir="jboss.jbpm.cfg" />
- </copy>
-
- <!-- customize the configuration for the jbpm-test-webapp -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" overwrite="true">
- <fileset dir="cactus.webapp.cfg" />
- </copy>
-
- <!-- delete the jbpm configuration files -->
- <delete dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/classes" />
- <delete file="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
-
- <!-- add examples.jar -->
- <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
- <copy file="${jbpm.home}/examples/target/examples.jar" todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
-
- <!-- add junit.jar -->
- <copy file="${jbpm.home}/lib/junit.jar" todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
-
- <!-- add the cactus libs -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib">
- <fileset dir="../modules/test-cactus/target/jbpm.test.webapp.libs" />
- </copy>
-
<!-- start jboss -->
<ant antfile="${jbpm.home}/install/build.xml" target="start.jboss" />
</target>
+ <target name="testsuite.jboss.setup.for.debug"
+ depends="jboss.test.setup.base"
+ description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
+ <!-- start hsqldb -->
+ <ant antfile="${jbpm.home}/install/build.xml" target="start.hsqldb.server" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
+ <!-- enable debug on jboss -->
+ <ant antfile="${jbpm.home}/install/build.xml" target="enable.jboss.debug" />
+ </target>
+
<!-- JBOSS TEARDOWN -->
<target name="testsuite.jboss.teardown"
description="drops the jbpm schema and stops jboss">
<ant antfile="${jbpm.home}/install/build.xml" target="stop.jboss" />
<ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.stop.hsqldb.server.if.needed" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="stop.hsqldb.server" />
</target>
<!-- ENTERPRISE SETUP -->
<target name="testsuite.enterprise.setup"
- depends="reinstall.jbpm"
- description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
- <ant antfile="${jbpm.home}/install/build.xml" target="reinstall.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="install.jbpm.into.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
-
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
- <ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
-
- <!-- to build the jbpm test webapp we start by copying the user webapp -->
- <mkdir dir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war" />
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war">
- <fileset dir="${jbpm.home}/install/generated/user-webapp"/>
- </copy>
-
- <!-- customize the jbpm configuration for the testsuite -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm/jbpm-service.sar" overwrite="true">
- <fileset dir="jboss.jbpm.cfg" />
- </copy>
-
- <!-- customize the configuration for the jbpm-test-webapp -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war" overwrite="true">
- <fileset dir="cactus.webapp.cfg" />
- </copy>
-
- <!-- delete the jbpm configuration files -->
- <delete dir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/classes" />
- <delete file="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
-
- <!-- copy the test classes to the test web app -->
- <copy file="../modules/test-enterprise/test-enterprise-suite/target/jbpm-test-enterprise-suite-${jbpm.version}-tests.jar"
- todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib" />
-
- <!-- add junit.jar -->
- <copy file="${jbpm.home}/lib/junit.jar"
- todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib" />
-
- <!-- add the cactus libs -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib">
- <fileset dir="../modules/test-enterprise/test-enterprise-suite/target/jbpm.test.webapp.libs" />
- </copy>
+ depends="jboss.test.setup.base"
+ description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
<!-- create the test queue -->
<copy file="../modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml"
@@ -218,16 +150,14 @@
<!-- start jboss
<ant antfile="${jbpm.home}/install/build.xml" target="start.jboss" /> -->
-
</target>
-
<!-- ENTERPRISE TEARDOWN -->
<target name="testsuite.enterprise.teardown"
description="drops the jbpm schema and stops jboss">
<ant antfile="${jbpm.home}/install/build.xml" target="stop.jboss" />
<ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.stop.hsqldb.server.if.needed" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="stop.hsqldb.server" />
</target>
@@ -373,6 +303,54 @@
<!-- ### These targets can be called directly ### -->
<!-- ############################################ -->
+ <!-- re-install jbpm and setup jboss for cactus testing -->
+ <target name="jboss.test.setup.base"
+ depends="reinstall.jbpm">
+ <ant antfile="${jbpm.home}/install/build.xml" target="reinstall.jboss" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="install.jbpm.into.jboss" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="install.hsqldb.server" />
+
+ <!-- make the example test classes and test delegation classes available as a user lib
+ <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
+ <mkdir dir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
+ <copy file="${jbpm.home}/examples/target/examples.jar"
+ todir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
+ -->
+
+ <!-- to build the jbpm test webapp we start by copying the user webapp -->
+ <mkdir dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" />
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war">
+ <fileset dir="${jbpm.home}/install/generated/user-webapp"/>
+ </copy>
+
+ <!-- customize the jbpm configuration for the testsuite -->
+ <copy todir="${jboss.home}/server/default/deploy/jbpm/jbpm-service.sar" overwrite="true">
+ <fileset dir="jboss.jbpm.cfg" />
+ </copy>
+
+ <!-- customize the configuration for the jbpm-test-webapp -->
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" overwrite="true">
+ <fileset dir="cactus.webapp.cfg" />
+ </copy>
+
+ <!-- delete the jbpm configuration files -->
+ <delete dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/classes" />
+ <delete file="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
+
+ <!-- add examples.jar -->
+ <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
+ <copy file="${jbpm.home}/examples/target/examples.jar" todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
+
+ <!-- add junit.jar -->
+ <copy file="${jbpm.home}/lib/junit.jar" todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
+
+ <!-- add the cactus libs -->
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib">
+ <fileset dir="../modules/test-cactus/target/jbpm.test.webapp.libs" />
+ </copy>
+ </target>
+
<!-- REINSTALL JBPM -->
<target name="reinstall.jbpm"
description="deletes the jbpm installation and then reinstalls jbpm">
Added: jbpm4/trunk/qa/debug.on.jboss.setup.bat
===================================================================
--- jbpm4/trunk/qa/debug.on.jboss.setup.bat (rev 0)
+++ jbpm4/trunk/qa/debug.on.jboss.setup.bat 2009-12-16 15:38:57 UTC (rev 5970)
@@ -0,0 +1,4 @@
+@echo off
+
+cmd /C mvn -U -Pdistro,integration clean install
+cmd /C ant -f qa/build.xml -Djboss.version=5.1.0.GA testsuite.jboss.setup.for.debug
16 years, 4 months
JBoss JBPM SVN: r5969 - in jbpm4/trunk/modules: devguide/src/main/docbook/en/images and 7 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-12-16 08:55:09 -0500 (Wed, 16 Dec 2009)
New Revision: 5969
Added:
jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.terminate.end.event.example.png
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/terminateend/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/terminateend/TerminateEndTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/terminateend/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/terminateend/terminate_end_event.bpmn.xml
Modified:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/EndBinding.java
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/nonestartend/NoneStartEndEventTest.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
Log:
JBPM-2669: terminate end event
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/EndBinding.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/EndBinding.java 2009-12-16 11:34:19 UTC (rev 5968)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/EndBinding.java 2009-12-16 13:55:09 UTC (rev 5969)
@@ -21,6 +21,7 @@
*/
package org.jbpm.bpmn.flownodes;
+import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -41,6 +42,14 @@
public Object parse(Element element, Parse parse, Parser parser) {
EndActivity endActivity = new EndActivity();
+
+ Element terminateEventDefinition = XmlUtil.element(element, "terminateEventDefinition");
+ if (terminateEventDefinition != null) {
+ endActivity.setEndProcessInstance(true);
+ } else {
+ endActivity.setEndProcessInstance(false); // default is to end execution, not the process instance
+ }
+
return endActivity;
}
}
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.terminate.end.event.example.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.terminate.end.event.example.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml 2009-12-16 11:34:19 UTC (rev 5968)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml 2009-12-16 13:55:09 UTC (rev 5969)
@@ -146,7 +146,7 @@
</section>
- <section id="Bpmn2Constructs" >
+ <section id="Bpmn2Execution" >
<title>Bpmn 2.0 execution</title>
@@ -202,6 +202,24 @@
</section>
+ <section id="bpmn2Examples">
+
+ <title>Examples</title>
+
+ <para>
+ The examples that are shipped with the distribution also contain examples for every
+ construct that is discussed in the following sections. Look for example BPMN 2.0
+ processes and test cases in the <emphasis role="bold">org.jbpm.examples.bpmn.* package
+ </emphasis>.
+ </para>
+
+ <para>
+ See the userguide, chapter 2 (Installation), for a walktough on how to import the examples.
+ Look for the section <emphasis role="bold">'Importing the Examples'</emphasis>.
+ </para>
+
+ </section>
+
<section id="basicConstructs">
<title>Basic constructs</title>
@@ -239,6 +257,13 @@
semantics. Process instances whose process definition has a 'none start event' are
created using the typical API calls on the <emphasis role="bold">executionService</emphasis>.
</para>
+
+ <para>
+ A none start event is defined as follows. An id is required, a name is optional.
+ <programlisting>
+<startEvent id="start" name="myStart" />
+ </programlisting>
+ </para>
</section>
@@ -259,8 +284,15 @@
</para>
<para>
+ A none end event is defined as follows. An id is required, a name is optional.
+ <programlisting>
+<endEvent id="end" name="myEnd" />
+ </programlisting>
+ </para>
+
+ <para>
The following example shows a process with only a none start and end event:
- <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.none.start.end.event.png"/></imageobject></mediaobject>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.none.start.end.event.png"/></imageobject></mediaobject>
</para>
<para>
@@ -289,11 +321,44 @@
</para>
</section>
+
+ <section id="terminateEndEvent">
+
+ <title>Terminate end event</title>
+
+ <para>
+ The difference between a 'terminate' and a <link linkend="noneEndEvent">'none' end event</link>
+ lies in the fact how a path of execution is treated (or a 'token' in BPMN 2.0 terminology).
+ The 'terminate' end event will end the complete process instance, whereas the 'none'
+ end event will only end the current path of execution. They both don't throw anything
+ when the end event is reached.
+ </para>
+
+ <para>
+ A terminate end event is defined as follows. An id is required, a name is optional.
+ <programlisting>
+<endEvent id="terminateEnd" name="myTerminateEnd">
+ <terminateEventDefinition/>
+</endEvent>
+ </programlisting>
+ </para>
+
+ <para>
+ A terminate end event is depicted as a typical end event (circle with thick border),
+ with a full circle as icon inside. In the following example, completing the 'task1'
+ will end the process instance, while completing the 'task2' will only end the path
+ of execution which enters the end event.
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.terminate.end.event.example.png"/></imageobject></mediaobject>
+ See the examples shipped with the jBPM distribution for the unit test and XML counterpart
+ of this business process.
+ </para>
+
+ </section>
- </section>
+ </section> <!-- End of basic events section -->
- </section>
+ </section> <!-- End of basic constructs section -->
- </section>
+ </section> <!-- End of Bpmn 2.0 execution section -->
</chapter>
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/nonestartend/NoneStartEndEventTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/nonestartend/NoneStartEndEventTest.java 2009-12-16 11:34:19 UTC (rev 5968)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/nonestartend/NoneStartEndEventTest.java 2009-12-16 13:55:09 UTC (rev 5969)
@@ -1,3 +1,24 @@
+/*
+ * 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.examples.bpmn.event.nonestartend;
import org.jbpm.api.NewDeployment;
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/terminateend/TerminateEndTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/terminateend/TerminateEndTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/terminateend/TerminateEndTest.java 2009-12-16 13:55:09 UTC (rev 5969)
@@ -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.examples.bpmn.event.terminateend;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ *
+ * @author Joram Barrez
+ */
+public class TerminateEndTest extends JbpmTestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/event/terminateend/terminate_end_event.bpmn.xml");
+ registerDeployment(deployment.deploy());
+ }
+
+ public void testCompleteTask1() {
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("terminateEndEvent");
+ Task task1 = taskService.createTaskQuery().activityName("task1").uniqueResult();
+ taskService.completeTask(task1.getId());
+ assertProcessInstanceEnded(processInstance);
+ }
+
+ public void testCompleteTask2() {
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("terminateEndEvent");
+ Task task2 = taskService.createTaskQuery().activityName("task2").uniqueResult();
+ taskService.completeTask(task2.getId());
+ assertProcessInstanceActive(processInstance);
+
+ // task1 should still be open
+ Task task1 = taskService.createTaskQuery().activityName("task1").uniqueResult();
+ assertNotNull(task2);
+
+ // We can now finish the process
+ taskService.completeTask(task1.getId());
+ assertProcessInstanceEnded(processInstance);
+ }
+
+}
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/terminateend/terminate_end_event.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/terminateend/terminate_end_event.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/terminateend/terminate_end_event.bpmn.xml 2009-12-16 13:55:09 UTC (rev 5969)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../../../../../bpmn/src/main/resources/BPMN20.xsd"
+ xmlns="http://schema.omg.org/spec/BPMN/2.0"
+ typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath"
+ targetNamespace="http://jbpm.org/example/bpmn2/terminate_end_event"
+ xmlns:jbpm="http://jbpm.org/bpmn2">
+
+ <process id="terminateEndEvent" name="BPMN2 Example terminate end event">
+
+ <startEvent id="start" />
+
+ <sequenceFlow id="flow1" name="fromStartToTask1"
+ sourceRef="start" targetRef="task1" />
+
+ <sequenceFlow id="flow2" name="fromStartToTask2"
+ sourceRef="start" targetRef="task2" />
+
+ <userTask id="task1" name="task1" />
+
+ <sequenceFlow id="flow3" name="fromTask1ToTerminateEnd"
+ sourceRef="task1" targetRef="terminateEnd" />
+
+ <endEvent id="terminateEnd" name="terminateEnd">
+ <terminateEventDefinition/>
+ </endEvent>
+
+ <userTask id="task2" name="task2" />
+
+ <sequenceFlow id="flow4" name="fromTask2ToEnd"
+ sourceRef="task2" targetRef="noneEnd" />
+
+ <endEvent id="noneEnd" name="noneEnd" />
+
+ </process>
+
+</definitions>
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-12-16 11:34:19 UTC (rev 5968)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-12-16 13:55:09 UTC (rev 5969)
@@ -217,6 +217,10 @@
assertExecutionEnded(processInstance.getId());
}
+ public void assertProcessInstanceActive(ProcessInstance processInstance) {
+ assertProcessInstanceActive(processInstance.getId());
+ }
+
public void assertProcessInstanceActive(String processInstanceId) {
assertNotNull("Error: an active process instance with id " + processInstanceId + " was not found",
executionService.findProcessInstanceById(processInstanceId));
16 years, 4 months
JBoss JBPM SVN: r5968 - jbpm4/trunk/modules/test-cactus/src/test/java/org/jbpm/test.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-16 06:34:19 -0500 (Wed, 16 Dec 2009)
New Revision: 5968
Modified:
jbpm4/trunk/modules/test-cactus/src/test/java/org/jbpm/test/
Log:
added AllIntegrationTests to svn:ignore
Property changes on: jbpm4/trunk/modules/test-cactus/src/test/java/org/jbpm/test
___________________________________________________________________
Name: svn:ignore
+ AllIntegrationTests.java
16 years, 4 months
JBoss JBPM SVN: r5967 - in jbpm4/trunk/modules: devguide/src/main/docbook/en/images and 7 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-12-16 06:10:08 -0500 (Wed, 16 Dec 2009)
New Revision: 5967
Added:
jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.none.start.end.event.png
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/nonestartend/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/nonestartend/NoneStartEndEventTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/nonestartend/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/nonestartend/none_start_end_event.bpmn.xml
Modified:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
Log:
JBPM-2668: BPMN 2.0 none start/end event
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java 2009-12-16 03:38:49 UTC (rev 5966)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java 2009-12-16 11:10:08 UTC (rev 5967)
@@ -50,7 +50,7 @@
protected static final boolean CONDITIONS_CHECKED = true;
protected static final boolean CONDITIONS_IGNORED = !CONDITIONS_CHECKED;
- protected List<ActivityResource> activvityResources = new ArrayList<ActivityResource>();
+ protected List<ActivityResource> activityResources = new ArrayList<ActivityResource>();
/**
* In BPMN multiple outgoing sequence flows behave like a fork.
@@ -120,7 +120,7 @@
}
public void addActivityResource(ActivityResource activityResource) {
- this.activvityResources.add(activityResource);
+ this.activityResources.add(activityResource);
}
}
\ No newline at end of file
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.none.start.end.event.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.none.start.end.event.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml 2009-12-16 03:38:49 UTC (rev 5966)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml 2009-12-16 11:10:08 UTC (rev 5967)
@@ -53,12 +53,25 @@
The goal of this effort is to build a native BPMN2 runtime engine (or
better said implementing 'BPMN2 exectuable') leveraging the Process
Virtual Machine (PVM).
- </para>
- <para>
Do note that the primary focus of this release is native executability,
not the graphical notation - but we recognize its importance for
further releases.
</para>
+
+ <para>
+ <emphasis role="bold">
+ One of the goals of the BPMN2 implementation is to have an experience and usage which
+ is comparable to the that of JPDL. User who are already familiar with jBPM will find that
+ <itemizedlist>
+ <listitem>the configuration mechanism remains unchanged</listitem>
+ <listitem>the API is the same of very similar to the existing one</listitem>
+ <listitem>testing BPMN2 process still can be done with regular Java testing frameworks</listitem>
+ <listitem>the database schema remains unchanged</listitem>
+ </itemizedlist>
+ </emphasis>
+ So in general, our main goal is to keep everything that was good about jBPM, and enhance
+ it with a standards based process language.
+ </para>
</section>
@@ -135,7 +148,7 @@
<section id="Bpmn2Constructs" >
- <title>Bpmn 2.0 constructs</title>
+ <title>Bpmn 2.0 execution</title>
<para>
The BPMN2 specification defines a very rich language for modeling and
@@ -164,6 +177,122 @@
used in specific and/or rare cases, or their semantics are difficult to understand.</listitem>
</itemizedlist>
</para>
+
+ <section id="bpmn2Config">
+
+ <title>Configuration</title>
+
+ <para>
+ Enabling BPMN 2.0 in your application is extremely simple: just add the following line
+ to the <emphasis role="bold">jbpm.cfg.xml</emphasis> file.
+ <programlisting>
+<import resource="jbpm.bpmn.cfg.xml" />
+ </programlisting>
+ This import will enable BPMN 2.0 process deployment by installing a BPMN 2.0 deployer
+ in the Process Engine. Do note that a Process Engine can cope with both JPDL and BPMN 2.0
+ processes. This means that in your application, some processes can be JPDL and others
+ can be BPMN 2.0.
+ </para>
+
+ <para>
+ <emphasis role="bold">Process definitions are distinguished by the process engine
+ based on the extension of the definition file. For BPMN 2.0, use the *.bpmn.xml extension
+ (where JPDL is having the *.jpdl.xml extension).</emphasis>
+ </para>
+
+ </section>
+
+ <section id="basicConstructs">
+
+ <title>Basic constructs</title>
+
+ <section id="basicConstructsEvents">
+
+ <title>Events</title>
+
+ <para>
+ Together with activitites and gateways, events are used in practically every business process.
+ Events allow process modelers to describe business processes in a very natural way, such as
+ <emphasis role="italic">'This process starts when I receive a customer order'</emphasis>,
+ <emphasis role="italic">'If the task is not finished in 2 days, terminate the process'</emphasis>
+ or <emphasis role="italic">'When I receive a cancel e-mail when the process is running,
+ handle the e-mail using this sub-process'</emphasis>. Notice that typical businesses
+ always work in a very event-driven way. People are not hard-coded sequential creatures,
+ but they tend to react on things that happen in their environment (ie. events).
+ In the BPMN specification, a great number of event types are described, to cover the
+ range of possible things that might occur in context of a business.
+ </para>
+
+ <section id="noneStartEvent">
+
+ <title>None start event</title>
+
+ <para>
+ A start event indicates the start of process (or a subprocess). Graphically, it is visualized
+ as a circle with (possibly) a small icon inside. The icon specifies the actual type of event
+ that will trigger the process instance creation.
+ </para>
+
+ <para>
+ The 'none start event' is drawn as a circle without an icon inside, which means that the
+ trigger is unknown or unspecified. The start activity of JPDL basically has the same
+ semantics. Process instances whose process definition has a 'none start event' are
+ created using the typical API calls on the <emphasis role="bold">executionService</emphasis>.
+ </para>
+
+ </section>
+
+ <section id="noneEndEvent">
+
+ <title>None end event</title>
+
+ <para>
+ An end event indicates the end of an execution path in a process instance. Graphically,
+ it is visualized as a circle with a thick border with (possibly) a small icon inside.
+ The icon specifies the type of signal that is thrown when the end is reached.
+ </para>
+
+ <para>
+ The 'none end event' is drawn as a circle with thick border with no icon inside,
+ which means that no signal is thrown when the execution reaches the event.
+ The end activity in JPDL has the same semantics as the none end event.
+ </para>
+
+ <para>
+ The following example shows a process with only a none start and end event:
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.none.start.end.event.png"/></imageobject></mediaobject>
+ </para>
+
+ <para>
+ The corresponding executable XML for this process looks like this (omitting the
+ <emphasis role="italic">definitions</emphasis> root element for clarity)
+ <programlisting>
+ <process id="noneStartEndEvent" name="BPMN2 Example none start and end event">
+
+ <startEvent id="start" />
+
+ <sequenceFlow id="flow1" name="fromStartToEnd"
+ sourceRef="start" targetRef="end" />
+
+ <endEvent id="end" name="End" />
+
+ </process>
+ </programlisting>
+ </para>
+
+ <para>
+ A process instances can now be created by calling the
+ <emphasis role="bold">startProcessInstanceXXX</emphasis> operations.
+ <programlisting>
+ProcessInstance processInstance = executionService.startProcessInstanceByKey("noneStartEndEvent");
+ </programlisting>
+ </para>
+
+ </section>
+
+ </section>
+
+ </section>
</section>
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/nonestartend/NoneStartEndEventTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/nonestartend/NoneStartEndEventTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/nonestartend/NoneStartEndEventTest.java 2009-12-16 11:10:08 UTC (rev 5967)
@@ -0,0 +1,31 @@
+package org.jbpm.examples.bpmn.event.nonestartend;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ *
+ * @author Joram Barrez
+ */
+public class NoneStartEndEventTest extends JbpmTestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/event/nonestartend/none_start_end_event.bpmn.xml");
+ registerDeployment(deployment.deploy());
+ }
+
+ public void testProcessStartToEnd() {
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("noneStartEndEvent");
+ assertProcessInstanceEnded(processInstance);
+
+ HistoryProcessInstance hip = historyService.createHistoryProcessInstanceQuery().uniqueResult();
+ assertNotNull(hip);
+ }
+
+}
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/nonestartend/none_start_end_event.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/nonestartend/none_start_end_event.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/nonestartend/none_start_end_event.bpmn.xml 2009-12-16 11:10:08 UTC (rev 5967)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../../../../../bpmn/src/main/resources/BPMN20.xsd"
+ xmlns="http://schema.omg.org/spec/BPMN/2.0"
+ typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath"
+ targetNamespace="http://jbpm.org/example/bpmn2/none_start_end_event"
+ xmlns:jbpm="http://jbpm.org/bpmn2">
+
+ <process id="noneStartEndEvent" name="BPMN2 Example none start and end event">
+
+ <startEvent id="start" />
+
+ <sequenceFlow id="flow1" name="fromStartToEnd"
+ sourceRef="start" targetRef="end" />
+
+ <endEvent id="end" name="End" />
+
+ </process>
+
+</definitions>
16 years, 4 months
JBoss JBPM SVN: r5966 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/wire/binding and 8 other directories.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-12-15 22:38:49 -0500 (Tue, 15 Dec 2009)
New Revision: 5966
Added:
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JbpmJmsTestCase.java
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/map/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/map/MapMessageTest.java
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/object/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/object/ObjectMessageTest.java
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/text/TextMessageTest.java
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/map/process.jpdl.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/object/process.jpdl.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/text/process.jpdl.xml
Log:
JMS activity and binding:
- Text Message
- Object Message
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java 2009-12-15 17:36:24 UTC (rev 5965)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java 2009-12-16 03:38:49 UTC (rev 5966)
@@ -21,9 +21,15 @@
*/
package org.jbpm.jpdl.internal.activity;
+import java.io.Serializable;
+import java.util.List;
+
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.JMSException;
+import javax.jms.MapMessage;
+import javax.jms.Message;
+import javax.jms.ObjectMessage;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
@@ -35,92 +41,171 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jbpm.api.JbpmException;
import org.jbpm.api.model.OpenExecution;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.script.ScriptManager;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.WireContext;
+import org.jbpm.pvm.internal.wire.descriptor.MapDescriptor;
-
/**
* @author Koen Aers
*/
-public class JmsActivity extends JpdlAutomaticActivity {
-
+public class JmsActivity extends JpdlAutomaticActivity
+{
+
private static final Log log = Log.getLog(JmsActivity.class.getName());
private static final long serialVersionUID = 1L;
-
+
protected String type = "text";
protected String text = "";
+ protected String expression = "";
+ protected MapDescriptor mapDescriptor = null;
protected String connectionFactoryName = "";
protected String destinationName = "";
- public void perform(OpenExecution execution) {
- try {
+ public void perform(OpenExecution execution)
+ {
+ try
+ {
Context context = new InitialContext();
- if (context == null) return;
+ if (context == null)
+ return;
ConnectionFactory connectionFactory = getConnectionFactory(context);
- if (connectionFactory == null) return;
+ if (connectionFactory == null)
+ return;
Destination destination = getDestination(context);
- if (destination instanceof Queue) {
- handleQueueSend(connectionFactory, (Queue)destination);
+ if (destination instanceof Queue)
+ {
+ performQueueSend(connectionFactory, (Queue)destination);
}
- } catch (JMSException e) {
+ }
+ catch (JMSException e)
+ {
log.warn("JMSException while performing JmsActivity", e);
- } catch (NamingException e) {
+ }
+ catch (NamingException e)
+ {
log.warn("NamingException while performing JmsActivity", e);
- }
+ }
}
-
- private String substituteVariables(String input) {
- return (String)ScriptManager.getScriptManager().evaluateExpression(input, null);
+
+ private Object substituteVariables(String input)
+ {
+ return (Object)ScriptManager.getScriptManager().evaluateExpression(input, null);
}
-
- private void handleQueueSend(ConnectionFactory connectionFactory, Queue queue) throws JMSException {
- if (!(connectionFactory instanceof QueueConnectionFactory)) return;
+
+ private void performQueueSend(ConnectionFactory connectionFactory, Queue queue) throws JMSException
+ {
+ if (!(connectionFactory instanceof QueueConnectionFactory))
+ return;
QueueConnection queueConnection = ((QueueConnectionFactory)connectionFactory).createQueueConnection();
QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queueConnection.start();
QueueSender queueSender = queueSession.createSender(queue);
- TextMessage textMessage = queueSession.createTextMessage(substituteVariables(text));
- queueSender.send(textMessage);
+ Message message = createMessage(queueSession);
+ queueSender.send(message);
queueSender.close();
queueConnection.stop();
queueConnection.close();
queueSession.close();
}
- private Destination getDestination(Context context) throws NamingException {
+ private Message createMessage(Session session) throws JMSException {
+ if ("text".equals(type)) {
+ return createTextMessage(session);
+ } else if ("object".equals(type)) {
+ return createObjectMessage(session);
+ } else if ("map".equals(type)) {
+ return createMapMessage(session);
+ } else {
+ return null;
+ }
+ }
+
+ private MapMessage createMapMessage(Session session) throws JMSException {
+ MapMessage result = session.createMapMessage();
+ if (mapDescriptor != null) {
+ List<Descriptor> keyDescriptors = mapDescriptor.getKeyDescriptors();
+ List<Descriptor> valueDescriptors = mapDescriptor.getValueDescriptors();
+ for (int i = 0; i < keyDescriptors.size(); i++) {
+ String key = (String)WireContext.create(keyDescriptors.get(i));
+ Object value = WireContext.create(valueDescriptors.get(i));
+ result.setObject(key, value);
+ }
+ }
+ return result;
+ }
+
+ private TextMessage createTextMessage(Session session) throws JMSException {
+ return session.createTextMessage((String)substituteVariables(text));
+ }
+
+ private ObjectMessage createObjectMessage(Session session) throws JMSException {
+ Object object = substituteVariables(expression);
+ if (!(object instanceof Serializable)) {
+ throw new JbpmException(object + " is not serializable and cannot be used as payload of a jms object message");
+ }
+ return session.createObjectMessage((Serializable)substituteVariables(expression));
+ }
+
+ private Destination getDestination(Context context) throws NamingException
+ {
Destination result = null;
Object object = context.lookup(destinationName);
- if (object instanceof Destination) {
+ if (object instanceof Destination)
+ {
result = (Destination)object;
- } else {
+ }
+ else
+ {
log.warn("Object bound to " + destinationName + " is no javax.jms.Destination");
}
return result;
}
-
- private ConnectionFactory getConnectionFactory(Context context) throws NamingException {
+
+ private ConnectionFactory getConnectionFactory(Context context) throws NamingException
+ {
ConnectionFactory result = null;
Object object = context.lookup(connectionFactoryName);
- if (object instanceof ConnectionFactory) {
+ if (object instanceof ConnectionFactory)
+ {
result = (ConnectionFactory)object;
- } else {
+ }
+ else
+ {
log.warn("Object bound to " + connectionFactoryName + " is no javax.jms.ConnectionFactory");
}
return result;
}
- public void setType(String type) {
- this.type = type;
+ public void setType(String type)
+ {
+ this.type = type;
}
- public void setText(String text) {
+
+ public void setText(String text)
+ {
this.text = text;
}
- public void setConnectionFactoryName(String connectionFactoryName) {
+
+ public void setExpression(String expression) {
+ this.expression = expression;
+ }
+
+ public void setMapDescriptor(MapDescriptor mapDescriptor) {
+ this.mapDescriptor = mapDescriptor;
+ }
+
+ public void setConnectionFactoryName(String connectionFactoryName)
+ {
this.connectionFactoryName = connectionFactoryName;
}
- public void setDestinationName(String destinationName) {
+
+ public void setDestinationName(String destinationName)
+ {
this.destinationName = destinationName;
}
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java 2009-12-15 17:36:24 UTC (rev 5965)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java 2009-12-16 03:38:49 UTC (rev 5966)
@@ -23,45 +23,78 @@
import org.jbpm.jpdl.internal.xml.JpdlParser;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.descriptor.MapDescriptor;
+import org.jbpm.pvm.internal.xml.Binding;
import org.jbpm.pvm.internal.xml.Parse;
import org.w3c.dom.Element;
-
/**
* @author Koen Aers
*/
-public class JmsBinding extends JpdlBinding {
+public class JmsBinding extends JpdlBinding
+{
public static final String TAG = "jms";
- public JmsBinding() {
+ public JmsBinding()
+ {
super(TAG);
}
-
- protected JmsBinding(String tagName) {
+
+ protected JmsBinding(String tagName)
+ {
super(tagName);
}
- public Object parseJpdl(Element element, Parse parse, JpdlParser parser) {
+ public Object parseJpdl(Element element, Parse parse, JpdlParser parser)
+ {
JmsActivity jmsActivity = createJmsActivity();
-
+
Element textElement = XmlUtil.element(element, "text", false, parse);
- if (textElement!=null) {
+ if (textElement != null)
+ {
String text = XmlUtil.getContentText(textElement);
jmsActivity.setType("text");
jmsActivity.setText(text);
}
+
+ Element objectElement = XmlUtil.element(element, "object", false, parse);
+ if (objectElement != null)
+ {
+ String expr = XmlUtil.attribute(objectElement, "expr");
+ if (expr != null)
+ {
+ jmsActivity.setType("object");
+ jmsActivity.setExpression(expr);
+ }
+ }
+ Element mapElement = XmlUtil.element(element, "map", false, parse);
+ if (mapElement != null) {
+ Binding binding = parser.getBinding(mapElement);
+ if (binding != null) {
+ System.out.println("Goddam f*ck!!!");
+ }
+ jmsActivity.setType("map");
+ Object object = binding.parse(mapElement, parse, parser);
+ if (object instanceof MapDescriptor) {
+ jmsActivity.setMapDescriptor((MapDescriptor)object);
+ } else {
+ parse.addProblem("parsed object is not instanceof MapDescriptor", mapElement);
+ }
+ }
+
String connectionFactoryName = XmlUtil.attribute(element, "connection-factory", true, parse);
jmsActivity.setConnectionFactoryName(connectionFactoryName);
-
+
String destinationName = XmlUtil.attribute(element, "destination", true, parse);
jmsActivity.setDestinationName(destinationName);
-
+
return jmsActivity;
}
- protected JmsActivity createJmsActivity() {
+ protected JmsActivity createJmsActivity()
+ {
return new JmsActivity();
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java 2009-12-15 17:36:24 UTC (rev 5965)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MapBinding.java 2009-12-16 03:38:49 UTC (rev 5966)
@@ -65,12 +65,32 @@
if ("entry".equals(XmlUtil.getTagLocalName(entryElement))) {
// key
Element keyElement = XmlUtil.element(entryElement, "key");
+ if (keyElement != null) {
+ System.out.println("found keyElement");
+ }
Element keyDescriptorElement = (keyElement!=null ? XmlUtil.element(keyElement) : null);
+ if (keyDescriptorElement != null) {
+ System.out.println("found keyDescriptorElement");
+ System.out.println(" element: " + keyDescriptorElement.getNodeName());
+ }
Descriptor keyDescriptor = (Descriptor) parser.parseElement(keyDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
+ if (keyDescriptor != null) {
+ System.out.println("found keyDescriptor");
+ }
// value
Element valueElement = XmlUtil.element(entryElement, "value");
+ if (valueElement != null) {
+ System.out.println("found valueElement");
+ }
Element valueDescriptorElement = (valueElement!=null ? XmlUtil.element(valueElement) : null);
+ if (valueDescriptorElement != null) {
+ System.out.println("found valueDescriptorElement");
+ System.out.println(" element: " + valueDescriptorElement.getNodeName());
+ }
Descriptor valueDescriptor = (Descriptor) parser.parseElement(valueDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
+ if (valueDescriptor != null) {
+ System.out.println("found valueDescriptor");
+ }
if ( (keyDescriptor!=null)
&& (valueDescriptor!=null)
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JbpmJmsTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JbpmJmsTestCase.java (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JbpmJmsTestCase.java 2009-12-16 03:38:49 UTC (rev 5966)
@@ -0,0 +1,56 @@
+package org.jbpm.test.jms;
+
+import javax.jms.MessageConsumer;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+import org.apache.cactus.ServletTestSuite;
+import org.jbpm.test.JbpmTestCase;
+
+public abstract class JbpmJmsTestCase extends JbpmTestCase {
+
+ String deploymentId;
+
+ protected QueueConnection queueConnection = null;
+ protected QueueSession queueSession = null;
+ protected MessageConsumer messageConsumer = null;
+
+ public static Test suite() {
+ ServletTestSuite servletTestSuite = new ServletTestSuite();
+ servletTestSuite.addTestSuite(JbpmJmsTestCase.class);
+ return servletTestSuite;
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ setUpJms();
+ }
+
+ protected void setUpJms() throws Exception {
+ Context context = new InitialContext();
+ QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)context.lookup("ConnectionFactory");
+ Queue queue = (Queue)context.lookup("queue/jbpm-test-queue");
+ queueConnection = (QueueConnection)queueConnectionFactory.createConnection();
+ queueSession = queueConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+ queueConnection.start();
+ messageConsumer = queueSession.createConsumer(queue);
+ }
+
+ protected void tearDown() throws Exception {
+ tearDownJms();
+ super.tearDown();
+ }
+
+ protected void tearDownJms() throws Exception {
+ queueConnection.stop();
+ queueSession.close();
+ queueConnection.close();
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JbpmJmsTestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/map/MapMessageTest.java
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/map/MapMessageTest.java (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/map/MapMessageTest.java 2009-12-16 03:38:49 UTC (rev 5966)
@@ -0,0 +1,33 @@
+package org.jbpm.test.jms.map;
+
+import javax.jms.MapMessage;
+
+import junit.framework.Test;
+
+import org.apache.cactus.ServletTestSuite;
+import org.jbpm.test.jms.JbpmJmsTestCase;
+
+public class MapMessageTest extends JbpmJmsTestCase {
+
+ public static Test suite() {
+ ServletTestSuite servletTestSuite = new ServletTestSuite();
+ servletTestSuite.addTestSuite(MapMessageTest.class);
+ return servletTestSuite;
+ }
+
+// protected void setUp() throws Exception {
+// super.setUp();
+// registerDeployment(repositoryService.createDeployment()
+// .addResourceFromClasspath("org/jbpm/test/jms/map/process.jpdl.xml")
+// .deploy());
+// }
+
+ public void testJmsText() throws Exception {
+ assertTrue(true);
+// executionService.startProcessInstanceByKey("JMS_map_queue");
+// MapMessage mapMessage = (MapMessage)messageConsumer.receive();
+// assertTrue(mapMessage.itemExists("x"));
+// assertEquals("foo", mapMessage.getObject("x"));
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/map/MapMessageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/object/ObjectMessageTest.java
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/object/ObjectMessageTest.java (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/object/ObjectMessageTest.java 2009-12-16 03:38:49 UTC (rev 5966)
@@ -0,0 +1,41 @@
+package org.jbpm.test.jms.object;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.ObjectMessage;
+
+import junit.framework.Test;
+
+import org.apache.cactus.ServletTestSuite;
+import org.jbpm.test.jms.JbpmJmsTestCase;
+
+public class ObjectMessageTest extends JbpmJmsTestCase
+{
+
+ public static Test suite()
+ {
+ ServletTestSuite servletTestSuite = new ServletTestSuite();
+ servletTestSuite.addTestSuite(ObjectMessageTest.class);
+ return servletTestSuite;
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ registerDeployment(repositoryService
+ .createDeployment()
+ .addResourceFromClasspath("org/jbpm/test/jms/object/process.jpdl.xml")
+ .deploy());
+ }
+
+ public void testQueueMessage() throws Exception
+ {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("object", "this is the object");
+ executionService.startProcessInstanceByKey("JMS_object_queue", variables);
+ ObjectMessage objectMessage = (ObjectMessage)messageConsumer.receive();
+ assertEquals("this is the object", objectMessage.getObject());
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/object/ObjectMessageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/text/TextMessageTest.java
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/text/TextMessageTest.java 2009-12-15 17:36:24 UTC (rev 5965)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/text/TextMessageTest.java 2009-12-16 03:38:49 UTC (rev 5966)
@@ -1,28 +1,14 @@
package org.jbpm.test.jms.text;
-import javax.jms.MessageConsumer;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSession;
import javax.jms.TextMessage;
-import javax.naming.Context;
-import javax.naming.InitialContext;
import junit.framework.Test;
import org.apache.cactus.ServletTestSuite;
-import org.jbpm.api.ProcessInstance;
-import org.jbpm.test.JbpmTestCase;
+import org.jbpm.test.jms.JbpmJmsTestCase;
-public class TextMessageTest extends JbpmTestCase {
+public class TextMessageTest extends JbpmJmsTestCase {
- String deploymentId;
-
- QueueConnection queueConnection = null;
- QueueSession queueSession = null;
- MessageConsumer messageConsumer = null;
-
public static Test suite() {
ServletTestSuite servletTestSuite = new ServletTestSuite();
servletTestSuite.addTestSuite(TextMessageTest.class);
@@ -31,39 +17,15 @@
protected void setUp() throws Exception {
super.setUp();
- setUpJms();
registerDeployment(repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/test/jms/text/process.jpdl.xml")
.deploy());
}
- protected void setUpJms() throws Exception {
- Context context = new InitialContext();
- QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)context.lookup("ConnectionFactory");
- Queue queue = (Queue)context.lookup("queue/jbpm-test");
- queueConnection = (QueueConnection)queueConnectionFactory.createConnection();
- queueSession = queueConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
- queueConnection.start();
- messageConsumer = queueSession.createConsumer(queue);
- }
-
- protected void tearDown() throws Exception {
- tearDownJms();
- super.tearDown();
- }
-
- protected void tearDownJms() throws Exception {
- queueConnection.stop();
- queueSession.close();
- queueConnection.close();
- }
-
- public void testJmsText() throws Exception {
- ProcessInstance processInstance = executionService.startProcessInstanceByKey("JMS_text", "JMS_Test_Message");
+ public void testQueueMessage() throws Exception {
+ executionService.startProcessInstanceByKey("JMS_text_queue");
TextMessage textMessage = (TextMessage)messageConsumer.receive();
assertEquals("This is the body", textMessage.getText());
- processInstance = executionService.signalExecutionById(processInstance.getId());
- assertTrue(processInstance.isEnded());
}
}
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml 2009-12-15 17:36:24 UTC (rev 5965)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml 2009-12-16 03:38:49 UTC (rev 5966)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=jbpm-test"
+ name="jboss.messaging.destination:service=Queue,name=jbpm-test-queue"
xmbean-dd="xmdesc/Queue-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.messaging:service=PostOffice</depends>
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/map/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/map/process.jpdl.xml 2009-12-15 17:36:24 UTC (rev 5965)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/map/process.jpdl.xml 2009-12-16 03:38:49 UTC (rev 5966)
@@ -1,21 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
-<process name="JMS map" xmlns="http://jbpm.org/4.3/jpdl">
+<process name="JMS_map_queue">
<start g="20,20,48,48">
<transition to="send message" />
</start>
<jms name="send message"
- connectionFactory="ConnectionFactory"
- destination="queue/jbpm-test"
+ connection-factory="ConnectionFactory"
+ destination="queue/jbpm-test-queue"
g="96,16,83,52">
- <message type="map">
- <entry name="x" value="foo"/>
- <entry name="y" value="bar"/>
- </message>
+ <map>
+ <entry>
+ <key><string value="x"/></key>
+ <value><string value="foo"/></value>
+ </entry>
+ </map>
<transition to="wait" />
- </java>
+ </jms>
<state name="wait" g="352,17,88,52"/>
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/object/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/object/process.jpdl.xml 2009-12-15 17:36:24 UTC (rev 5965)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/object/process.jpdl.xml 2009-12-16 03:38:49 UTC (rev 5966)
@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<process name="JMS object">
+<process name="JMS_object_queue">
<start g="20,20,48,48">
<transition to="send message" />
</start>
<jms name="send message"
- connectionFactory="ConnectionFactory"
- destination="queue/jbpm-test"
+ connection-factory="ConnectionFactory"
+ destination="queue/jbpm-test-queue"
g="96,16,83,52">
- <message type="object">
- ${object}
- </message>
+ <object expr="${object}"/>
<transition to="wait" />
</jms>
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/text/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/text/process.jpdl.xml 2009-12-15 17:36:24 UTC (rev 5965)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/text/process.jpdl.xml 2009-12-16 03:38:49 UTC (rev 5966)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<process name="JMS_text">
+<process name="JMS_text_queue">
<start g="20,20,48,48">
<transition to="send message" />
@@ -8,16 +8,12 @@
<jms name="send message"
connection-factory="ConnectionFactory"
- destination="queue/jbpm-test"
+ destination="queue/jbpm-test-queue"
g="96,16,83,52">
<text>This is the body</text>
<transition to="wait" />
</jms>
- <state name="wait" g="352,17,88,52">
- <transition to="end" />
- </state>
-
- <end name="end"/>
+ <state name="wait" g="352,17,88,52"/>
</process>
16 years, 4 months