JBoss JBPM SVN: r3637 - projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/rebind.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-01-14 08:47:47 -0500 (Wed, 14 Jan 2009)
New Revision: 3637
Modified:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
Log:
Ingore empty lines and comments in workspace configuration
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java 2009-01-14 13:44:28 UTC (rev 3636)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java 2009-01-14 13:47:47 UTC (rev 3637)
@@ -135,6 +135,10 @@
String line = null;
while (( line = input.readLine()) != null){
+ // ignore comments and empty lines
+ if(line.equals("") || line.startsWith("#"))
+ continue;
+
sourceWriter.println("workspace.addEditor( new "+line+"(main), false );");
}
}
17 years, 3 months
JBoss JBPM SVN: r3636 - in projects/gwt-console/trunk: rpc and 10 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-01-14 08:44:28 -0500 (Wed, 14 Jan 2009)
New Revision: 3636
Added:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/rebind/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace.txt
Removed:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/WelcomeEditor.java
Modified:
projects/gwt-console/trunk/gwt-parent.iml
projects/gwt-console/trunk/rpc/gwt-rpc.iml
projects/gwt-console/trunk/server/gwt-server.iml
projects/gwt-console/trunk/server/pom.xml
projects/gwt-console/trunk/server/src/main/resources/definition_report.rptdesign
projects/gwt-console/trunk/war/gwt-war.iml
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Editor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ProcessReportEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
Log:
WorkspaceLauncher using DeferredBinding, first cut
Modified: projects/gwt-console/trunk/gwt-parent.iml
===================================================================
--- projects/gwt-console/trunk/gwt-parent.iml 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/gwt-parent.iml 2009-01-14 13:44:28 UTC (rev 3636)
@@ -15,9 +15,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="jbpm3-enterprise" exported="" />
- <orderEntry type="module" module-name="jbpm3-identity" exported="" />
- <orderEntry type="module" module-name="jbpm3-core" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
<CLASSES>
@@ -73,15 +70,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-httpclient:commons-httpclient:jar:3.1:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
@@ -172,24 +160,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.mail:mail:jar:1.4:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/mail/mail/1.4/mail-1.4.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: tjws:webserver:jar:1.3.3:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/tjws/webserver/1.3.3/webserver-1.3.3.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jyaml:jyaml:jar:1.3:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jyaml/jyaml/1.3/jyaml-1.3.jar!/" />
@@ -226,21 +196,14 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.sun.xml.bind:jaxb-impl:jar:2.1.2:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.2/jaxb-impl-2.1.2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
@@ -370,15 +333,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.servlet:servlet-api:jar:2.5:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
@@ -402,7 +356,9 @@
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
@@ -438,7 +394,9 @@
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
@@ -505,15 +463,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: mysql:mysql-connector-java:jar:5.1.6:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: sun-jaxb:jaxb-api:jar:2.1.4:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/sun-jaxb/jaxb-api/2.1.4/jaxb-api-2.1.4.jar!/" />
@@ -568,15 +517,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.bpm:bpm-spec-api:jar:1.0.0-SNAPSHOT:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/bpm/bpm-spec-api/1.0.0-SNAPSHOT/bpm-spec-api-1.0.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: wutka-dtdparser:dtdparser121:jar:1.2.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar!/" />
@@ -640,16 +580,20 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-codec:commons-codec:jar:1.2:compile">
+ <library name="M2 Dep: org.jbpm.jbpm3:jbpm-enterprise:jar:3.3.1-SNAPSHOT:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-enterprise/3.3.1-SNAPSHOT/jbpm-enterprise-3.3.1-SNAPSHOT.jar!/" />
</CLASSES>
- <JAVADOC />
- <SOURCES />
+ <JAVADOC>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-enterprise/3.3.1-SNAPSHOT/jbpm-enterprise-3.3.1-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-enterprise/3.3.1-SNAPSHOT/jbpm-enterprise-3.3.1-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:compile">
+ <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
</CLASSES>
@@ -658,7 +602,7 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:compile">
+ <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3.jar!/" />
</CLASSES>
@@ -667,17 +611,54 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
+ <library name="M2 Dep: org.jbpm.jbpm3:jbpm-identity:jar:3.3.1-SNAPSHOT:provided">
<CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-identity/3.3.1-SNAPSHOT/jbpm-identity-3.3.1-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-identity/3.3.1-SNAPSHOT/jbpm-identity-3.3.1-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-identity/3.3.1-SNAPSHOT/jbpm-identity-3.3.1-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:test">
+ <CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
</CLASSES>
<JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: org.jboss.bpm:bpm-spec-api:jar:1.0.0-Alpha1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/bpm/bpm-spec-api/1.0.0-Alpha1/bpm-spec-api-1.0.0-Alpha1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
+ <library name="M2 Dep: org.jbpm.jbpm3:jbpm-jpdl:jar:3.3.1-SNAPSHOT:provided">
<CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-jpdl/3.3.1-SNAPSHOT/jbpm-jpdl-3.3.1-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-jpdl/3.3.1-SNAPSHOT/jbpm-jpdl-3.3.1-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-jpdl/3.3.1-SNAPSHOT/jbpm-jpdl-3.3.1-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:test">
+ <CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
</CLASSES>
<JAVADOC />
@@ -685,7 +666,7 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:compile">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar!/" />
</CLASSES>
Modified: projects/gwt-console/trunk/rpc/gwt-rpc.iml
===================================================================
--- projects/gwt-console/trunk/rpc/gwt-rpc.iml 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/rpc/gwt-rpc.iml 2009-01-14 13:44:28 UTC (rev 3636)
@@ -59,7 +59,9 @@
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntryProperties />
Modified: projects/gwt-console/trunk/server/gwt-server.iml
===================================================================
--- projects/gwt-console/trunk/server/gwt-server.iml 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/server/gwt-server.iml 2009-01-14 13:44:28 UTC (rev 3636)
@@ -11,9 +11,6 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="gwt-parent" />
- <orderEntry type="module" module-name="jbpm3-enterprise" />
- <orderEntry type="module" module-name="jbpm3-identity" />
- <orderEntry type="module" module-name="jbpm3-core" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
<CLASSES>
@@ -42,15 +39,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: poi:poi:jar:2.5.1-final-20040804:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/poi/poi/2.5.1-final-20040804/poi-2.5.1-final-20040804.jar!/" />
@@ -69,15 +57,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-httpclient:commons-httpclient:jar:3.1:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
@@ -168,24 +147,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.mail:mail:jar:1.4:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/mail/mail/1.4/mail-1.4.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: tjws:webserver:jar:1.3.3:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/tjws/webserver/1.3.3/webserver-1.3.3.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jyaml:jyaml:jar:1.3:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jyaml/jyaml/1.3/jyaml-1.3.jar!/" />
@@ -222,21 +183,14 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.sun.xml.bind:jaxb-impl:jar:2.1.2:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.2/jaxb-impl-2.1.2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
@@ -276,15 +230,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
@@ -366,15 +311,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.servlet:servlet-api:jar:2.5:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.annotation:jsr250-api:jar:1.0:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
@@ -393,15 +329,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.activation:activation:jar:1.1:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: com.sun.xml.fastinfoset:FastInfoset:jar:1.2.2:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.2.2/FastInfoset-1.2.2.jar!/" />
@@ -434,7 +361,9 @@
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
@@ -501,15 +430,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: mysql:mysql-connector-java:jar:5.1.6:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: sun-jaxb:jaxb-api:jar:2.1.4:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/sun-jaxb/jaxb-api/2.1.4/jaxb-api-2.1.4.jar!/" />
@@ -564,15 +484,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jboss.bpm:bpm-spec-api:jar:1.0.0-SNAPSHOT:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/bpm/bpm-spec-api/1.0.0-SNAPSHOT/bpm-spec-api-1.0.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: wutka-dtdparser:dtdparser121:jar:1.2.1:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar!/" />
@@ -608,17 +519,21 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-codec:commons-codec:jar:1.2:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jbpm.jbpm3:jbpm-enterprise:jar:3.3.1-SNAPSHOT:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-enterprise/3.3.1-SNAPSHOT/jbpm-enterprise-3.3.1-SNAPSHOT.jar!/" />
</CLASSES>
- <JAVADOC />
- <SOURCES />
+ <JAVADOC>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-enterprise/3.3.1-SNAPSHOT/jbpm-enterprise-3.3.1-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-enterprise/3.3.1-SNAPSHOT/jbpm-enterprise-3.3.1-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:compile">
+ <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
</CLASSES>
@@ -627,7 +542,7 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:compile">
+ <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3.jar!/" />
</CLASSES>
@@ -636,17 +551,65 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
+ <library name="M2 Dep: org.jbpm.jbpm3:jbpm-identity:jar:3.3.1-SNAPSHOT:provided">
<CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-identity/3.3.1-SNAPSHOT/jbpm-identity-3.3.1-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-identity/3.3.1-SNAPSHOT/jbpm-identity-3.3.1-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-identity/3.3.1-SNAPSHOT/jbpm-identity-3.3.1-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:test">
+ <CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
</CLASSES>
<JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: org.jboss.bpm:bpm-spec-api:jar:1.0.0-Alpha1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/bpm/bpm-spec-api/1.0.0-Alpha1/bpm-spec-api-1.0.0-Alpha1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
+ <library name="M2 Dep: org.jbpm.jbpm3:jbpm-jpdl:jar:3.3.1-SNAPSHOT:provided">
<CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-jpdl/3.3.1-SNAPSHOT/jbpm-jpdl-3.3.1-SNAPSHOT.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-jpdl/3.3.1-SNAPSHOT/jbpm-jpdl-3.3.1-SNAPSHOT-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/jbpm-jpdl/3.3.1-SNAPSHOT/jbpm-jpdl-3.3.1-SNAPSHOT-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:test">
+ <CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
</CLASSES>
<JAVADOC />
@@ -654,7 +617,7 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:compile">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar!/" />
</CLASSES>
Modified: projects/gwt-console/trunk/server/pom.xml
===================================================================
--- projects/gwt-console/trunk/server/pom.xml 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/server/pom.xml 2009-01-14 13:44:28 UTC (rev 3636)
@@ -106,7 +106,7 @@
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
- <exclusion>
+ <exclusion>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
Modified: projects/gwt-console/trunk/server/src/main/resources/definition_report.rptdesign
===================================================================
--- projects/gwt-console/trunk/server/src/main/resources/definition_report.rptdesign 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/server/src/main/resources/definition_report.rptdesign 2009-01-14 13:44:28 UTC (rev 3636)
@@ -329,117 +329,8 @@
<simple-master-page name="Simple MasterPage" id="2"/>
</page-setup>
<body>
- <text id="286">
- <property name="fontFamily">sans-serif</property>
- <property name="paddingTop">10pt</property>
- <property name="paddingLeft">10pt</property>
- <property name="contentType">html</property>
- <text-property name="content"><![CDATA[Report for process: <value-of>params["name"]</value-of> ]]></text-property>
- </text>
- <table name="GlobalScriptTable" id="245">
- <property name="width">100%</property>
- <property name="dataSet">ExecQuartileByInstance</property>
- <list-property name="boundDataColumns">
- <structure>
- <property name="name">startDate</property>
- <expression name="expression">dataSetRow["startDate"]</expression>
- <property name="dataType">date-time</property>
- </structure>
- <structure>
- <property name="name">endDate</property>
- <expression name="expression">dataSetRow["endDate"]</expression>
- <property name="dataType">date-time</property>
- </structure>
- <structure>
- <property name="name">TOKEN_</property>
- <expression name="expression">dataSetRow["TOKEN_"]</expression>
- <property name="dataType">decimal</property>
- </structure>
- <structure>
- <property name="name">instanceID</property>
- <expression name="expression">dataSetRow["instanceID"]</expression>
- <property name="dataType">decimal</property>
- </structure>
- <structure>
- <property name="name">NAME_</property>
- <expression name="expression">dataSetRow["NAME_"]</expression>
- <property name="dataType">string</property>
- </structure>
- <structure>
- <property name="name">exec</property>
- <expression name="expression">dataSetRow["exec"]</expression>
- <property name="dataType">any</property>
- </structure>
- <structure>
- <property name="name">q3</property>
- <expression name="expression">dataSetRow["q3"]</expression>
- <property name="dataType">any</property>
- </structure>
- <structure>
- <property name="name">q1</property>
- <expression name="expression">dataSetRow["q1"]</expression>
- <property name="dataType">any</property>
- </structure>
- <structure>
- <property name="name">upperQuartile</property>
- <expression name="expression">dataSetRow["upperQuartile"]</expression>
- <property name="dataType">any</property>
- </structure>
- <structure>
- <property name="name">Column Binding</property>
- <expression name="expression">params["name"]</expression>
- <property name="dataType">any</property>
- </structure>
- </list-property>
- <method name="onCreate"><![CDATA[// make dataset values available as global variables
-var q3Value = this.getRowData().getColumnValue("q3");
-var q1Value = this.getRowData().getColumnValue("exec");
-reportContext.setGlobalVariable("q3", q3Value);
-reportContext.setGlobalVariable("q1", q1Value);]]></method>
- <column id="258"/>
- <column id="259"/>
- <detail>
- <row id="250">
- <cell id="251"/>
- <cell id="252"/>
- </row>
- </detail>
- </table>
- <table id="287">
- <property name="marginTop">0pt</property>
- <property name="canShrink">true</property>
- <property name="width">620px</property>
- <column id="300"/>
- <column id="301"/>
- <header>
- <row id="288">
- <cell id="289">
- <text id="339">
- <property name="fontFamily">sans-serif</property>
- <property name="fontWeight">bold</property>
- <property name="paddingTop">1pt</property>
- <property name="paddingLeft">10pt</property>
- <property name="textAlign">left</property>
- <property name="contentType">auto</property>
- <text-property name="content"><![CDATA[Execution time quartiles]]></text-property>
- </text>
- </cell>
- <cell id="290">
- <text id="341">
- <property name="fontFamily">sans-serif</property>
- <property name="fontWeight">bold</property>
- <property name="textAlign">left</property>
- <property name="contentType">auto</property>
- <text-property name="content"><![CDATA[Upper quartile]]></text-property>
- </text>
- </cell>
- </row>
- </header>
- <detail>
- <row id="292">
- <cell id="293">
- <extended-item extensionName="Chart" name="ExecQuartiles" id="223">
- <xml-property name="xmlRepresentation"><![CDATA[<model:ChartWithAxes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute" xmlns:data="http://www.birt.eclipse.org/ChartModelData" xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout" xmlns:model="http://www.birt.eclipse.org/ChartModel" xmlns:type="http://www.birt.eclipse.org/ChartModelType">
+ <extended-item extensionName="Chart" name="ExecQuartiles" id="223">
+ <xml-property name="xmlRepresentation"><![CDATA[<model:ChartWithAxes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute" xmlns:data="http://www.birt.eclipse.org/ChartModelData" xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout" xmlns:model="http://www.birt.eclipse.org/ChartModel" xmlns:type="http://www.birt.eclipse.org/ChartModelType">
<Type>Bar Chart</Type>
<SubType>Side-by-side</SubType>
<Block>
@@ -1575,59 +1466,167 @@
<Rotation/>
</model:ChartWithAxes>
]]></xml-property>
- <property name="outputFormat">SVG</property>
- <property name="dataSet">ExecQuartileByInstance</property>
- <property name="height">130pt</property>
- <property name="width">212pt</property>
- <list-property name="boundDataColumns">
- <structure>
- <property name="name">startDate</property>
- <expression name="expression">dataSetRow["startDate"]</expression>
- <property name="dataType">date-time</property>
- </structure>
- <structure>
- <property name="name">endDate</property>
- <expression name="expression">dataSetRow["endDate"]</expression>
- <property name="dataType">date-time</property>
- </structure>
- <structure>
- <property name="name">TOKEN_</property>
- <expression name="expression">dataSetRow["TOKEN_"]</expression>
- <property name="dataType">decimal</property>
- </structure>
- <structure>
- <property name="name">instanceID</property>
- <expression name="expression">dataSetRow["instanceID"]</expression>
- <property name="dataType">decimal</property>
- </structure>
- <structure>
- <property name="name">NAME_</property>
- <expression name="expression">dataSetRow["NAME_"]</expression>
- <property name="dataType">string</property>
- </structure>
- <structure>
- <property name="name">exec</property>
- <expression name="expression">dataSetRow["exec"]</expression>
- <property name="dataType">any</property>
- </structure>
- <structure>
- <property name="name">q3</property>
- <expression name="expression">dataSetRow["q3"]</expression>
- <property name="dataType">any</property>
- </structure>
- <structure>
- <property name="name">q1</property>
- <expression name="expression">dataSetRow["q1"]</expression>
- <property name="dataType">any</property>
- </structure>
- <structure>
- <property name="name">upperQuartile</property>
- <expression name="expression">dataSetRow["upperQuartile"]</expression>
- <property name="dataType">any</property>
- </structure>
- </list-property>
- </extended-item>
+ <property name="outputFormat">SVG</property>
+ <property name="dataSet">ExecQuartileByInstance</property>
+ <property name="height">130pt</property>
+ <property name="width">212pt</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">startDate</property>
+ <expression name="expression">dataSetRow["startDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">endDate</property>
+ <expression name="expression">dataSetRow["endDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">TOKEN_</property>
+ <expression name="expression">dataSetRow["TOKEN_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">instanceID</property>
+ <expression name="expression">dataSetRow["instanceID"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">NAME_</property>
+ <expression name="expression">dataSetRow["NAME_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">exec</property>
+ <expression name="expression">dataSetRow["exec"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q1</property>
+ <expression name="expression">dataSetRow["q1"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">upperQuartile</property>
+ <expression name="expression">dataSetRow["upperQuartile"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ </extended-item>
+ <text id="286">
+ <property name="fontFamily">sans-serif</property>
+ <property name="paddingTop">10pt</property>
+ <property name="paddingLeft">10pt</property>
+ <property name="contentType">html</property>
+ <text-property name="content"><![CDATA[Report for process: <value-of>params["name"]</value-of> ]]></text-property>
+ </text>
+ <table name="GlobalScriptTable" id="245">
+ <property name="width">100%</property>
+ <property name="dataSet">ExecQuartileByInstance</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">startDate</property>
+ <expression name="expression">dataSetRow["startDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">endDate</property>
+ <expression name="expression">dataSetRow["endDate"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">TOKEN_</property>
+ <expression name="expression">dataSetRow["TOKEN_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">instanceID</property>
+ <expression name="expression">dataSetRow["instanceID"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">NAME_</property>
+ <expression name="expression">dataSetRow["NAME_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">exec</property>
+ <expression name="expression">dataSetRow["exec"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">q1</property>
+ <expression name="expression">dataSetRow["q1"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">upperQuartile</property>
+ <expression name="expression">dataSetRow["upperQuartile"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <expression name="expression">params["name"]</expression>
+ <property name="dataType">any</property>
+ </structure>
+ </list-property>
+ <method name="onCreate"><![CDATA[// make dataset values available as global variables
+var q3Value = this.getRowData().getColumnValue("q3");
+var q1Value = this.getRowData().getColumnValue("exec");
+reportContext.setGlobalVariable("q3", q3Value);
+reportContext.setGlobalVariable("q1", q1Value);]]></method>
+ <column id="258"/>
+ <column id="259"/>
+ <detail>
+ <row id="250">
+ <cell id="251"/>
+ <cell id="252"/>
+ </row>
+ </detail>
+ </table>
+ <table id="287">
+ <property name="marginTop">0pt</property>
+ <property name="canShrink">true</property>
+ <property name="width">620px</property>
+ <column id="300"/>
+ <column id="301"/>
+ <header>
+ <row id="288">
+ <cell id="289">
+ <text id="339">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontWeight">bold</property>
+ <property name="paddingTop">1pt</property>
+ <property name="paddingLeft">10pt</property>
+ <property name="textAlign">left</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Execution time quartiles]]></text-property>
+ </text>
</cell>
+ <cell id="290">
+ <text id="341">
+ <property name="fontFamily">sans-serif</property>
+ <property name="fontWeight">bold</property>
+ <property name="textAlign">left</property>
+ <property name="contentType">auto</property>
+ <text-property name="content"><![CDATA[Upper quartile]]></text-property>
+ </text>
+ </cell>
+ </row>
+ </header>
+ <detail>
+ <row id="292">
+ <cell id="293"/>
<cell id="294">
<table id="319">
<property name="fontFamily">sans-serif</property>
Modified: projects/gwt-console/trunk/war/gwt-war.iml
===================================================================
--- projects/gwt-console/trunk/war/gwt-war.iml 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/gwt-war.iml 2009-01-14 13:44:28 UTC (rev 3636)
@@ -11,7 +11,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="gwt-parent" exported="" />
+ <orderEntry type="module" module-name="gwt-parent" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: junit:junit:jar:3.8.1:test">
<CLASSES>
@@ -72,7 +72,9 @@
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -25,17 +25,18 @@
/**
* An editor can be plugged into a {@link org.jboss.bpm.console.client.Workspace}
- *
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public abstract class Editor extends Panel
{
- protected Editor()
- {
- super();
- }
+
+ protected Editor(MainView main)
+ {
+ super();
+ }
- public abstract String getEditorId();
- public abstract String getTitle();
- public abstract String getIconCSS();
+ public abstract String getEditorId();
+ public abstract String getTitle();
+ public abstract String getIconCSS();
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -23,6 +23,7 @@
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.core.client.GWT;
import com.gwtext.client.core.Margins;
import com.gwtext.client.core.RegionPosition;
import com.gwtext.client.widgets.MessageBox;
@@ -36,6 +37,7 @@
import org.jboss.bpm.console.client.report.OverviewReportEditor;
import org.jboss.bpm.console.client.task.TaskListEditor;
import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.WorkspaceLauncher;
import java.util.List;
@@ -46,136 +48,133 @@
*/
public class MainView extends Composite
{
- private HTML status = new HTML();
- private Header header;
- private Menu menu;
- private Workspace workspace;
+ private HTML status = new HTML();
+ private Header header;
+ private Menu menu;
+ private Workspace workspace;
- private URLBuilder urlBuilder;
- private Viewport viewport;
- private Authentication auth;
+ private URLBuilder urlBuilder;
+ private Viewport viewport;
+ private Authentication auth;
- private ConsoleConfig config;
+ private ConsoleConfig config;
- public boolean isAttached()
- {
- return super.isAttached(); //To change body of overridden methods use File | Settings | File Templates.
- }
+ public boolean isAttached()
+ {
+ return super.isAttached(); //To change body of overridden methods use File | Settings | File Templates.
+ }
- public MainView(Authentication auth, URLBuilder urlBuilder, ConsoleConfig config)
- {
- this.auth = auth;
- this.config = config;
- this.urlBuilder = urlBuilder;
+ public MainView(Authentication auth, URLBuilder urlBuilder, ConsoleConfig config)
+ {
+ this.auth = auth;
+ this.config = config;
+ this.urlBuilder = urlBuilder;
- Panel mainPanel = createMainPanel();
- assembleMainApplication(mainPanel);
+ Panel mainPanel = createMainPanel();
+ assembleMainApplication(mainPanel);
+
+ viewport = new Viewport(mainPanel);
+ }
- viewport = new Viewport(mainPanel);
- }
+ private Panel createMainPanel()
+ {
+ Panel mainPanel = new Panel();
+ mainPanel.setBorder(false);
+ mainPanel.setPaddings(5); // outer most padding
+ mainPanel.setLayout(new FitLayout());
+ mainPanel.setWidth(UIConstants.OVERALL_WIDTH);
+ mainPanel.setHeight(UIConstants.OVERALL_WIDTH);
+ return mainPanel;
+ }
- private Panel createMainPanel()
- {
- Panel mainPanel = new Panel();
- mainPanel.setBorder(false);
- mainPanel.setPaddings(5); // outer most padding
- mainPanel.setLayout(new FitLayout());
- mainPanel.setWidth(UIConstants.OVERALL_WIDTH);
- mainPanel.setHeight(UIConstants.OVERALL_WIDTH);
- return mainPanel;
- }
+ private void assembleMainApplication(Panel mainPanel)
+ {
+ Panel borderPanel = new Panel();
+ borderPanel.setBorder(false);
+ borderPanel.setLayout(new BorderLayout());
- private void assembleMainApplication(Panel mainPanel)
- {
- Panel borderPanel = new Panel();
- borderPanel.setBorder(false);
- borderPanel.setLayout(new BorderLayout());
+ // ------------------------------------------
- // ------------------------------------------
+ header = new Header(this);
+ borderPanel.add(header, new BorderLayoutData(RegionPosition.NORTH));
+ header.setUserInfo(auth.getUsername(), auth.getRolesAssigned());
- header = new Header(this);
- borderPanel.add(header, new BorderLayoutData(RegionPosition.NORTH));
- header.setUserInfo(auth.getUsername(), auth.getRolesAssigned());
-
- // ------------------------------------------
+ // ------------------------------------------
- menu = new Menu(this);
- BorderLayoutData menuData = new BorderLayoutData(RegionPosition.WEST);
- menuData.setSplit(false);
- menuData.setMinSize(UIConstants.MAIN_MENU_MIN);
- menuData.setMaxSize(UIConstants.MAIN_MENU_MAX);
- menuData.setMargins(new Margins(0, 5, 0, 0));
- borderPanel.add(menu, menuData);
+ menu = new Menu(this);
+ BorderLayoutData menuData = new BorderLayoutData(RegionPosition.WEST);
+ menuData.setSplit(false);
+ menuData.setMinSize(UIConstants.MAIN_MENU_MIN);
+ menuData.setMaxSize(UIConstants.MAIN_MENU_MAX);
+ menuData.setMargins(new Margins(0, 5, 0, 0));
+ borderPanel.add(menu, menuData);
- // ------------------------------------------
+ // ------------------------------------------
- workspace = new Workspace();
- borderPanel.add(workspace, new BorderLayoutData(RegionPosition.CENTER));
+ workspace = new Workspace();
+ WorkspaceLauncher launcher = GWT.create(WorkspaceLauncher.class);
+ launcher.launch(this, workspace);
+
+ borderPanel.add(workspace, new BorderLayoutData(RegionPosition.CENTER));
- // ------------------------------------------
- // TODO: these don't initialze correctly when ordered differently or launched from Menu
- workspace.addEditor( new ProcessDefinitionListEditor(this), false );
- workspace.addEditor( new TaskListEditor(this), false );
- workspace.addEditor( new OverviewReportEditor(this), false);
+ // ------------------------------------------
- // ------------------------------------------
+ mainPanel.add(borderPanel);
+ }
- mainPanel.add(borderPanel);
- }
+ public void addEditor(Editor editor)
+ {
+ ConsoleLog.debug("Add editor " + editor.getEditorId());
+ workspace.addEditor(editor, true);
+ }
- public void addEditor(Editor editor)
- {
- ConsoleLog.debug("Add editor " + editor.getEditorId());
- workspace.addEditor(editor, true);
- }
+ public boolean hasEditor(String id)
+ {
+ return workspace.hasEditor(id);
+ }
- public boolean hasEditor(String id)
- {
- return workspace.hasEditor(id);
- }
+ public void showEditor(String id)
+ {
+ workspace.showTab(id);
+ }
- public void showEditor(String id)
- {
- workspace.showTab(id);
- }
+ public URLBuilder getUrlBuilder()
+ {
+ return this.urlBuilder;
+ }
- public URLBuilder getUrlBuilder()
- {
- return this.urlBuilder;
- }
+ public void displayMessage(final String message, final boolean isError)
+ {
+ status.setText(message);
- public void displayMessage(final String message, final boolean isError)
- {
- status.setText(message);
+ MessageBox.show(new MessageBoxConfig() {
+ {
+ String title = isError ? "Error" : "System Message";
+ setTitle(title);
+ setMsg(message);
+ setButtons(MessageBox.OK);
+ setCallback(new MessageBox.PromptCallback()
+ {
+ public void execute(String btnID, String text)
+ {
+ }
+ });
+ }
+ });
+ }
- MessageBox.show(new MessageBoxConfig() {
- {
- String title = isError ? "Error" : "System Message";
- setTitle(title);
- setMsg(message);
- setButtons(MessageBox.OK);
- setCallback(new MessageBox.PromptCallback()
- {
- public void execute(String btnID, String text)
- {
- }
- });
- }
- });
- }
+ public List<String> getRolesAssigned()
+ {
+ return auth.getRolesAssigned();
+ }
- public List<String> getRolesAssigned()
- {
- return auth.getRolesAssigned();
- }
+ public String getUsername()
+ {
+ return auth.getUsername();
+ }
- public String getUsername()
- {
- return auth.getUsername();
- }
-
- public void logout()
- {
- auth.doLogout();
- }
+ public void logout()
+ {
+ auth.doLogout();
+ }
}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/WelcomeEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/WelcomeEditor.java 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/WelcomeEditor.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class WelcomeEditor extends Editor
-{
-
- public String getEditorId()
- {
- return "org.jboss.bpm.console.welcome";
- }
-
- public String getTitle()
- {
- return "GWT-Console";
- }
-
- public String getIconCSS()
- {
- return "";
- }
-}
Added: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.client;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface WorkspaceLauncher
+{
+ void launch(MainView main, Workspace workspace);
+}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -57,7 +57,7 @@
public ProcessDefinitionListEditor(final MainView view)
{
- super();
+ super(view);
this.setId(ID);
this.view = view;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -53,7 +53,7 @@
public ProcessInstanceEditor(final ProcessDefinitionRef proc, final ProcessInstanceRef instance, final MainView view)
{
- super();
+ super(view);
this.setId(ProcessInstanceEditor.ID+"."+instance.getInstanceId());
this.processDefinition = proc;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -65,7 +65,7 @@
public ProcessInstanceListEditor(ProcessDefinitionRef proc, final MainView view)
{
- super();
+ super(view);
this.parent = proc;
this.view = view;
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportEditor.java 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportEditor.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -48,7 +48,7 @@
public OverviewReportEditor(final MainView view)
{
- super();
+ super(view);
this.view = view;
this.setId(ID);
this.setPaddings(10);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ProcessReportEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ProcessReportEditor.java 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ProcessReportEditor.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -44,137 +44,138 @@
*/
public class ProcessReportEditor extends Editor
{
- public final static String ID = "org.jboss.bpm.metric.ProcessMetric";
- private String definitionName;
- private MainView view;
+ public final static String ID = "org.jboss.bpm.metric.ProcessMetric";
+ private String definitionName;
+ private MainView view;
- public ProcessReportEditor(final String definitionName, final MainView view)
- {
- this.definitionName = definitionName;
- this.view = view;
- this.setId( createWidgetID(definitionName) );
+ public ProcessReportEditor(final String definitionName, final MainView view)
+ {
+ super(view);
+ this.definitionName = definitionName;
+ this.view = view;
+ this.setId( createWidgetID(definitionName) );
- this.setPaddings(10);
+ this.setPaddings(10);
- // -------------------------------------
- this.setLayout(new VerticalLayout(10) );
+ // -------------------------------------
+ this.setLayout(new VerticalLayout(10) );
- this.addListener(
- new PanelListenerAdapter()
- {
+ this.addListener(
+ new PanelListenerAdapter()
+ {
- public void onRender(Component component)
- {
+ public void onRender(Component component)
+ {
- final String reportUrl= view.getUrlBuilder().getDefinitionReportUrl(definitionName);
- ConsoleLog.debug("Report resource:" + reportUrl);
+ final String reportUrl= view.getUrlBuilder().getDefinitionReportUrl(definitionName);
+ ConsoleLog.debug("Report resource:" + reportUrl);
- final ComboBox comboBox = buildInstanceSelection();
+ final ComboBox comboBox = buildInstanceSelection();
- final BirtPanel birtPanel = new BirtPanel();
- birtPanel.setUrl(reportUrl);
+ final BirtPanel birtPanel = new BirtPanel();
+ birtPanel.setUrl(reportUrl);
- // --
+ // --
- Button refreshBtn = new Button("Refresh", new ButtonListenerAdapter()
- {
+ Button refreshBtn = new Button("Refresh", new ButtonListenerAdapter()
+ {
- public void onClick(Button button, EventObject eventObject)
- {
- birtPanel.setUrl(reportUrl);
- }
- });
+ public void onClick(Button button, EventObject eventObject)
+ {
+ birtPanel.setUrl(reportUrl);
+ }
+ });
- Button viewBtn = new Button("Examine", new ButtonListenerAdapter()
- {
+ Button viewBtn = new Button("Examine", new ButtonListenerAdapter()
+ {
- public void onClick(Button button, EventObject eventObject)
- {
- String rawValue = comboBox.getRawValue();
- if(rawValue==null || rawValue.equals(""))
- MessageBox.alert("Please enter a process instance ID!");
- else
- MessageBox.alert("Not implemented");
- }
- });
+ public void onClick(Button button, EventObject eventObject)
+ {
+ String rawValue = comboBox.getRawValue();
+ if(rawValue==null || rawValue.equals(""))
+ MessageBox.alert("Please enter a process instance ID!");
+ else
+ MessageBox.alert("Not implemented");
+ }
+ });
- // --
+ // --
- Panel p = new Panel();
- p.setLayout( new HorizontalLayout(10) );
- Label label = new Label("Instance ID");
- label.setStyleName("bpm-label");
- p.add(label);
- p.add(comboBox);
- p.add( viewBtn );
- p.add( new Separator() );
- p.add( refreshBtn );
+ Panel p = new Panel();
+ p.setLayout( new HorizontalLayout(10) );
+ Label label = new Label("Instance ID");
+ label.setStyleName("bpm-label");
+ p.add(label);
+ p.add(comboBox);
+ p.add( viewBtn );
+ p.add( new Separator() );
+ p.add( refreshBtn );
- add(p);
- add(birtPanel);
- }
- }
- );
- }
+ add(p);
+ add(birtPanel);
+ }
+ }
+ );
+ }
- private ComboBox buildInstanceSelection()
- {
+ private ComboBox buildInstanceSelection()
+ {
- final RecordDef recordDef = new RecordDef(
- new FieldDef[]{
- new IntegerFieldDef("instanceId"),
- new IntegerFieldDef("parentId"),
- new StringFieldDef("key"),
- new StringFieldDef("state"),
- new DateFieldDef("startDate", UIConstants.DATE_FORMAT),
- new DateFieldDef("endDate", UIConstants.DATE_FORMAT),
- new BooleanFieldDef("suspended")
- }
- );
+ final RecordDef recordDef = new RecordDef(
+ new FieldDef[]{
+ new IntegerFieldDef("instanceId"),
+ new IntegerFieldDef("parentId"),
+ new StringFieldDef("key"),
+ new StringFieldDef("state"),
+ new DateFieldDef("startDate", UIConstants.DATE_FORMAT),
+ new DateFieldDef("endDate", UIConstants.DATE_FORMAT),
+ new BooleanFieldDef("suspended")
+ }
+ );
- final JsonReader reader = new JsonReader(recordDef);
- reader.setRoot("instances");
- reader.setTotalProperty("totalCount");
- reader.setId("instanceId");
+ final JsonReader reader = new JsonReader(recordDef);
+ reader.setRoot("instances");
+ reader.setTotalProperty("totalCount");
+ reader.setId("instanceId");
- DataProxy dataProxy = new ScriptTagProxy(
- view.getUrlBuilder().getProcessDefinitionsURL(), 1000*10);
+ DataProxy dataProxy = new ScriptTagProxy(
+ view.getUrlBuilder().getProcessDefinitionsURL(), 1000*10);
- final Store store = new Store(dataProxy, reader, false);
- store.load();
+ final Store store = new Store(dataProxy, reader, false);
+ store.load();
- ComboBox cb = new ComboBox();
- cb.setMinChars(1);
- cb.setFieldLabel("Instance ID");
- cb.setStore(store);
- cb.setDisplayField("ID");
- cb.setMode(ComboBox.LOCAL);
- cb.setTriggerAction(ComboBox.ALL);
- cb.setEmptyText("Please enter an ID");
- cb.setLoadingText("Searching...");
- cb.setTypeAhead(true);
- cb.setSelectOnFocus(true);
- cb.setWidth(180);
+ ComboBox cb = new ComboBox();
+ cb.setMinChars(1);
+ cb.setFieldLabel("Instance ID");
+ cb.setStore(store);
+ cb.setDisplayField("ID");
+ cb.setMode(ComboBox.LOCAL);
+ cb.setTriggerAction(ComboBox.ALL);
+ cb.setEmptyText("Please enter an ID");
+ cb.setLoadingText("Searching...");
+ cb.setTypeAhead(true);
+ cb.setSelectOnFocus(true);
+ cb.setWidth(180);
- return cb;
- }
- public String getEditorId()
- {
- return createWidgetID(definitionName);
- }
+ return cb;
+ }
+ public String getEditorId()
+ {
+ return createWidgetID(definitionName);
+ }
- public String getTitle()
- {
- return definitionName +" Metrics";
- }
+ public String getTitle()
+ {
+ return definitionName +" Metrics";
+ }
- public String getIconCSS()
- {
- return "bpm-report-icon";
- }
+ public String getIconCSS()
+ {
+ return "bpm-report-icon";
+ }
- public static String createWidgetID(String definitionName)
- {
- return ID+"."+definitionName;
- }
+ public static String createWidgetID(String definitionName)
+ {
+ return ID+"."+definitionName;
+ }
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskListEditor.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -57,7 +57,7 @@
public TaskListEditor(MainView mainView)
{
- super();
+ super(mainView);
this.setId(ID);
this.mainView = mainView;
Added: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java 2009-01-14 13:44:28 UTC (rev 3636)
@@ -0,0 +1,165 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.rebind;
+
+import com.google.gwt.core.ext.Generator;
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.core.ext.GeneratorContext;
+import com.google.gwt.core.ext.UnableToCompleteException;
+import com.google.gwt.core.ext.typeinfo.TypeOracle;
+import com.google.gwt.core.ext.typeinfo.JClassType;
+import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
+import com.google.gwt.user.rebind.SourceWriter;
+
+import java.io.*;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class WorkspaceGenerator extends Generator
+{
+
+ /** Simple name of class to be generated */
+ private String className = null;
+ /** Package name of class to be generated */
+ private String packageName = null;
+ /** Fully qualified class name passed into GWT.create() */
+ private String typeName = null;
+
+ public String generate(TreeLogger logger, GeneratorContext context, String typeName)
+ throws UnableToCompleteException
+ {
+ this.typeName = typeName;
+ TypeOracle typeOracle = context.getTypeOracle();
+
+ try {
+ // get classType and save instance variables
+ JClassType classType = typeOracle.getType(typeName);
+ packageName = classType.getPackage().getName();
+ className = classType.getSimpleSourceName() + "Wrapper";
+
+ // Generate class source code
+ generateClass(logger, context);
+
+ } catch (Exception e) {
+ // record to logger that Map generation threw an exception
+ e.printStackTrace(System.out);
+ logger.log(TreeLogger.ERROR, "Failed to generate workspace launcher", e);
+ }
+
+ // return the fully qualifed name of the class generated
+ return packageName + "." + className;
+ }
+
+ /**
+ * Generate source code for new class. Class extends
+ <code>HashMap</code>.
+ *
+ * @param logger Logger object
+ * @param context Generator context
+ */
+ private void generateClass(TreeLogger logger, GeneratorContext
+ context) {
+
+ // get print writer that receives the source code
+ PrintWriter printWriter = null;
+ printWriter = context.tryCreate(logger, packageName, className);
+
+ // print writer if null, source code has ALREADY been generated, return
+ if (printWriter == null) return;
+
+ // init composer, set class properties, create source writer
+ ClassSourceFileComposerFactory composerFactory =
+ new ClassSourceFileComposerFactory(packageName, className);
+
+ // Imports
+ composerFactory.addImport("org.jboss.bpm.console.client.MainView");
+ composerFactory.addImport("org.jboss.bpm.console.client.Workspace");
+ composerFactory.addImport("org.jboss.bpm.console.client.WorkspaceLauncher");
+
+ // Interfaces
+ composerFactory.addImplementedInterface("org.jboss.bpm.console.client.WorkspaceLauncher");
+
+ // SourceWriter
+ SourceWriter sourceWriter = composerFactory.createSourceWriter(context, printWriter);
+
+ // Methods
+ generateMethods(sourceWriter);
+
+
+ // close generated class
+ sourceWriter.outdent();
+ sourceWriter.println("}");
+
+ // commit generated class
+ context.commit(logger, printWriter);
+ }
+
+ private void generateMethods(SourceWriter sourceWriter)
+ {
+ // start constructor source generation
+ sourceWriter.println("public void launch(MainView main, Workspace workspace) { ");
+ sourceWriter.indent();
+
+ InputStream in = getClass().getClassLoader().getResourceAsStream(
+ "org/jboss/bpm/console/workspace.txt"
+ );
+
+ if(null==in)
+ throw new RuntimeException("Cannot find 'org/jboss/bpm/console/workspace.txt'");
+
+ try {
+ //use buffering, reading one line at a time
+ //FileReader always assumes default encoding is OK!
+ BufferedReader input = new BufferedReader(new InputStreamReader(in));
+ try {
+ String line = null;
+ while (( line = input.readLine()) != null){
+
+ sourceWriter.println("workspace.addEditor( new "+line+"(main), false );");
+ }
+ }
+ finally {
+ input.close();
+ }
+ }
+ catch (IOException ex){
+ throw new RuntimeException("Error reading 'org/jboss/bpm/console/workspace.txt'");
+ }
+
+ // end constructor source generation
+ sourceWriter.outdent();
+ sourceWriter.println("}");
+ }
+
+ /*private void generateConstructor(SourceWriter sourceWriter)
+ {
+ // start constructor source generation
+ sourceWriter.println("public " + className + "() { ");
+ sourceWriter.indent();
+ sourceWriter.println("super();");
+ // end constructor source generation
+ sourceWriter.outdent();
+ sourceWriter.println("}");
+ }*/
+
+}
Modified: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml 2009-01-14 05:51:14 UTC (rev 3635)
+++ projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml 2009-01-14 13:44:28 UTC (rev 3636)
@@ -1,38 +1,42 @@
<module>
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name='com.google.gwt.user.User' />
- <inherits name='com.google.gwt.json.JSON'/>
- <inherits name="com.google.gwt.i18n.I18N"/>
- <inherits name='com.gwtext.GwtExt' />
+ <!-- Inherit the core Web Toolkit stuff. -->
+ <inherits name='com.google.gwt.user.User' />
+ <inherits name='com.google.gwt.json.JSON'/>
+ <inherits name="com.google.gwt.i18n.I18N"/>
+ <inherits name='com.gwtext.GwtExt' />
- <!-- Add gwt-log support, default level `DEBUG` -->
- <inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
+ <!-- Add gwt-log support, default level `DEBUG` -->
+ <inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
- <!-- Add the `WARN` and `DEBUG` compile time log level -->
- <!--extend-property name="log_level" values="DEBUG,WARN"/-->
+ <generate-with class="org.jboss.bpm.console.rebind.WorkspaceGenerator" >
+ <when-type-assignable class="org.jboss.bpm.console.client.WorkspaceLauncher"/>
+ </generate-with>
- <!-- Loggers Enabled by default -->
- <set-property name="log_ConsoleLogger" value="ENABLED" />
- <set-property name="log_DivLogger" value="DISABLED" />
- <set-property name="log_FirebugLogger" value="DISABLED" />
- <set-property name="log_GWTLogger" value="ENABLED" />
- <set-property name="log_SystemLogger" value="ENABLED" />
+ <!-- Add the `WARN` and `DEBUG` compile time log level -->
+ <!--extend-property name="log_level" values="DEBUG,WARN"/-->
- <!-- Loggers Disabled by default -->
- <set-property name="log_RemoteLogger" value="DISABLED" />
- <set-property name="log_WindowLogger" value="DISABLED" />
+ <!-- Loggers Enabled by default -->
+ <set-property name="log_ConsoleLogger" value="ENABLED" />
+ <set-property name="log_DivLogger" value="DISABLED" />
+ <set-property name="log_FirebugLogger" value="DISABLED" />
+ <set-property name="log_GWTLogger" value="ENABLED" />
+ <set-property name="log_SystemLogger" value="ENABLED" />
- <!-- Specify the app entry point class. -->
- <entry-point class='org.jboss.bpm.console.client.Application' />
+ <!-- Loggers Disabled by default -->
+ <set-property name="log_RemoteLogger" value="DISABLED" />
+ <set-property name="log_WindowLogger" value="DISABLED" />
- <servlet path="/xhp" class="jmaki.xhp.XmlHttpProxyServlet"/>
+ <!-- Specify the app entry point class. -->
+ <entry-point class='org.jboss.bpm.console.client.Application' />
- <!-- Specify a css to load into your gwt application -->
- <stylesheet src='console.css' />
- <stylesheet src="js/ext/resources/css/ext-all.css" />
+ <servlet path="/xhp" class="jmaki.xhp.XmlHttpProxyServlet"/>
- <script src="js/ext/adapter/ext/ext-base.js" />
- <script src="js/ext/ext-all.js" />
+ <!-- Specify a css to load into your gwt application -->
+ <stylesheet src='console.css' />
+ <stylesheet src="js/ext/resources/css/ext-all.css" />
+ <script src="js/ext/adapter/ext/ext-base.js" />
+ <script src="js/ext/ext-all.js" />
+
</module>
\ No newline at end of file
Added: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace.txt
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace.txt (rev 0)
+++ projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace.txt 2009-01-14 13:44:28 UTC (rev 3636)
@@ -0,0 +1,3 @@
+org.jboss.bpm.console.client.process.ProcessDefinitionListEditor
+org.jboss.bpm.console.client.task.TaskListEditor
+org.jboss.bpm.console.client.report.OverviewReportEditor
\ No newline at end of file
17 years, 3 months
JBoss JBPM SVN: r3635 - in jbpm3/trunk/modules: core/src/main/java/org/jbpm/command/impl and 2 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-01-14 00:51:14 -0500 (Wed, 14 Jan 2009)
New Revision: 3635
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/impl/CommandServiceImpl.java
jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/ejb/impl/CommandServiceBean.java
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java
Log:
adapt jta persistence test to exercise CMT as well as BMT
context not marked for rollback after exception in command service
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java 2009-01-13 18:22:21 UTC (rev 3634)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java 2009-01-14 05:51:14 UTC (rev 3635)
@@ -48,20 +48,19 @@
/**
* configuration of one jBPM instance.
- *
* <p>
- * During process execution, jBPM might need to use some services. A JbpmConfiguration contains the knowledge on how to
- * create those services.
+ * During process execution, jBPM might need to use some services. A JbpmConfiguration contains the
+ * knowledge on how to create those services.
* </p>
- *
* <p>
- * A JbpmConfiguration is a thread safe object and serves as a factory for {@link org.jbpm.JbpmContext}s, which means
- * one JbpmConfiguration can be used to create {@link org.jbpm.JbpmContext}s for all threads. The single
- * JbpmConfiguration can be maintained in a static member or in the JNDI tree if that is available.
+ * A JbpmConfiguration is a thread safe object and serves as a factory for
+ * {@link org.jbpm.JbpmContext}s, which means one JbpmConfiguration can be used to create
+ * {@link org.jbpm.JbpmContext}s for all threads. The single JbpmConfiguration can be maintained in
+ * a static member or in the JNDI tree if that is available.
* </p>
- *
* <p>
* A JbpmConfiguration can be obtained in following ways:
+ * </p>
* <ul>
* <li>from a resource (by default <code>jbpm.cfg.xml</code> is used):
*
@@ -69,7 +68,9 @@
* JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
* </pre>
*
+ * <p>
* or
+ * </p>
*
* <pre>
* String myXmlResource = "...";
@@ -88,8 +89,8 @@
* </pre>
*
* </li>
- * <li>By specifying a custom implementation of an object factory. This can be used to specify a JbpmConfiguration in
- * other bean-style notations such as used by JBoss Microcontainer or Spring.
+ * <li>By specifying a custom implementation of an object factory. This can be used to specify a
+ * JbpmConfiguration in other bean-style notations such as used by JBoss Microcontainer or Spring.
*
* <pre>
* ObjectFactory of = new <i>MyCustomObjectFactory</i>();
@@ -99,10 +100,9 @@
*
* </li>
* </ul>
- * </p>
- *
* <p>
- * JbpmConfigurations can be configured using a spring-like XML notation (in relax ng compact notation):
+ * JbpmConfigurations can be configured using a spring-like XML notation (in relax ng compact
+ * notation):
* </p>
*
* <pre>
@@ -234,20 +234,19 @@
* </pre>
*
* </p>
- *
* <p>
* Other configuration properties
+ * </p>
* <table>
* <tr>
* <td>jbpm.files.dir</td>
- * <td></td>
+ * <td/>
* </tr>
* <tr>
* <td>jbpm.types</td>
- * <td></td>
+ * <td/>
* </tr>
* </table>
- * </p>
*/
public class JbpmConfiguration implements Serializable
{
@@ -281,46 +280,37 @@
{
resource = "jbpm.cfg.xml";
}
-
- instance = (JbpmConfiguration)instances.get(resource);
+ instance = (JbpmConfiguration) instances.get(resource);
if (instance == null)
{
-
if (defaultObjectFactory != null)
{
log.debug("creating jbpm configuration from given default object factory '" + defaultObjectFactory + "'");
instance = new JbpmConfiguration(defaultObjectFactory);
-
}
else
{
-
try
{
log.info("using jbpm configuration resource '" + resource + "'");
InputStream jbpmCfgXmlStream = ClassLoaderUtil.getJbpmConfigurationStream(resource);
-
- // if a custom resource is to be used, but is not found in the
- // classpath
- // log a warning (otherwise, users who want to load custom stuff
- // will be confused if the resource is not found and not loaded,
- // without
- // any notice)
+ /*
+ * if a custom resource is to be used, but is not found in the classpath log a warning
+ * (otherwise, users who want to load custom stuff will be confused if the resource is
+ * not found and not loaded, without any notice)
+ */
if (jbpmCfgXmlStream == null && !"jbpm.cfg.xml".equals(resource))
{
log.warn("jbpm configuration resource '" + resource + "' is not available");
}
-
ObjectFactory objectFactory = parseObjectFactory(jbpmCfgXmlStream);
instance = createJbpmConfiguration(objectFactory);
-
}
catch (RuntimeException e)
{
throw new JbpmException("couldn't parse jbpm configuration from resource '" + resource + "'", e);
}
}
-
instances.put(resource, instance);
}
}
@@ -380,7 +370,7 @@
// now we make the bean jbpm.configuration always availble
if (objectFactory instanceof ObjectFactoryImpl)
{
- ObjectFactoryImpl objectFactoryImpl = (ObjectFactoryImpl)objectFactory;
+ ObjectFactoryImpl objectFactoryImpl = (ObjectFactoryImpl) objectFactory;
ObjectInfo jbpmConfigurationInfo = new ValueInfo("jbpmConfiguration", jbpmConfiguration);
objectFactoryImpl.addObjectInfo(jbpmConfigurationInfo);
@@ -400,7 +390,7 @@
return true;
}
Object object = objectFactory.createObject("jbpm.hide.stale.object.exceptions");
- return object instanceof Boolean ? ((Boolean)object).booleanValue() : true;
+ return object instanceof Boolean ? ((Boolean) object).booleanValue() : true;
}
public static JbpmConfiguration parseInputStream(InputStream inputStream)
@@ -429,7 +419,7 @@
public JbpmContext createJbpmContext(String name)
{
- JbpmContext jbpmContext = (JbpmContext)objectFactory.createObject(name);
+ JbpmContext jbpmContext = (JbpmContext) objectFactory.createObject(name);
jbpmContext.jbpmConfiguration = this;
jbpmContextCreated(jbpmContext);
return jbpmContext;
@@ -460,7 +450,7 @@
ProcessClassLoaderFactory factory = null;
if (Configs.hasObject("jbpm.processClassLoader"))
{
- factory = (ProcessClassLoaderFactory)Configs.getObject("jbpm.processClassLoader");
+ factory = (ProcessClassLoaderFactory) Configs.getObject("jbpm.processClassLoader");
}
else
{
@@ -509,22 +499,22 @@
public static String getString(String name)
{
- return (String)getObject(name);
+ return (String) getObject(name);
}
public static long getLong(String name)
{
- return ((Long)getObject(name)).longValue();
+ return ((Long) getObject(name)).longValue();
}
public static int getInt(String name)
{
- return ((Integer)getObject(name)).intValue();
+ return ((Integer) getObject(name)).intValue();
}
public static boolean getBoolean(String name)
{
- return ((Boolean)getObject(name)).booleanValue();
+ return ((Boolean) getObject(name)).booleanValue();
}
}
@@ -539,7 +529,8 @@
try
{
Services services = jbpmContext.getServices();
- DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory)services.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+ DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) services
+ .getServiceFactory(Services.SERVICENAME_PERSISTENCE);
persistenceServiceFactory.cleanSchema();
}
finally
@@ -559,7 +550,8 @@
try
{
Services services = jbpmContext.getServices();
- DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory)services.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+ DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) services
+ .getServiceFactory(Services.SERVICENAME_PERSISTENCE);
persistenceServiceFactory.createSchema();
}
finally
@@ -580,7 +572,8 @@
try
{
Services services = jbpmContext.getServices();
- DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory)services.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+ DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) services
+ .getServiceFactory(Services.SERVICENAME_PERSISTENCE);
persistenceServiceFactory.dropSchema();
}
finally
@@ -624,7 +617,7 @@
Iterator iter = serviceFactories.values().iterator();
while (iter.hasNext())
{
- ServiceFactory serviceFactory = (ServiceFactory)iter.next();
+ ServiceFactory serviceFactory = (ServiceFactory) iter.next();
serviceFactory.close();
}
}
@@ -641,14 +634,14 @@
Stack stack = getJbpmConfigurationStack();
if (!stack.isEmpty())
{
- currentJbpmConfiguration = (JbpmConfiguration)stack.peek();
+ currentJbpmConfiguration = (JbpmConfiguration) stack.peek();
}
return currentJbpmConfiguration;
}
static synchronized Stack getJbpmConfigurationStack()
{
- Stack stack = (Stack)jbpmConfigurationsStacks.get();
+ Stack stack = (Stack) jbpmConfigurationsStacks.get();
if (stack == null)
{
stack = new Stack();
@@ -673,14 +666,14 @@
Stack stack = getJbpmContextStack();
if (!stack.isEmpty())
{
- currentJbpmContext = (JbpmContext)stack.peek();
+ currentJbpmContext = (JbpmContext) stack.peek();
}
return currentJbpmContext;
}
Stack getJbpmContextStack()
{
- Stack stack = (Stack)jbpmContextStacks.get();
+ Stack stack = (Stack) jbpmContextStacks.get();
if (stack == null)
{
stack = new Stack();
@@ -699,12 +692,12 @@
Stack stack = getJbpmContextStack();
if (stack.isEmpty())
{
- throw new JbpmException("closed JbpmContext more then once... check your try-finally's around JbpmContexts blocks");
+ throw new JbpmException("closed JbpmContext more than once... check your try-finally's around JbpmContexts blocks");
}
- JbpmContext popped = (JbpmContext)stack.pop();
+ JbpmContext popped = (JbpmContext) stack.pop();
if (jbpmContext != popped)
{
- throw new JbpmException("closed JbpmContext in different order then they were created... check your try-finally's around JbpmContexts blocks");
+ throw new JbpmException("closed JbpmContext in some order that differs from creation... check your try-finally's around JbpmContexts blocks");
}
}
@@ -731,11 +724,12 @@
{
try
{
- jobExecutor = (JobExecutor)this.objectFactory.createObject("jbpm.job.executor");
+ jobExecutor = (JobExecutor) this.objectFactory.createObject("jbpm.job.executor");
}
catch (ClassCastException e)
{
- throw new JbpmException("jbpm configuration object under key 'jbpm.job.executor' is not a " + JobExecutor.class.getName(), e);
+ throw new JbpmException("jbpm configuration object under key 'jbpm.job.executor' is not a "
+ + JobExecutor.class.getName(), e);
}
}
return jobExecutor;
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/impl/CommandServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/impl/CommandServiceImpl.java 2009-01-13 18:22:21 UTC (rev 3634)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/impl/CommandServiceImpl.java 2009-01-14 05:51:14 UTC (rev 3635)
@@ -35,17 +35,20 @@
* Provide services for accessing the jBPM engine. Access is currently provided through a set of
* {@link org.jbpm.command.Command} derived operations.
*
- * @author Jim Rigsbee, Tom Baeyens
+ * @author Jim Rigsbee
+ * @author Tom Baeyens
*/
public class CommandServiceImpl implements CommandService, Serializable
{
+
+ protected final JbpmConfiguration jbpmConfiguration;
+
private static final long serialVersionUID = 1L;
- protected JbpmConfiguration jbpmConfiguration = null;
-
/**
- * Establish an instance of the command service with a particular jBPM configuration which provides connectivity to
- * the jBPM engine and its related services including the persistence manager.
+ * Establish an instance of the command service with a particular jBPM configuration which
+ * provides connectivity to the jBPM engine and its related services including the persistence
+ * manager.
*
* @param jbpmConfiguration jBPM Configuration
*/
@@ -55,29 +58,34 @@
}
/**
- * Executes command based on its current context. Each command contains the appropriate context information such as
- * token, process instance, etc. to insure that the operation is carried out on the proper graph object.
+ * Executes command based on its current context. Each command contains the appropriate context
+ * information such as token, process instance, etc. to insure that the operation is carried out
+ * on the proper graph object.
*
* @param command jBPM engine command to execute
*/
public Object execute(Command command)
{
- Object result = null;
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try
{
log.debug("executing " + command);
- result = command.execute(jbpmContext);
+ return command.execute(jbpmContext);
}
+ catch (RuntimeException e)
+ {
+ jbpmContext.setRollbackOnly();
+ throw e;
+ }
catch (Exception e)
{
- throw new JbpmException("couldn't execute " + command, e);
+ jbpmContext.setRollbackOnly();
+ throw new JbpmException("failed to execute " + command, e);
}
finally
{
jbpmContext.close();
}
- return result;
}
private static final Log log = LogFactory.getLog(CommandServiceImpl.class);
Modified: jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/ejb/impl/CommandServiceBean.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/ejb/impl/CommandServiceBean.java 2009-01-13 18:22:21 UTC (rev 3634)
+++ jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/ejb/impl/CommandServiceBean.java 2009-01-14 05:51:14 UTC (rev 3635)
@@ -37,18 +37,15 @@
import org.jbpm.command.CommandService;
import org.jbpm.msg.jms.JmsMessageServiceFactory;
import org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory;
-import org.jbpm.tx.TxService;
/**
- * Stateless session bean that executes {@linkplain Command commands} by
- * calling their {@link Command#execute(JbpmContext) execute} method on
- * a separate {@link JbpmContext jBPM context}.
- *
- * <h3>Environment</h3>
- *
- * <p>The environment entries and resources available for customization are
- * summarized in the table below.</p>
- *
+ * Stateless session bean that executes {@linkplain Command commands} by calling their
+ * {@link Command#execute(JbpmContext) execute} method on a separate {@link JbpmContext jBPM
+ * context}. <h3>Environment</h3>
+ * <p>
+ * The environment entries and resources available for customization are summarized in the table
+ * below.
+ * </p>
* <table border="1">
* <tr>
* <th>Name</th>
@@ -58,44 +55,36 @@
* <tr>
* <td><code>JbpmCfgResource</code></td>
* <td>Environment Entry</td>
- * <td>The classpath resource from which to read the {@linkplain
- * JbpmConfiguration jBPM configuration}. Optional, defaults to <code>
- * jbpm.cfg.xml</code>.
- * </td>
+ * <td>The classpath resource from which to read the {@linkplain JbpmConfiguration jBPM
+ * configuration}. Optional, defaults to <code>jbpm.cfg.xml</code>.</td>
* </tr>
* <tr>
* <td><code>ejb/TimerEntityBean</code></td>
* <td>EJB Reference</td>
- * <td>Link to the local {@linkplain TimerEntityBean entity bean} that
- * implements the scheduler service. Required for processes that contain
- * timers.
- * </td>
+ * <td>Link to the local {@linkplain TimerEntityBean entity bean} that implements the scheduler
+ * service. Required for processes that contain timers.</td>
* </tr>
* <tr>
* <td><code>jdbc/JbpmDataSource</code></td>
* <td>Resource Manager Reference</td>
* <td>Logical name of the data source that provides JDBC connections to the
- * {@linkplain JtaDbPersistenceServiceFactory persistence service}. Must match
- * the <code>hibernate.connection.datasource</code> property in the Hibernate
- * configuration file.
- * </td>
+ * {@linkplain JtaDbPersistenceServiceFactory persistence service}. Must match the
+ * <code>hibernate.connection.datasource</code> property in the Hibernate configuration file.</td>
* </tr>
* <tr>
* <td><code>jms/JbpmConnectionFactory</code></td>
* <td>Resource Manager Reference</td>
- * <td>Logical name of the factory that provides JMS connections to the
- * {@linkplain JmsMessageServiceFactory message service}. Required for
- * processes that contain asynchronous continuations.
- * </td>
+ * <td>Logical name of the factory that provides JMS connections to the
+ * {@linkplain JmsMessageServiceFactory message service}. Required for processes that contain
+ * asynchronous continuations.</td>
* </tr>
* <tr>
* <td><code>jms/JobQueue</code></td>
* <td>Message Destination Reference</td>
- * <td>The message service sends job messages to the queue referenced here.
- * To ensure this is the same queue from which the {@linkplain JobListenerBean
- * job listener bean} receives messages, the <code>message-destination-link
- * </code> points to a common logical destination, <code>JobQueue</code>.
- * </td>
+ * <td>The message service sends job messages to the queue referenced here. To ensure this is the
+ * same queue from which the {@linkplain JobListenerBean job listener bean} receives messages, the
+ * <code>message-destination-link
+ * </code> points to a common logical destination, <code>JobQueue</code>.</td>
* </tr>
* </table>
*
@@ -103,75 +92,87 @@
* @author Tom Baeyens
* @author Alejandro Guizar
*/
-public class CommandServiceBean implements SessionBean, CommandService {
+public class CommandServiceBean implements SessionBean, CommandService
+{
+ private SessionContext sessionContext;
+ private JbpmConfiguration jbpmConfiguration;
+
private static final long serialVersionUID = 1L;
+ private static final Log log = LogFactory.getLog(CommandServiceBean.class);
- JbpmConfiguration jbpmConfiguration = null;
- SessionContext sessionContext = null;
-
- /**
- * creates a command service that will be used to execute the commands that
- * are passed in the execute method. The command service will be build by
- * creating a jbpm configuration. In case the environment key JbpmCfgResource
- * is specified for this bean, that value will be used to resolve the jbpm
- * configuration file as a resource. If that key is not configured, the default
- * jbpm configuration file will be used (jbpm.cfg.xml).
- */
- public void ejbCreate() throws CreateException {
- String jbpmCfgResource = null;
- try {
- log.debug("getting jbpm configuration resource from the environment properties");
- Context initial = new InitialContext();
- jbpmCfgResource = (String) initial.lookup("java:comp/env/JbpmCfgResource");
- } catch (NamingException e) {
- log.debug("couldn't find configuration property JbpmCfgResource through JNDI");
- }
-
- if (log.isDebugEnabled()) {
- if (jbpmCfgResource==null) {
- log.debug("getting default jbpm configuration resource (jbpm.cfg.xml)");
- } else {
- log.debug("getting jbpm configuration from resource "+jbpmCfgResource);
- }
- }
-
- jbpmConfiguration = JbpmConfiguration.getInstance(jbpmCfgResource);
- }
-
- public Object execute(Command command) {
- Object result = null;
+ public Object execute(Command command)
+ {
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try {
+ try
+ {
log.debug("executing " + command);
- result = command.execute(jbpmContext);
- // check whether command requested a rollback
- TxService txService = jbpmContext.getServices().getTxService();
- if (txService.isRollbackOnly()) {
- sessionContext.setRollbackOnly();
- }
- } catch (RuntimeException e) {
+ return command.execute(jbpmContext);
+ }
+ catch (RuntimeException e)
+ {
+ sessionContext.setRollbackOnly();
throw e;
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
+ sessionContext.setRollbackOnly();
throw new JbpmException("failed to execute " + command, e);
- } finally {
+ }
+ finally
+ {
jbpmContext.close();
}
- return result;
}
- public void setSessionContext(SessionContext sessionContext) {
+ public void setSessionContext(SessionContext sessionContext)
+ {
this.sessionContext = sessionContext;
}
- public void ejbRemove() {
+ /**
+ * Creates a command service that will execute the commands passed to the execute method. The
+ * command service will be build by creating a jBPM configuration.
+ */
+ public void ejbCreate() throws CreateException
+ {
+ try
+ {
+ String resource = lookup("java:comp/env/JbpmCfgResource");
+ jbpmConfiguration = resource != null ? JbpmConfiguration.getInstance(resource)
+ : JbpmConfiguration.getInstance();
+ }
+ catch (NamingException e)
+ {
+ log.debug("could not retrieve configuration resource from environment, using default", e);
+ jbpmConfiguration = JbpmConfiguration.getInstance();
+ }
+ }
+
+ private static <T> T lookup(String name) throws NamingException
+ {
+ Context initial = new InitialContext();
+ try
+ {
+ return (T) initial.lookup(name);
+ }
+ finally
+ {
+ initial.close();
+ }
+ }
+
+ public void ejbRemove()
+ {
sessionContext = null;
jbpmConfiguration = null;
}
- public void ejbActivate() {}
+ public void ejbActivate()
+ {
+ }
- public void ejbPassivate() {}
-
- private static final Log log = LogFactory.getLog(CommandServiceBean.class);
+ public void ejbPassivate()
+ {
+ }
}
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java 2009-01-13 18:22:21 UTC (rev 3634)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java 2009-01-14 05:51:14 UTC (rev 3635)
@@ -24,61 +24,81 @@
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import javax.transaction.UserTransaction;
import junit.framework.Test;
import org.apache.cactus.ServletTestCase;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
+import org.jboss.bpm.api.test.IntegrationTestSetup;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
-import org.jboss.bpm.api.test.IntegrationTestSetup;
import org.jbpm.command.Command;
+import org.jbpm.command.CommandService;
import org.jbpm.command.DeleteProcessDefinitionCommand;
import org.jbpm.command.DeployProcessCommand;
import org.jbpm.command.GetProcessInstanceCommand;
import org.jbpm.command.StartProcessInstanceCommand;
+import org.jbpm.command.impl.CommandServiceImpl;
+import org.jbpm.ejb.LocalCommandServiceHome;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.persistence.jta.JtaDbPersistenceService;
public class JtaDbPersistenceTest extends ServletTestCase {
- private CommandExecutor commandExecutor;
+ private CommandService commandService;
+ private static LocalCommandServiceHome commandServiceHome;
+ private static final Log log = LogFactory.getLog(JtaDbPersistenceTest.class);
+
public static Test suite() throws Exception {
return new IntegrationTestSetup(JtaDbPersistenceTest.class, "enterprise-test.war");
}
- public void testExternalTx() throws Exception {
- commandExecutor = new CommandExecutor(getUserTransaction());
+ protected void setUp() throws Exception {
+ log.info("### " + getName() + " started ###");
+ }
+
+ protected void tearDown() throws Exception {
+ log.info("### " + getName() + " done ###");
+ }
+
+ public void testCMTSuccess() throws Exception {
+ commandService = getCommandServiceHome().create();
playTx(false);
}
- public void testExternalTxRollback() throws Exception {
- commandExecutor = new CommandExecutor(getUserTransaction());
+ public void testCMTFailure() throws Exception {
+ commandService = getCommandServiceHome().create();
playTx(true);
}
- public void testInternalTx() throws Exception {
- commandExecutor = new CommandExecutor();
+ public void testBMTSuccess() throws Exception {
+ commandService = new CommandServiceImpl(JbpmConfiguration.getInstance());
playTx(false);
}
- public void testInternalTxRollback() throws Exception {
- commandExecutor = new CommandExecutor();
+ public void testBMTFailure() throws Exception {
+ commandService = new CommandServiceImpl(JbpmConfiguration.getInstance());
playTx(true);
}
- private void playTx(boolean rollback) throws Exception {
+ private void playTx(boolean fail) throws Exception {
long definitionId = deployProcess();
long instanceId = launchProcess(definitionId);
- signal(instanceId, rollback);
- assertEquals(!rollback, hasEnded(instanceId));
+ try {
+ signal(instanceId, fail);
+ }
+ catch (RuntimeException e) {
+ log.debug("signal failed on process instance #" + instanceId, e);
+ }
+ assertEquals(!fail, hasEnded(instanceId));
deleteProcess(definitionId);
}
private long deployProcess() throws Exception {
- ProcessDefinition definition = (ProcessDefinition) commandExecutor
+ ProcessDefinition definition = (ProcessDefinition) commandService
.execute(new DeployProcessCommand("<process-definition name='tx'>"
+ " <start-state name='start'>"
+ " <transition to='midway' />"
@@ -92,97 +112,44 @@
}
private long launchProcess(long definitionId) throws Exception {
- ProcessInstance instance = (ProcessInstance) commandExecutor
+ ProcessInstance instance = (ProcessInstance) commandService
.execute(new StartProcessInstanceCommand().processDefinitionId(definitionId));
return instance.getId();
}
- private void signal(final long instanceId, boolean rollback) throws Exception {
- commandExecutor.execute(new Command() {
+ private void signal(final long instanceId, final boolean fail) throws Exception {
+ commandService.execute(new Command() {
private static final long serialVersionUID = 1L;
public Object execute(JbpmContext jbpmContext) throws Exception {
jbpmContext.loadProcessInstance(instanceId).signal();
+ if (fail)
+ throw new HibernateException("simulated failure");
return null;
}
- }, rollback);
+ });
}
private boolean hasEnded(long instanceId) throws Exception {
- ProcessInstance instance = (ProcessInstance) commandExecutor
+ ProcessInstance instance = (ProcessInstance) commandService
.execute(new GetProcessInstanceCommand(instanceId));
return instance.hasEnded();
}
private void deleteProcess(long definitionId) throws Exception {
- commandExecutor.execute(new DeleteProcessDefinitionCommand(definitionId));
+ commandService.execute(new DeleteProcessDefinitionCommand(definitionId));
}
- static class CommandExecutor {
-
- private JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
- private UserTransaction tx;
-
- public CommandExecutor() {
- }
-
- public CommandExecutor(UserTransaction userTransaction) {
- tx = userTransaction;
- }
-
- public Object execute(Command command) throws Exception {
- return execute(command, false);
- }
-
- public Object execute(Command command, boolean rollback) throws Exception {
- if (tx != null)
- tx.begin();
+ private static LocalCommandServiceHome getCommandServiceHome() throws NamingException {
+ if (commandServiceHome == null) {
+ Context initial = new InitialContext();
try {
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- Object result;
- try {
- assertEquals(tx == null, isTxCreatedByService(jbpmContext));
- result = command.execute(jbpmContext);
- if (rollback && tx == null)
- jbpmContext.setRollbackOnly();
- }
- catch (RuntimeException e) {
- if (tx == null)
- jbpmContext.setRollbackOnly();
- throw e;
- }
- finally {
- jbpmContext.close();
- }
- if (tx != null) {
- if (rollback)
- tx.rollback();
- else
- tx.commit();
- }
- return result;
+ return (LocalCommandServiceHome) initial.lookup("java:comp/env/ejb/CommandServiceBean");
}
- catch (Exception e) {
- if (tx != null)
- tx.rollback();
- throw e;
+ finally {
+ initial.close();
}
}
+ return commandServiceHome;
}
-
- private static boolean isTxCreatedByService(JbpmContext jbpmContext) {
- JtaDbPersistenceService persistenceService = (JtaDbPersistenceService) jbpmContext
- .getServices().getPersistenceService();
- return persistenceService.isJtaTxCreated();
- }
-
- private static UserTransaction getUserTransaction() throws NamingException {
- Context initial = new InitialContext();
- try {
- return (UserTransaction) initial.lookup("java:comp/UserTransaction");
- }
- finally {
- initial.close();
- }
- }
}
17 years, 3 months
JBoss JBPM SVN: r3634 - in jbpm4/trunk: modules/api/src/main/java/org/jbpm and 18 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-01-13 13:22:21 -0500 (Tue, 13 Jan 2009)
New Revision: 3634
Added:
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/HappyListener.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/NoisyListener.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/enterprise/EnvironmentServletTestCase.java
jbpm4/trunk/modules/enterprise/src/test/resources/log4j.xml
Removed:
jbpm4/trunk/modules/enterprise/scripts/assembly-config.xml
jbpm4/trunk/modules/enterprise/src/main/etc/
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/HappyActivity.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/NoisyActivity.java
jbpm4/trunk/modules/enterprise/src/test/resources/logging.properties
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/builder/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/display/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/
jbpm4/trunk/modules/pvm/src/test/resources/enterprise/
Modified:
jbpm4/trunk/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java
jbpm4/trunk/modules/enterprise/pom.xml
jbpm4/trunk/modules/enterprise/scripts/antrun-test-jars.xml
jbpm4/trunk/modules/enterprise/scripts/assembly-test-dependencies.xml
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/EjbLocalCommandServiceBinding.java
jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/ejb-jar.xml
jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/jboss.xml
jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/jbosscmp-jdbc.xml
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java
jbpm4/trunk/modules/enterprise/src/test/resources/WEB-INF/jboss-web.xml
jbpm4/trunk/modules/enterprise/src/test/resources/WEB-INF/web.xml
jbpm4/trunk/modules/enterprise/src/test/resources/environment.cfg.xml
jbpm4/trunk/modules/enterprise/src/test/resources/hibernate.properties
jbpm4/trunk/modules/log/src/main/java/org/jbpm/log/Log.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/util/XmlUtil.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml
jbpm4/trunk/pom.xml
Log:
fix enterprise module
JBPM-1957
Property changes on: jbpm4/trunk
___________________________________________________________________
Name: svn:ignore
- .settings
profiles.xml
+ .settings
profiles.xml
target
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -70,6 +70,7 @@
Deployment addDirectoryCanonical(String directory);
Deployment addDirectory(File directory);
Deployment addDirectoryCanonical(File directory);
+ Deployment addObject(String name, Object object);
Deployment setFileType(String fileName, String fileType);
Modified: jbpm4/trunk/modules/enterprise/pom.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/pom.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/pom.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -41,36 +41,17 @@
<version>${version}</version>
</dependency>
- <!-- Provided Dependencies -->
+ <!-- Test Dependencies -->
<dependency>
- <groupId>org.apache.cactus</groupId>
- <artifactId>cactus.core.framework.wrapper.javaEE.14</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <artifactId>org.mortbay.jetty</artifactId>
- <groupId>org.mortbay.jetty</groupId>
- </exclusion>
- </exclusions>
+ <groupId>cactus</groupId>
+ <artifactId>cactus</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.cactus</groupId>
- <artifactId>cactus.integration.shared.api</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <artifactId>org.mortbay.jetty</artifactId>
- <groupId>org.mortbay.jetty</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.jboss.client</groupId>
<artifactId>jbossall-client</artifactId>
- <scope>test</scope>
+ <scope>runtime</scope>
</dependency>
-
- <!-- Test Dependencies -->
</dependencies>
<!-- Plugins -->
@@ -94,21 +75,6 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
- <id>assembly-config</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <finalName>${project.build.finalName}</finalName>
- <appendAssemblyId>true</appendAssemblyId>
- <descriptors>
- <descriptor>scripts/assembly-config.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
-
- <execution>
<id>assembly-test-dependencies</id>
<phase>generate-test-resources</phase>
<goals>
Modified: jbpm4/trunk/modules/enterprise/scripts/antrun-test-jars.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/scripts/antrun-test-jars.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/scripts/antrun-test-jars.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -33,14 +33,15 @@
<jar destfile="${build.dir}/test-libs/jbpm-enterprise-test.jar">
<fileset dir="${build.dir}/test-classes">
+ <include name="environment.cfg.xml" />
+ <include name="hibernate.properties" />
<include name="org/jbpm/enterprise/internal/custom/*" />
</fileset>
</jar>
<ear destfile="${build.dir}/test-libs/jbpm-enterprise-test.ear" appxml="${test.resources.dir}/META-INF/application.xml">
- <!-- artifacts -->
+ <!-- build artifact -->
<fileset dir="${build.dir}" includes="${build.finalName}.jar" />
- <zipfileset dir="${build.dir}" includes="${build.finalName}-config.jar" prefix="lib" />
<!-- test modules -->
<fileset dir="${build.dir}/test-libs" includes="jbpm-enterprise-test.war" />
<zipfileset dir="${build.dir}/test-libs" includes="jbpm-enterprise-test.jar" prefix="lib" />
Deleted: jbpm4/trunk/modules/enterprise/scripts/assembly-config.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/scripts/assembly-config.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/scripts/assembly-config.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -1,21 +0,0 @@
-<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
-
- <id>config</id>
- <formats>
- <format>jar</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <fileSets>
- <fileSet>
- <directory>src/test/resources</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>environment.cfg.xml</include>
- <include>hibernate.properties</include>
- </includes>
- </fileSet>
- </fileSets>
-
-</assembly>
\ No newline at end of file
Modified: jbpm4/trunk/modules/enterprise/scripts/assembly-test-dependencies.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/scripts/assembly-test-dependencies.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/scripts/assembly-test-dependencies.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -14,10 +14,7 @@
<useStrictFiltering>true</useStrictFiltering>
<includes>
<include>aspectj:aspectjrt:jar</include>
- <include>org.apache.cactus:cactus.integration.shared.api</include>
- <include>org.apache.cactus:cactus.core.framework.wrapper.javaEE.14</include>
- <include>org.apache.cactus:cactus.core.framework.javaEE.13-14</include>
- <include>org.apache.cactus:cactus.core.framework.javaEE.12-13-14</include>
+ <include>cactus:cactus</include>
<include>junit:junit</include>
<include>org.jbpm.jbpm4:jbpm-api</include>
<include>org.jbpm.jbpm4:jbpm-pvm</include>
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -205,7 +205,7 @@
try {
Context context = new InitialContext();
LocalCommandExecutorHome commandExecutorHome = (LocalCommandExecutorHome) context.lookup("java:comp/env/ejb/LocalCommandExecutor");
- ConnectionFactory jmsConnectionFactory = (ConnectionFactory) context.lookup("java:comp/env/jms/CommandConnectionFactory");
+ ConnectionFactory jmsConnectionFactory = (ConnectionFactory) context.lookup("java:comp/env/jms/JbpmConnectionFactory");
try {
deadLetterQueue = (Destination) context.lookup("java:comp/env/jms/DeadLetterQueue");
}
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/TimerEB.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -37,6 +37,7 @@
import javax.naming.NamingException;
import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.job.TimerImpl;
/**
* @author Tom Baeyens
@@ -67,10 +68,7 @@
}
private void schedule(Date dueDate) {
- log.debug("registering timer #"
- + getDbid()
- + " due "
- + org.jbpm.pvm.internal.job.TimerImpl.formatDueDate(dueDate));
+ log.debug("registering timer #" + getDbid() + " due " + TimerImpl.formatDueDate(dueDate));
TimerService timerService = entityContext.getTimerService();
timerService.createTimer(dueDate, null);
}
@@ -90,9 +88,10 @@
public void ejbActivate() throws RemoteException {
try {
Context context = new InitialContext();
- LocalCommandExecutorHome commandExecutorHome = (LocalCommandExecutorHome) context.lookup("java:comp/env/ejb/LocalCommandExecutor");
+ LocalCommandExecutorHome commandExecutorHome = (LocalCommandExecutorHome) context
+ .lookup("java:comp/env/ejb/LocalCommandExecutor");
context.close();
-
+
commandExecutor = commandExecutorHome.create();
}
catch (NamingException e) {
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/EjbLocalCommandServiceBinding.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/EjbLocalCommandServiceBinding.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/EjbLocalCommandServiceBinding.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -22,6 +22,7 @@
package org.jbpm.enterprise.internal.wire.binding;
import org.jbpm.enterprise.internal.ejb.EjbLocalCommandService;
+import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.binding.WireDescriptorBinding;
import org.jbpm.pvm.internal.wire.descriptor.JndiDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
@@ -39,10 +40,15 @@
}
public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor descriptor = new ObjectDescriptor(
- EjbLocalCommandService.class);
- descriptor.addInjection("commandExecutorHome", new JndiDescriptor(
- "java:comp/env/ejb/LocalCommandExecutor"));
+ ObjectDescriptor descriptor = new ObjectDescriptor(EjbLocalCommandService.class);
+ // retrieve home name
+ String homeJndiName = "java:comp/env/ejb/LocalCommandExecutor";
+ Element homeElement = XmlUtil.element(element, "home");
+ if (homeElement != null && homeElement.hasAttribute("jndi-name")) {
+ homeJndiName = homeElement.getAttribute("jndi-name");
+ }
+ // inject home name
+ descriptor.addInjection("commandExecutorHome", new JndiDescriptor(homeJndiName));
return descriptor;
}
Modified: jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/ejb-jar.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/ejb-jar.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -11,8 +11,8 @@
<enterprise-beans>
<session>
- <description>JBoss jBPM Command Executor SLSB</description>
- <display-name>JBoss jBPM Command Executor SLSB</display-name>
+ <description>Executes commands in a separate context.</description>
+ <display-name>jBPM Command Executor</display-name>
<ejb-name>CommandExecutor</ejb-name>
<home>org.jbpm.enterprise.internal.ejb.RemoteCommandExecutorHome</home>
<remote>org.jbpm.enterprise.internal.ejb.RemoteCommandExecutor</remote>
@@ -21,35 +21,90 @@
<ejb-class>org.jbpm.enterprise.internal.ejb.CommandExecutorSLSB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
+
<ejb-local-ref>
+ <description>
+ Link to the local entity bean that implements the timer session.
+ Required for that contain timers.
+ </description>
<ejb-ref-name>ejb/LocalTimer</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>org.jbpm.enterprise.internal.ejb.LocalTimerHome</local-home>
<local>org.jbpm.enterprise.internal.ejb.LocalTimer</local>
<ejb-link>Timer</ejb-link>
</ejb-local-ref>
+
+ <resource-ref>
+ <description>
+ Logical name of the data source that provides connections to the database session.
+ Must match the hibernate.connection.datasource property.
+ </description>
+ <res-ref-name>jdbc/JbpmDataSource</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+
+ <resource-ref>
+ <description>
+ Logical name of the factory that provides JMS connections to the message session.
+ Required for processes that contain asynchronous continuations.
+ </description>
+ <res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
+ <res-type>javax.jms.ConnnectionFactory</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+
+ <message-destination-ref>
+ <description>
+ The command listener bean receives messages from the queue referenced here. To ensure this
+ is the same queue to which command messages can be sent, the message-destination-link
+ element points to a common logical destination, CommandQueue.
+ </description>
+ <message-destination-ref-name>jms/CommandQueue</message-destination-ref-name>
+ <message-destination-type>javax.jms.Queue</message-destination-type>
+ <message-destination-usage>Produces</message-destination-usage>
+ <message-destination-link>CommandQueue</message-destination-link>
+ </message-destination-ref>
</session>
<message-driven>
- <description>JBoss jBPM Command Receiver MDB</description>
+ <description>
+ Listens for serialized commands and routes them to the command executor.
+ </description>
+ <display-name>jBPM Command Receiver</display-name>
<ejb-name>CommandReceiver</ejb-name>
<ejb-class>org.jbpm.enterprise.internal.ejb.CommandReceiverMDB</ejb-class>
<transaction-type>Container</transaction-type>
<message-destination-type>javax.jms.Queue</message-destination-type>
+ <message-destination-link>CommandQueue</message-destination-link>
+
<ejb-local-ref>
+ <description>
+ Link to the local session bean that executes commands on a separate environment.
+ </description>
<ejb-ref-name>ejb/LocalCommandExecutor</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>org.jbpm.enterprise.internal.ejb.LocalCommandExecutorHome</local-home>
<local>org.jbpm.enterprise.internal.ejb.LocalCommandExecutor</local>
<ejb-link>CommandExecutor</ejb-link>
</ejb-local-ref>
+
<resource-ref>
- <res-ref-name>jms/CommandConnectionFactory</res-ref-name>
+ <description>
+ Logical name of the factory that provides JMS connections for producing result messages.
+ Required for command messages that indicate a reply destination.
+ </description>
+ <res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
+
<message-destination-ref>
+ <description>
+ Messages that do not contain a command are sent to the queue referenced here.
+ If absent, said messages are rejected, which may cause the container to redeliver.
+ </description>
<message-destination-ref-name>jms/DeadLetterQueue</message-destination-ref-name>
<message-destination-type>javax.jms.Queue</message-destination-type>
<message-destination-usage>Produces</message-destination-usage>
@@ -57,7 +112,8 @@
</message-driven>
<entity>
- <display-name>JBoss jBPM Timer EB</display-name>
+ <description>Interacts with the EJB timer service to schedule jBPM timers.</description>
+ <display-name>jBPM Timer</display-name>
<ejb-name>Timer</ejb-name>
<local-home>org.jbpm.enterprise.internal.ejb.LocalTimerHome</local-home>
<local>org.jbpm.enterprise.internal.ejb.LocalTimer</local>
@@ -74,12 +130,14 @@
<field-name>dueDate</field-name>
</cmp-field>
<!--
- <cmp-field>
+ <cmp-field>
<field-name>dbversion</field-name>
- </cmp-field>
+ </cmp-field>
-->
<primkey-field>dbid</primkey-field>
+
<ejb-local-ref>
+ <description>Link to the session bean that executes timers on a separate environment.</description>
<ejb-ref-name>ejb/LocalCommandExecutor</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>org.jbpm.enterprise.internal.ejb.LocalCommandExecutorHome</local-home>
@@ -116,6 +174,10 @@
<trans-attribute>Required</trans-attribute>
</container-transaction>
+ <message-destination>
+ <message-destination-name>CommandQueue</message-destination-name>
+ </message-destination>
+
</assembly-descriptor>
</ejb-jar>
Modified: jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/jboss.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/jboss.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/jboss.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -10,13 +10,20 @@
<ejb-name>CommandExecutor</ejb-name>
<jndi-name>jbpm/CommandExecutor</jndi-name>
<local-jndi-name>java:jbpm/CommandExecutor</local-jndi-name>
+ <resource-ref>
+ <res-ref-name>jdbc/JbpmDataSource</res-ref-name>
+ <jndi-name>java:DefaultDS</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
+ <jndi-name>java:JmsXA</jndi-name>
+ </resource-ref>
</session>
<message-driven>
<ejb-name>CommandReceiver</ejb-name>
- <destination-jndi-name>queue/JbpmCommandQueue</destination-jndi-name>
<resource-ref>
- <res-ref-name>jms/CommandConnectionFactory</res-ref-name>
+ <res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
<jndi-name>java:JmsXA</jndi-name>
</resource-ref>
<message-destination-ref>
@@ -32,4 +39,13 @@
</enterprise-beans>
+ <assembly-descriptor>
+
+ <message-destination>
+ <message-destination-name>CommandQueue</message-destination-name>
+ <jndi-name>queue/tSestQueue</jndi-name>
+ </message-destination>
+
+ </assembly-descriptor>
+
</jboss>
Modified: jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/jbosscmp-jdbc.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/jbosscmp-jdbc.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/jbosscmp-jdbc.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -4,15 +4,13 @@
<jbosscmp-jdbc>
<defaults>
<datasource>java:DefaultDS</datasource>
- <datasource-mapping>Hypersonic SQL</datasource-mapping>
<create-table>false</create-table>
+ <remove-table>false</remove-table>
+ <pk-constraint>false</pk-constraint>
</defaults>
<enterprise-beans>
<entity>
<ejb-name>Timer</ejb-name>
- <!--
- <read-only>true</read-only>
- -->
<table-name>JBPM_JOB</table-name>
<cmp-field>
<field-name>dbid</field-name>
Deleted: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/HappyActivity.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/HappyActivity.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/HappyActivity.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -1,66 +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.enterprise.internal.custom;
-
-import java.util.Date;
-
-import org.jbpm.activity.Activity;
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.job.TimerImpl;
-
-/**
- * @author Alejandro Guizar
- */
-public class HappyActivity implements Activity {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log = Log.getLog(HappyActivity.class.getName());
- private static final Object lock = new Object();
- private static Date executionDate;
-
- public void execute(ActivityExecution execution) throws Exception {
- executionDate = new Date();
- log.info("executing on " + TimerImpl.formatDueDate(executionDate));
-
- synchronized (lock) {
- lock.notify();
- }
- }
-
- public static Date waitFor() {
- return waitFor(60000);
- }
-
- public static Date waitFor(long timeout) {
- executionDate = null;
- synchronized (lock) {
- try {
- lock.wait(timeout);
- } catch (InterruptedException e) {
- log.info("wait interrupted");
- }
- }
- return executionDate;
- }
-}
Copied: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/HappyListener.java (from rev 3612, jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/HappyActivity.java)
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/HappyListener.java (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/HappyListener.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -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.enterprise.internal.custom;
+
+import java.util.Date;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+import org.jbpm.listener.EventListener;
+import org.jbpm.listener.EventListenerExecution;
+import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.job.TimerImpl;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class HappyListener implements EventListener {
+
+ private static Date executionDate;
+ private static Semaphore semaphore = new Semaphore(0);
+
+ private static final long serialVersionUID = 1L;
+ private static final Log log = Log.getLog(HappyListener.class.getName());
+
+ public void notify(EventListenerExecution execution) throws Exception {
+ executionDate = new Date();
+ log.info("executing on " + TimerImpl.formatDueDate(executionDate));
+
+ semaphore.release();
+ }
+
+ public static Date waitFor() {
+ return waitFor(10000);
+ }
+
+ public static Date waitFor(long timeout) {
+ executionDate = null;
+ try {
+ semaphore.tryAcquire(timeout, TimeUnit.MILLISECONDS);
+ }
+ catch (InterruptedException e) {
+ log.info("wait interrupted");
+ }
+ return executionDate;
+ }
+}
Property changes on: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/HappyListener.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/NoisyActivity.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/NoisyActivity.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/NoisyActivity.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -1,67 +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.enterprise.internal.custom;
-
-import java.sql.SQLException;
-import java.util.Date;
-
-import org.jbpm.activity.Activity;
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.job.TimerImpl;
-
-/**
- * @author Alejandro Guizar
- */
-public class NoisyActivity implements Activity {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log = Log.getLog(NoisyActivity.class.getName());
- private static final Object lock = new Object();
- private static Date executionDate;
-
- public void execute(ActivityExecution execution) throws Exception {
- executionDate = new Date();
- log.info("executing on " + TimerImpl.formatDueDate(executionDate));
-
- execution.setVariable("executionDate", executionDate);
-
- synchronized (lock) {
- lock.notify();
- }
-
- throw new SQLException("simulated failure");
- }
-
- public static Date waitFor() {
- executionDate = null;
- synchronized (lock) {
- try {
- lock.wait(60000);
- } catch (InterruptedException e) {
- log.info("wait interrupted");
- }
- }
- return executionDate;
- }
-}
Copied: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/NoisyListener.java (from rev 3612, jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/NoisyActivity.java)
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/NoisyListener.java (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/NoisyListener.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -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.enterprise.internal.custom;
+
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+import org.jbpm.listener.EventListener;
+import org.jbpm.listener.EventListenerExecution;
+import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.job.TimerImpl;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class NoisyListener implements EventListener {
+
+ private static Date executionDate;
+ private static Semaphore semaphore = new Semaphore(0);
+
+ private static final long serialVersionUID = 1L;
+ private static final Log log = Log.getLog(NoisyListener.class.getName());
+
+ public void notify(EventListenerExecution execution) throws Exception {
+ executionDate = new Date();
+ execution.setVariable("executionDate", executionDate);
+ log.info("executing on " + TimerImpl.formatDueDate(executionDate));
+
+ semaphore.release();
+
+ throw new SQLException("simulated failure");
+ }
+
+ public static Date waitFor() {
+ executionDate = null;
+ try {
+ semaphore.tryAcquire(10000, TimeUnit.MILLISECONDS);
+ }
+ catch (InterruptedException e) {
+ log.info("wait interrupted");
+ }
+ return executionDate;
+ }
+}
Property changes on: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/NoisyListener.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -0,0 +1,60 @@
+/*
+ * 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.enterprise.internal.custom;
+
+import java.util.Map;
+
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.activity.ExternalActivity;
+import org.jbpm.model.Node;
+import org.jbpm.model.Transition;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class WaitState implements ExternalActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ execution.waitForSignal();
+ }
+
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters)
+ throws Exception {
+ if (parameters != null) {
+ execution.setVariables(parameters);
+ }
+
+ Node node = execution.getNode();
+ execution.fire(signalName, node);
+
+ Transition transition = node.findOutgoingTransition(signalName);
+ if (transition != null) {
+ execution.take(transition);
+ }
+ else {
+ execution.waitForSignal();
+ }
+ }
+
+}
Property changes on: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -41,6 +41,7 @@
import org.jbpm.enterprise.internal.custom.InsertCommentCmd;
import org.jbpm.enterprise.internal.custom.RemoveCommentCmd;
import org.jbpm.enterprise.internal.ejb.CommandReceiverMDB;
+import org.jbpm.log.Log;
import org.jbpm.test.enterprise.IntegrationTestSetup;
/**
@@ -52,26 +53,26 @@
private Connection jmsConnection;
- private static final long TIMEOUT = 2000;
-
private static ConnectionFactory jmsConnectionFactory;
private static Destination commandQueue;
+ private static final long TIMEOUT = 2000;
+ private static final Log log = Log.getLog(CommandReceiverTest.class.getName());
+
public static Test suite() {
- return new IntegrationTestSetup(CommandReceiverTest.class,
- "jbpm-enterprise-test.ear");
+ return new IntegrationTestSetup(CommandReceiverTest.class, "jbpm-enterprise-test.ear");
}
@Override
protected void setUp() throws Exception {
+ log.info("=== starting " + getName() + " =============================");
if (jmsConnectionFactory == null) {
// retrieve managed objects
Context initial = new InitialContext();
try {
jmsConnectionFactory = (ConnectionFactory) initial
- .lookup("java:comp/env/jms/CommandConnectionFactory");
- commandQueue = (Destination) initial
- .lookup("java:comp/env/jms/CommandQueue");
+ .lookup("java:comp/env/jms/JbpmConnectionFactory");
+ commandQueue = (Destination) initial.lookup("java:comp/env/jms/CommandQueue");
}
finally {
initial.close();
@@ -88,6 +89,7 @@
jmsConnection.close();
jmsConnection = null;
}
+ log.info("=== ending " + getName() + " =============================");
}
/**
@@ -113,8 +115,7 @@
*/
public void testHappyMessage() throws JMSException {
final String text = "been there, done that";
- Session jmsSession = jmsConnection.createSession(false,
- Session.AUTO_ACKNOWLEDGE);
+ Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
try {
// send insert command
Command<Void> insertCommand = new InsertCommentCmd(text, /* fail? */false);
@@ -125,10 +126,10 @@
producer.send(insertMessage);
// receive insertion response
- MessageConsumer insertConsumer = jmsSession.createConsumer(replyTo,
- "JMSCorrelationID = '" + insertMessage.getJMSMessageID() + "'");
- ObjectMessage responseMessage = (ObjectMessage) insertConsumer
- .receive(TIMEOUT);
+ MessageConsumer insertConsumer = jmsSession.createConsumer(replyTo, "JMSCorrelationID = '"
+ + insertMessage.getJMSMessageID()
+ + "'");
+ ObjectMessage responseMessage = (ObjectMessage) insertConsumer.receive(TIMEOUT);
assertNull(responseMessage.getObject());
// send remove command
@@ -138,8 +139,9 @@
producer.send(removeMessage);
// receive removal response
- MessageConsumer removeConsumer = jmsSession.createConsumer(replyTo,
- "JMSCorrelationID = '" + removeMessage.getJMSMessageID() + "'");
+ MessageConsumer removeConsumer = jmsSession.createConsumer(replyTo, "JMSCorrelationID = '"
+ + removeMessage.getJMSMessageID()
+ + "'");
responseMessage = (ObjectMessage) removeConsumer.receive(TIMEOUT);
// verify phrase was inserted
assertTrue((Boolean) responseMessage.getObject());
@@ -177,8 +179,7 @@
public void testNoisyMessage() throws JMSException {
final String text = "houston, we have a problem";
// insert phrase via command
- Session jmsSession = jmsConnection.createSession(false,
- Session.AUTO_ACKNOWLEDGE);
+ Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
try {
// send insert command
Command<Void> insertCommand = new InsertCommentCmd(text, /* fail? */true);
@@ -189,10 +190,10 @@
producer.send(insertMessage);
// receive insertion response
- MessageConsumer insertConsumer = jmsSession.createConsumer(replyTo,
- "JMSCorrelationID = '" + insertMessage.getJMSMessageID() + "'");
- ObjectMessage insertResponse = (ObjectMessage) insertConsumer
- .receive(TIMEOUT);
+ MessageConsumer insertConsumer = jmsSession.createConsumer(replyTo, "JMSCorrelationID = '"
+ + insertMessage.getJMSMessageID()
+ + "'");
+ ObjectMessage insertResponse = (ObjectMessage) insertConsumer.receive(TIMEOUT);
assertNull(insertResponse);
// send remove command
@@ -202,10 +203,10 @@
producer.send(removeMessage);
// receive removal response
- MessageConsumer removeConsumer = jmsSession.createConsumer(replyTo,
- "JMSCorrelationID = '" + removeMessage.getJMSMessageID() + "'");
- ObjectMessage removeResponse = (ObjectMessage) removeConsumer
- .receive(TIMEOUT);
+ MessageConsumer removeConsumer = jmsSession.createConsumer(replyTo, "JMSCorrelationID = '"
+ + removeMessage.getJMSMessageID()
+ + "'");
+ ObjectMessage removeResponse = (ObjectMessage) removeConsumer.receive(TIMEOUT);
// verify phrase was NOT inserted
assertFalse((Boolean) removeResponse.getObject());
}
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -22,28 +22,26 @@
package org.jbpm.enterprise.internal.ejb;
import java.util.Date;
-import java.util.List;
import javax.ejb.CreateException;
-import javax.naming.Context;
-import javax.naming.InitialContext;
import junit.framework.Test;
-import org.apache.cactus.ServletTestCase;
-import org.jbpm.ProcessDefinition;
+import org.jbpm.ExecutionService;
+import org.jbpm.ProcessService;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.cmd.Command;
-import org.jbpm.enterprise.internal.custom.HappyActivity;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.enterprise.internal.custom.HappyListener;
+import org.jbpm.enterprise.internal.custom.WaitState;
import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.cmd.DeployCmd;
import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.session.DbSession;
import org.jbpm.session.TimerSession;
+import org.jbpm.test.enterprise.EnvironmentServletTestCase;
import org.jbpm.test.enterprise.IntegrationTestSetup;
/**
@@ -52,53 +50,41 @@
*
* @author Alejandro Guizar
*/
-public class EjbTimerSessionTest extends ServletTestCase {
+public class EjbTimerSessionTest extends EnvironmentServletTestCase {
- private LocalCommandExecutor commandExecutor;
- private static LocalCommandExecutorHome commandExecutorHome;
-
private String processDefinitionId;
-
private Date dueDate;
+
private static final int TIMEOUT = 2000;
public static Test suite() {
- return new IntegrationTestSetup(EjbTimerSessionTest.class,
- "jbpm-enterprise-test.ear");
+ return new IntegrationTestSetup(EjbTimerSessionTest.class, "jbpm-enterprise-test.ear");
}
protected void setUp() throws Exception {
- // lookup home in jndi
- if (commandExecutorHome == null) {
- Context initialContext = new InitialContext();
- try {
- commandExecutorHome = (LocalCommandExecutorHome) initialContext
- .lookup("java:comp/env/ejb/LocalCommandExecutor");
- }
- finally {
- initialContext.close();
- }
- }
- // create local bean
- commandExecutor = commandExecutorHome.create();
+ super.setUp();
// define process
dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
ClientProcessDefinition processDefinition = ProcessFactory.build(getName())
- .node()
- .initial()
- .timer(dueDate, null)
- .event("timeout")
- .listener(new ObjectDescriptor(HappyActivity.class))
- .done();
+ .node("start")
+ .initial()
+ .behaviour(new ObjectDescriptor(WaitState.class))
+ .timer(dueDate, "timeout")
+ .transition("timeout")
+ .listener(new ObjectDescriptor(HappyListener.class))
+ .to("end")
+ .node("end")
+ .behaviour(new ObjectDescriptor(WaitState.class))
+ .done();
// deploy process
- List<ProcessDefinition> processDefinitions = commandExecutor
- .execute(new DeployCmd(new DeploymentImpl(processDefinition)));
- assertEquals(1, processDefinitions.size());
- processDefinitionId = processDefinitions.get(0).getId();
+ environment.get(ProcessService.class).createDeployment().addObject(processDefinition.getName(),
+ processDefinition).deploy();
+ processDefinitionId = processDefinition.getId();
}
protected void tearDown() throws Exception {
- commandExecutor = null;
+ // environment.get(ProcessService.class).deleteProcessDefinition(processDefinitionId);
+ super.tearDown();
}
/**
@@ -114,7 +100,7 @@
* <p>
* The {@link ScheduleTimerCmd} command activates a timer. After that, the
* test waits for the activity to execute. Upon timeout, the
- * {@linkplain HappyActivity activity} notifies the test of its execution.
+ * {@linkplain HappyListener activity} notifies the test of its execution.
* </p>
* <h3>Postconditions</h3>
* <p>
@@ -123,11 +109,11 @@
*/
public void testSchedule() throws CreateException {
// start an execution
- commandExecutor.execute(new StartExecutionCmd(processDefinitionId, null,
- null));
+ environment.get(CommandService.class).execute(
+ new StartExecutionCmd(processDefinitionId, null, null));
// wait for activity to execute
- Date executionDate = HappyActivity.waitFor();
+ Date executionDate = HappyListener.waitFor();
assertTrue(dueDate.compareTo(executionDate) <= 0);
}
@@ -152,10 +138,10 @@
*/
public void testCancel() throws CreateException {
// start an execution
- commandExecutor.execute(new StartExecutionCmd(processDefinitionId, null,
- null));
+ environment.get(ExecutionService.class).startExecutionById(processDefinitionId);
- Date executionDate = HappyActivity.waitFor(2 * TIMEOUT);
+ // wait past the due date, ensure activity did not execute
+ Date executionDate = HappyListener.waitFor(2 * TIMEOUT);
assertNull(executionDate);
}
@@ -187,8 +173,7 @@
}
public Void execute(Environment environment) throws Exception {
- TimerImpl timer = environment.get(DbSession.class).get(TimerImpl.class,
- timerDbid);
+ TimerImpl timer = environment.get(DbSession.class).get(TimerImpl.class, timerDbid);
environment.get(TimerSession.class).cancel(timer);
return null;
}
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -22,35 +22,29 @@
package org.jbpm.enterprise.internal.ejb;
import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
import javax.ejb.CreateException;
import javax.naming.InitialContext;
import junit.framework.Test;
-import org.apache.cactus.ServletTestCase;
+import org.jbpm.Execution;
+import org.jbpm.ExecutionService;
+import org.jbpm.ProcessService;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.cmd.Command;
-import org.jbpm.enterprise.internal.custom.HappyActivity;
-import org.jbpm.enterprise.internal.custom.NoisyActivity;
-import org.jbpm.enterprise.internal.ejb.LocalCommandExecutor;
-import org.jbpm.enterprise.internal.ejb.LocalCommandExecutorHome;
-import org.jbpm.enterprise.internal.ejb.LocalTimer;
-import org.jbpm.enterprise.internal.ejb.LocalTimerHome;
-import org.jbpm.enterprise.internal.ejb.TimerEB;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.enterprise.internal.custom.HappyListener;
+import org.jbpm.enterprise.internal.custom.WaitState;
+import org.jbpm.enterprise.internal.custom.NoisyListener;
import org.jbpm.env.Environment;
import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.cmd.DeployCmd;
-import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
-import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.svc.DeploymentImpl;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.session.DbSession;
+import org.jbpm.test.enterprise.EnvironmentServletTestCase;
import org.jbpm.test.enterprise.IntegrationTestSetup;
/**
@@ -59,55 +53,53 @@
*
* @author Alejandro Guizar
*/
-public class TimerTest extends ServletTestCase {
+public class TimerTest extends EnvironmentServletTestCase {
private ClientProcessDefinition processDefinition;
- private ObjectDescriptor activityDescriptor = new ObjectDescriptor();
+ private ObjectDescriptor listenerDescriptor = new ObjectDescriptor();
private Date dueDate;
- private LocalCommandExecutor commandExecutor;
-
private static final int TIMEOUT = 2000;
private static final int REPEAT = 1000;
private static final Log log = Log.getLog(TimerTest.class.getName());
private static LocalTimerHome timerHome;
- private static LocalCommandExecutorHome commandExecutorHome;
public static Test suite() {
return new IntegrationTestSetup(TimerTest.class, "jbpm-enterprise-test.ear");
}
protected void setUp() throws Exception {
- // lookup homes in jndi
- if (commandExecutorHome == null) {
+ super.setUp();
+ // lookup timer home in jndi
+ if (timerHome == null) {
InitialContext initialContext = new InitialContext();
try {
- commandExecutorHome = (LocalCommandExecutorHome) initialContext
- .lookup("java:comp/env/ejb/LocalCommandExecutor");
- timerHome = (LocalTimerHome) initialContext
- .lookup("java:comp/env/ejb/LocalTimer");
+ timerHome = (LocalTimerHome) initialContext.lookup("java:comp/env/ejb/LocalTimer");
}
finally {
initialContext.close();
}
}
- // create local bean
- commandExecutor = commandExecutorHome.create();
// define process
dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
processDefinition = ProcessFactory.build(getName())
- .node()
- .initial()
- .timer(dueDate, null)
- .event("timeout")
- .listener(activityDescriptor)
- .done();
+ .node()
+ .initial()
+ .behaviour(new ObjectDescriptor(WaitState.class))
+ .timer(dueDate, "timeout")
+ .transition("timeout")
+ .listener(listenerDescriptor)
+ .to("end")
+ .node("end")
+ .behaviour(new ObjectDescriptor(WaitState.class))
+ .done();
}
protected void tearDown() throws Exception {
- commandExecutor = null;
+ // environment.get(ProcessService.class).deleteProcessDefinition(processDefinition.getId());
+ super.tearDown();
}
/**
@@ -121,10 +113,10 @@
* </p>
* <h3>Behavior</h3>
* <p>
- * The {@link CreateTimerCmd} command subscribes a timer bean to the EJB
- * timer service. After that, the test waits for the activity to execute.
- * Upon timeout, the {@linkplain HappyActivity activity} notifies the test of
- * its execution.
+ * The {@link CreateTimerCmd} command subscribes a timer bean to the EJB timer
+ * service. After that, the test waits for the activity to execute. Upon
+ * timeout, the {@linkplain HappyListener activity} notifies the test of its
+ * execution.
* </p>
* <h3>Postconditions</h3>
* <p>
@@ -132,20 +124,21 @@
* </p>
*/
public void testHappyTimer() throws CreateException {
- activityDescriptor.setClassName(HappyActivity.class.getName());
- commandExecutor
- .execute(new DeployCmd(new DeploymentImpl(processDefinition)));
+ // deploy process
+ listenerDescriptor.setClassName(HappyListener.class.getName());
+ environment.get(ProcessService.class).createDeployment().addObject(processDefinition.getName(),
+ processDefinition).deploy();
+ // start execution
+ Execution execution = environment.get(ExecutionService.class).startExecutionById(
+ processDefinition.getId());
- ExecutionImpl execution = (ExecutionImpl) commandExecutor
- .execute(new StartExecutionCmd(processDefinition.getId(), null, null));
-
TimerImpl timer = new TimerImpl();
timer.setEventName("timeout");
timer.setDueDate(dueDate);
- timer.setExecution(execution);
- commandExecutor.execute(new CreateTimerCmd(timer));
+ timer.setExecution((ExecutionImpl) execution);
+ environment.get(CommandService.class).execute(new CreateTimerCmd(timer));
- Date executionDate = HappyActivity.waitFor();
+ Date executionDate = HappyListener.waitFor();
assertTrue(dueDate.compareTo(executionDate) <= 0);
}
@@ -162,7 +155,7 @@
* <p>
* The {@link CreateTimerCmd} command subscribes a timer bean to the EJB timer
* service. After that, the test waits for the activity to execute. Upon
- * timeout, the {@linkplain NoisyActivity activity} notifies the test of its
+ * timeout, the {@linkplain NoisyListener activity} notifies the test of its
* execution, sets a variable and throws a checked exception.
* </p>
* <h3>Postconditions</h3>
@@ -172,26 +165,26 @@
* </p>
*/
public void testNoisyTimer() throws CreateException {
- activityDescriptor.setClassName(NoisyActivity.class.getName());
- commandExecutor
- .execute(new DeployCmd(new DeploymentImpl(processDefinition)));
+ // deploy process
+ listenerDescriptor.setClassName(NoisyListener.class.getName());
+ environment.get(ProcessService.class).createDeployment().addObject(processDefinition.getName(),
+ processDefinition).deploy();
+ // start execution
+ ExecutionService executionService = environment.get(ExecutionService.class);
+ ExecutionImpl execution = (ExecutionImpl) executionService.startExecutionById(processDefinition
+ .getId());
- ExecutionImpl execution = (ExecutionImpl) commandExecutor
- .execute(new StartExecutionCmd(processDefinition.getId(), null, null));
-
TimerImpl timer = new TimerImpl();
timer.setEventName("timeout");
timer.setDueDate(dueDate);
timer.setExecution(execution);
- commandExecutor.execute(new CreateTimerCmd(timer));
+ CommandService commandService = environment.get(CommandService.class);
+ commandService.execute(new CreateTimerCmd(timer));
- Date executionDate = NoisyActivity.waitFor();
+ Date executionDate = NoisyListener.waitFor();
assertTrue(dueDate.compareTo(executionDate) <= 0);
- Set<String> variableNames = new HashSet<String>();
- variableNames.add("executionDate");
- Object variableValue = commandExecutor.execute(new GetVariablesCmd(
- execution.getId(), variableNames));
+ Object variableValue = executionService.getVariable(execution.getId(), "executionDate");
assertNull(variableValue);
}
@@ -209,7 +202,7 @@
* The {@link CreateTimerCmd} command subscribes a timer bean to the EJB timer
* service. After that, the test waits for the first execution of the
* activity, and then for the subsequent <em>n</em> executions of the
- * activity. Upon each timeout, the {@linkplain HappyActivity activity}
+ * activity. Upon each timeout, the {@linkplain HappyListener activity}
* notifies the test of its execution.
* </p>
* <h3>
@@ -221,33 +214,35 @@
* </p>
*/
public void testCyclicTimer() throws CreateException {
- activityDescriptor.setClassName(HappyActivity.class.getName());
- commandExecutor
- .execute(new DeployCmd(new DeploymentImpl(processDefinition)));
+ // deploy process
+ listenerDescriptor.setClassName(HappyListener.class.getName());
+ environment.get(ProcessService.class).createDeployment().addObject(processDefinition.getName(),
+ processDefinition).deploy();
+ // start execution
+ ExecutionImpl execution = (ExecutionImpl) environment.get(ExecutionService.class)
+ .startExecutionById(processDefinition.getId());
- ExecutionImpl execution = (ExecutionImpl) commandExecutor
- .execute(new StartExecutionCmd(processDefinition.getId(), null, null));
-
TimerImpl timer = new TimerImpl();
timer.setEventName("timeout");
timer.setDueDate(dueDate);
timer.setRepeat(REPEAT + " milliseconds");
timer.setExecution(execution);
- commandExecutor.execute(new CreateTimerCmd(timer));
+ CommandService commandService = environment.get(CommandService.class);
+ commandService.execute(new CreateTimerCmd(timer));
try {
- Date executionTime = HappyActivity.waitFor();
+ Date executionTime = HappyListener.waitFor();
assertTrue(dueDate.compareTo(executionTime) <= 0);
for (int i = 0; i < 5; i++) {
dueDate.setTime(dueDate.getTime() + REPEAT);
log.info("next execution due " + TimerImpl.formatDueDate(dueDate));
- executionTime = HappyActivity.waitFor();
+ executionTime = HappyListener.waitFor();
assertTrue(dueDate.compareTo(executionTime) <= 0);
}
}
finally {
- commandExecutor.execute(new CancelTimerCmd(timer.getDbid()));
+ commandService.execute(new CancelTimerCmd(timer.getDbid()));
}
}
Added: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/enterprise/EnvironmentServletTestCase.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/enterprise/EnvironmentServletTestCase.java (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/enterprise/EnvironmentServletTestCase.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.enterprise;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cactus.ServletTestCase;
+import org.jbpm.Configuration;
+import org.jbpm.JbpmException;
+import org.jbpm.env.Environment;
+import org.jbpm.env.EnvironmentFactory;
+import org.jbpm.log.Log;
+
+/**
+ * @author Alejandro Guizar
+ */
+public abstract class EnvironmentServletTestCase extends ServletTestCase {
+
+ private final String configResource;
+ protected Environment environment;
+ protected Log log = Log.getLog(getClass().getName());
+
+ private static final Map<String, EnvironmentFactory> environmentFactories = new HashMap<String, EnvironmentFactory>();
+
+ public EnvironmentServletTestCase() {
+ this("environment.cfg.xml");
+ }
+
+ public EnvironmentServletTestCase(String configResource) {
+ this.configResource = configResource;
+ }
+
+ protected void setUp() throws Exception {
+ log.info("=== starting " + getName() + " =============================");
+ openEnvironment();
+ }
+
+ protected void tearDown() throws Exception {
+ closeEnvironment();
+ log.info("=== ending " + getName() + " =============================");
+ }
+
+ void closeEnvironment() {
+ environment.close();
+ environment = null;
+ }
+
+ void openEnvironment() {
+ environment = getEnvironmentFactory().openEnvironment();
+ }
+
+ public EnvironmentFactory getEnvironmentFactory() {
+ EnvironmentFactory environmentFactory = environmentFactories.get(configResource);
+ if (environmentFactory == null) {
+ environmentFactory = createEnvironmentFactory(configResource);
+ }
+ return environmentFactory;
+ }
+
+ EnvironmentFactory createEnvironmentFactory(String configResource) {
+ try {
+ log.debug("creating environment factory for " + configResource);
+ EnvironmentFactory environmentFactory = (EnvironmentFactory) new Configuration().setResource(
+ configResource).buildProcessEngine();
+ environmentFactories.put(configResource, environmentFactory);
+ return environmentFactory;
+ }
+ catch (Exception e) {
+ throw new JbpmException("could not create environment factory for " + configResource, e);
+ }
+ }
+
+ void closeEnvironmentFactory(String configResource) {
+ EnvironmentFactory environmentFactory = environmentFactories.remove(configResource);
+ if (environmentFactory != null) {
+ log.debug("closing environment factory for " + configResource);
+ environmentFactory.close();
+ }
+ }
+}
Modified: jbpm4/trunk/modules/enterprise/src/test/resources/WEB-INF/jboss-web.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/resources/WEB-INF/jboss-web.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/test/resources/WEB-INF/jboss-web.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -4,13 +4,8 @@
<jboss-web>
<resource-ref>
- <res-ref-name>jms/CommandConnectionFactory</res-ref-name>
+ <res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
<jndi-name>java:ConnectionFactory</jndi-name>
</resource-ref>
- <message-destination-ref>
- <message-destination-ref-name>jms/CommandQueue</message-destination-ref-name>
- <jndi-name>queue/JbpmCommandQueue</jndi-name>
- </message-destination-ref>
-
</jboss-web>
Modified: jbpm4/trunk/modules/enterprise/src/test/resources/WEB-INF/web.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/resources/WEB-INF/web.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/test/resources/WEB-INF/web.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -1,9 +1,6 @@
<?xml version="1.0"?>
-
-<web-app version="2.4"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee">
-
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
@@ -31,7 +28,7 @@
</ejb-local-ref>
<resource-ref>
- <res-ref-name>jms/CommandConnectionFactory</res-ref-name>
+ <res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
@@ -41,6 +38,6 @@
<message-destination-ref-name>jms/CommandQueue</message-destination-ref-name>
<message-destination-type>javax.jms.Queue</message-destination-type>
<message-destination-usage>Produces</message-destination-usage>
+ <message-destination-link>CommandQueue</message-destination-link>
</message-destination-ref>
-
-</web-app>
\ No newline at end of file
+</web-app>
Modified: jbpm4/trunk/modules/enterprise/src/test/resources/environment.cfg.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/resources/environment.cfg.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/test/resources/environment.cfg.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -3,9 +3,6 @@
<process-engine>
<deployer-manager>
- <assign-file-type>
- <file extension=".jpdl.xml" type="jpdl" />
- </assign-file-type>
<check-process />
<check-problems />
<save />
@@ -28,15 +25,25 @@
usage="nonstrict-read-write" />
</hibernate-configuration>
<hibernate-session-factory />
+
<id-generator />
-
<variable-types resource="jbpm.pvm.types.xml" />
+ <business-calendar>
+ <monday hours="9:00-12:00 and 12:30-17:00"/>
+ <tuesday hours="9:00-12:00 and 12:30-17:00"/>
+ <wednesday hours="9:00-12:00 and 12:30-17:00"/>
+ <thursday hours="9:00-12:00 and 12:30-17:00"/>
+ <friday hours="9:00-12:00 and 12:30-17:00"/>
+ <holiday period="01/07/2008 - 31/08/2008"/>
+ </business-calendar>
+
</process-engine>
<environment>
- <hibernate-session />
+ <hibernate-session current="true" />
<pvm-db-session />
+ <job-db-session />
<ejb-timer-session />
</environment>
Modified: jbpm4/trunk/modules/enterprise/src/test/resources/hibernate.properties
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/resources/hibernate.properties 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/test/resources/hibernate.properties 2009-01-13 18:22:21 UTC (rev 3634)
@@ -1,4 +1,6 @@
-hibernate.connection.datasource java:DefaultDS
-hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
-hibernate.format_sql true
-hibernate.use_sql_comments true
+hibernate.connection.datasource java\:comp/env/jdbc/JbpmDataSource
+hibernate.transaction.factory_class org.hibernate.transaction.JTATransactionFactory
+hibernate.transaction.manager_lookup_class org.hibernate.transaction.JBossTransactionManagerLookup
+hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
+hibernate.format_sql true
+hibernate.use_sql_comments true
Added: jbpm4/trunk/modules/enterprise/src/test/resources/log4j.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/resources/log4j.xml (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/resources/log4j.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <param name="File" value="${project.build.directory}/test.log"/>
+ <param name="Append" value="false"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="INFO" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jbpm">
+ <priority value="DEBUG" />
+ </category>
+
+ <!-- Limit the org.hibernate category to INFO as its DEBUG is verbose -->
+ <category name="org.hibernate">
+ <priority value="INFO" />
+ </category>
+
+ <!-- hide optimistic locking failures
+ <category name="org.hibernate.event.def.AbstractFlushingEventListener">
+ <priority value="FATAL" />
+ </category>
+ -->
+
+ <!-- hide proxy narrowing warns -->
+ <category name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog">
+ <priority value="ERROR" />
+ </category>
+
+ <!-- show SQL DML statements as they are executed -->
+ <category name="org.hibernate.SQL">
+ <priority value="DEBUG" />
+ </category>
+
+ <!-- show JDBC parameters
+ <category name="org.hibernate.type">
+ <priority value="TRACE" />
+ </category>
+ -->
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--appender-ref ref="CONSOLE"/-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: jbpm4/trunk/modules/enterprise/src/test/resources/log4j.xml
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/enterprise/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/resources/logging.properties 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/enterprise/src/test/resources/logging.properties 2009-01-13 18:22:21 UTC (rev 3634)
@@ -1,28 +0,0 @@
-handlers= java.util.logging.ConsoleHandler
-# to add the error triggered file handler
-# handlers= java.util.logging.ConsoleHandler org.jbpm.util.ErrorTriggeredFileHandler
-
-redirect.commons.logging = enabled
-
-java.util.logging.ConsoleHandler.level = FINEST
-java.util.logging.ConsoleHandler.formatter = org.jbpm.log.LogFormatter
-
-# org.jbpm.util.ErrorTriggeredFileHandler.size = 500
-# org.jbpm.util.ErrorTriggeredFileHandler.push = OFF
-# org.jbpm.util.ErrorTriggeredFileHandler.pattern = %h/jbpm%u.log
-
-# For example, set the com.xyz.foo logger to only log SEVERE messages:
-# com.xyz.foo.level = SEVERE
-
-org.jbpm.level=FINEST
-org.jbpm.pvm.internal.tx.level=FINE
-org.jbpm.pvm.internal.wire.level=FINE
-org.jbpm.pvm.internal.util.level=FINE
-
-org.hibernate.level=FINEST
-org.hibernate.cfg.HbmBinder.level=SEVERE
-org.hibernate.cfg.SettingsFactory.level=SEVERE
-# org.hibernate.SQL.level=FINEST
-# org.hibernate.type.level=FINEST
-# org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
-# org.hibernate.transaction.level=FINEST
Modified: jbpm4/trunk/modules/log/src/main/java/org/jbpm/log/Log.java
===================================================================
--- jbpm4/trunk/modules/log/src/main/java/org/jbpm/log/Log.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/log/src/main/java/org/jbpm/log/Log.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -52,9 +52,9 @@
static boolean isLog4jAvailable(ClassLoader classLoader) {
try {
- classLoader.loadClass("org.apache.log4j.LogManager");
+ Class.forName("org.apache.log4j.LogManager", false, classLoader);
return true;
- } catch (Exception e) {
+ } catch (ClassNotFoundException e) {
return false;
}
}
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-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -37,7 +37,6 @@
import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
import org.jbpm.pvm.internal.util.Clock;
-import org.jbpm.session.DbSession;
/** a runtime timer instance.
*
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java 2009-01-13 18:22:21 UTC (rev 3634)
@@ -53,19 +53,23 @@
*
* @author Tom Baeyens
*/
-public abstract class XmlUtil {
+public class XmlUtil {
private static Log log = Log.getLog(XmlUtil.class.getName());
+ private XmlUtil() {
+ // hide default constructor to prevent instantiation
+ }
+
public static List<Element> elements(Element element, String tagName) {
if (element==null) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
NodeList nodeList = element.getChildNodes();
if ( (nodeList == null)
|| (nodeList.getLength()==0)
) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
List<Element> elements = new ArrayList<Element>();
for (int i = 0; i < nodeList.getLength(); i++) {
@@ -86,13 +90,13 @@
public static List<Element> elements(Element element, Set<String> allowedTagNames) {
if (element==null) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
NodeList nodeList = element.getChildNodes();
if ( (nodeList == null)
|| (nodeList.getLength()==0)
) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
List<Element> elements = new ArrayList<Element>();
for (int i = 0; i < nodeList.getLength(); i++) {
@@ -136,13 +140,13 @@
public static List<Element> elements(Element element) {
if (element==null) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
NodeList nodeList = element.getChildNodes();
if ( (nodeList == null)
|| (nodeList.getLength()==0)
) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
List<Element> elements = new ArrayList<Element>();
if ((nodeList != null) && (nodeList.getLength() > 0)) {
@@ -159,13 +163,13 @@
public static List<Element> elements(Element element, String ns, String localName) {
if (element==null) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
NodeList nodeList = element.getChildNodes();
if ( (nodeList == null)
|| (nodeList.getLength()==0)
) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
List<Element> matchingElements = new ArrayList<Element>();
NodeList nl = element.getChildNodes();
@@ -180,13 +184,13 @@
public static List<Element> elementsQName(Element element, Set<QName> allowedTagNames) {
if (element==null) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
NodeList nodeList = element.getChildNodes();
if ( (nodeList == null)
|| (nodeList.getLength()==0)
) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
List<Element> elements = new ArrayList<Element>();
if (nodeList != null) {
@@ -268,7 +272,7 @@
public static List<Attr> attributes(Element element) {
NamedNodeMap attributeMap = element.getAttributes();
if ((attributeMap == null) || (attributeMap.getLength() == 0)) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
List<Attr> attributes = new ArrayList<Attr>();
@@ -281,8 +285,8 @@
public static List<Node> contents(Element element) {
NodeList nodeList = element.getChildNodes();
- if ((nodeList == null) && (nodeList.getLength() != 0)) {
- return Collections.EMPTY_LIST;
+ if ((nodeList == null) || (nodeList.getLength() == 0)) {
+ return Collections.emptyList();
}
List<Node> contents = new ArrayList<Node>();
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -5,206 +5,190 @@
<hibernate-mapping package="org.jbpm.pvm.internal.wire.descriptor" default-access="field">
<!-- ### DESCRIPTORS #################################################### -->
- <class name="AbstractDescriptor" table="JBPM_DESCRIPTOR" abstract="true" discriminator-value="abstract">
- <!--
- byte : ByteDescriptor
- string : StringDescriptor
- char : CharacterDescriptor
- class : ClassDescriptor
- double : DoubleDescriptor
+ <class name="AbstractDescriptor" table="JBPM_DESCRIPTOR" abstract="true"
+ discriminator-value="abstract">
+ <!--
+ byte : ByteDescriptor
+ string : StringDescriptor
+ char : CharacterDescriptor
+ class : ClassDescriptor
+ double : DoubleDescriptor
expr : ExpressionDescriptor
- float : FloatDescriptor
- long : LongDescriptor
- int : IntegerDescriptor
- short : ShortDescriptor
- coll : CollectionDescriptor
- map : MapDescriptor
- list : ListDescriptor
- set : SetDescriptor
- object : ObjectDescriptor
- ref : ReferenceDescriptor
- null : NullDescriptor
- true : TrueDescriptor
- false : FalseDescriptor
- provided : ProvidedObjectDescriptor
- -->
+ float : FloatDescriptor
+ long : LongDescriptor
+ int : IntegerDescriptor
+ short : ShortDescriptor
+ coll : CollectionDescriptor
+ map : MapDescriptor
+ list : ListDescriptor
+ set : SetDescriptor
+ object : ObjectDescriptor
+ ref : ReferenceDescriptor
+ null : NullDescriptor
+ true : TrueDescriptor
+ false : FalseDescriptor
+ provided : ProvidedObjectDescriptor
+ -->
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
- <discriminator column="CLASS_"/>
+ <discriminator column="CLASS_" />
<version name="dbversion" column="DBVERSION_" />
-
- <property name="name" column="NAME_" />
- <property name="init" column="INIT_" />
- <subclass name="NullDescriptor" discriminator-value="null_"/>
- <subclass name="TrueDescriptor" discriminator-value="true" />
- <subclass name="FalseDescriptor" discriminator-value="false" />
-
+ <property name="name" column="NAME_" />
+ <property name="init" column="INIT_" />
+
+ <subclass name="NullDescriptor" discriminator-value="null_" />
+ <subclass name="TrueDescriptor" discriminator-value="true" />
+ <subclass name="FalseDescriptor" discriminator-value="false" />
+
<subclass name="StringDescriptor" discriminator-value="string">
<property name="text" column="TEXT_" />
</subclass>
-
- <subclass name="CharacterDescriptor" discriminator-value="char">
- <property name="text" column="TEXT_" />
- </subclass>
- <subclass name="ClassDescriptor" discriminator-value="class">
- <property name="text" column="TEXT_" />
- </subclass>
- <subclass name="ReferenceDescriptor" discriminator-value="ref">
- <property name="text" column="TEXT_" />
- </subclass>
+ <subclass name="CharacterDescriptor" discriminator-value="char">
+ <property name="text" column="TEXT_" />
+ </subclass>
+ <subclass name="ClassDescriptor" discriminator-value="class">
+ <property name="text" column="TEXT_" />
+ </subclass>
+ <subclass name="ReferenceDescriptor" discriminator-value="ref">
+ <property name="text" column="TEXT_" />
+ </subclass>
- <subclass name="DoubleDescriptor" discriminator-value="double">
- <property name="doubleVal" column="DOUBLEVAL_" />
- </subclass>
- <subclass name="FloatDescriptor" discriminator-value="float">
- <property name="doubleVal" column="DOUBLEVAL_" />
- </subclass>
+ <subclass name="DoubleDescriptor" discriminator-value="double">
+ <property name="doubleVal" column="DOUBLEVAL_" />
+ </subclass>
+ <subclass name="FloatDescriptor" discriminator-value="float">
+ <property name="doubleVal" column="DOUBLEVAL_" />
+ </subclass>
-
<subclass name="LongDescriptor" discriminator-value="long">
<property name="longVal" column="LONGVAL_" />
</subclass>
- <subclass name="IntegerDescriptor" discriminator-value="int">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="ShortDescriptor" discriminator-value="short">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="ByteDescriptor" discriminator-value="byte">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
-
+ <subclass name="IntegerDescriptor" discriminator-value="int">
+ <property name="longVal" column="LONGVAL_" />
+ </subclass>
+ <subclass name="ShortDescriptor" discriminator-value="short">
+ <property name="longVal" column="LONGVAL_" />
+ </subclass>
+ <subclass name="ByteDescriptor" discriminator-value="byte">
+ <property name="longVal" column="LONGVAL_" />
+ </subclass>
- <subclass name="CollectionDescriptor" discriminator-value="coll">
- <property name="className" column="CLASSNAME_" />
- <list name="valueDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_DESCR_VALDESCR">
- <column name="VALUEDESCR_" index="IDX_DESCR_VALDESCR" />
+ <subclass name="CollectionDescriptor" discriminator-value="coll">
+ <property name="className" column="CLASSNAME_" />
+ <list name="valueDescriptors" cascade="all-delete-orphan">
+ <key foreign-key="FK_DESCR_VALDESCR">
+ <column name="VALUEDESCR_" index="IDX_DESCR_VALDESCR" />
</key>
- <list-index column="VALUEDESCR_IDX_" />
- <one-to-many class="AbstractDescriptor" />
- </list>
+ <list-index column="VALUEDESCR_IDX_" />
+ <one-to-many class="AbstractDescriptor" />
+ </list>
- <subclass name="MapDescriptor" discriminator-value="map">
- <list name="keyDescriptors" cascade="all-delete-orphan">
- <key column="KEYDESCR_" foreign-key="FK_DESCR_KEYDESCR"/>
- <list-index column="KEYDESCR_IDX_" />
- <one-to-many class="AbstractDescriptor" />
- </list>
- </subclass>
+ <subclass name="MapDescriptor" discriminator-value="map">
+ <list name="keyDescriptors" cascade="all-delete-orphan">
+ <key column="KEYDESCR_" foreign-key="FK_DESCR_KEYDESCR" />
+ <list-index column="KEYDESCR_IDX_" />
+ <one-to-many class="AbstractDescriptor" />
+ </list>
+ </subclass>
<subclass name="ListDescriptor" discriminator-value="list" />
<subclass name="SetDescriptor" discriminator-value="set" />
- </subclass>
+ </subclass>
- <subclass name="ObjectDescriptor" discriminator-value="object">
- <property name="className" column="TEXT_" />
- <property name="methodName" column="METHOD_" />
- <property name="isAutoWireEnabled" column="BOOLVAL_" />
- <property name="factoryObjectName" column="FACTORYNAME_" />
-
- <many-to-one name="factoryDescriptor"
- class="AbstractDescriptor"
- column="FACTORYDESCR_"
- foreign-key="FK_DESCR_ARG_REF"
- index="IDX_DESCR_ARG_REF"
- cascade="all"/>
+ <subclass name="ObjectDescriptor" discriminator-value="object">
+ <property name="className" column="TEXT_" />
+ <property name="methodName" column="METHOD_" />
+ <property name="isAutoWireEnabled" column="BOOLVAL_" />
+ <property name="factoryObjectName" column="FACTORYNAME_" />
- <list name="argDescriptors" cascade="all-delete-orphan" >
+ <many-to-one name="factoryDescriptor" class="AbstractDescriptor" column="FACTORYDESCR_"
+ foreign-key="FK_DESCR_ARG_REF" index="IDX_DESCR_ARG_REF" cascade="all" />
+
+ <list name="argDescriptors" cascade="all-delete-orphan">
<key foreign-key="FK_DESCR_ARGDESCR">
- <column name="OBJDESCR_" index="IDX_DESCR_ARGDESCR" />
+ <column name="OBJDESCR_" index="IDX_DESCR_ARGDESCR" />
</key>
- <list-index column="OBJDESCR_IDX_" />
- <one-to-many class="ArgDescriptor" />
- </list>
-
- <list name="operations" cascade="all-delete-orphan">
- <key foreign-key="FK_OPER_OBJDESCR">
- <column name="OBJDESCR_" index="IDX_OPER_OBJDESCR" />
+ <list-index column="OBJDESCR_IDX_" />
+ <one-to-many class="ArgDescriptor" />
+ </list>
+
+ <list name="operations" cascade="all-delete-orphan">
+ <key foreign-key="FK_OPER_OBJDESCR">
+ <column name="OBJDESCR_" index="IDX_OPER_OBJDESCR" />
</key>
- <list-index column="OBJDESCR_IDX" />
- <one-to-many class="org.jbpm.pvm.internal.wire.operation.AbstractOperation"/>
- </list>
- </subclass>
-
+ <list-index column="OBJDESCR_IDX_" />
+ <one-to-many class="org.jbpm.pvm.internal.wire.operation.AbstractOperation" />
+ </list>
+ </subclass>
+
<subclass name="ExpressionDescriptor" discriminator-value="expr">
<property name="expr" column="TEXT_" />
<property name="lang" column="METHOD_" />
</subclass>
-
+
<subclass name="ProvidedObjectDescriptor" discriminator-value="provided">
- <any name="providedObject" id-type="long" cascade="all">
- <column name="TEXT_" />
- <column name="LONGVAL_" />
- </any>
- <property name="exposeType" column="BOOLVAL_" />
+ <any name="providedObject" id-type="long" cascade="all">
+ <column name="TEXT_" />
+ <column name="LONGVAL_" />
+ </any>
+ <property name="exposeType" column="BOOLVAL_" />
</subclass>
<subclass name="EnvDescriptor" discriminator-value="env">
<property name="objectName" column="TEXT_" />
<property name="typeName" column="CLASSNAME_" />
</subclass>
-
- </class>
+ </class>
+
<!-- ### OPERATIONS ##################################################### -->
- <class name="org.jbpm.pvm.internal.wire.operation.AbstractOperation"
- abstract="true"
- table="JBPM_OPERATION"
- discriminator-value="oper">
+ <class name="org.jbpm.pvm.internal.wire.operation.AbstractOperation" abstract="true"
+ table="JBPM_OPERATION" discriminator-value="oper">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
- <discriminator column="CLASS_"/>
+ <discriminator column="CLASS_" />
<version name="dbversion" column="DBVERSION_" />
- <subclass name="org.jbpm.pvm.internal.wire.operation.FieldOperation" discriminator-value="field">
- <property name="fieldName" column="TEXT_" />
- <many-to-one name="descriptor"
- column="DESCR_"
- cascade="all"
- class="AbstractDescriptor"
- foreign-key="FK_OPER_DESC"
- index="IDX_OPER_DESC"/>
- </subclass>
+ <subclass name="org.jbpm.pvm.internal.wire.operation.FieldOperation"
+ discriminator-value="field">
+ <property name="fieldName" column="TEXT_" />
+ <many-to-one name="descriptor" column="DESCR_" cascade="all" class="AbstractDescriptor"
+ foreign-key="FK_OPER_DESC" index="IDX_OPER_DESC" />
+ </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.operation.PropertyOperation" discriminator-value="prop">
- <property name="setterName" column="TEXT_" />
- <many-to-one name="descriptor"
- column="DESCR_"
- cascade="all"
- class="AbstractDescriptor"/>
- </subclass>
+ <subclass name="org.jbpm.pvm.internal.wire.operation.PropertyOperation"
+ discriminator-value="prop">
+ <property name="setterName" column="TEXT_" />
+ <many-to-one name="descriptor" column="DESCR_" cascade="all" class="AbstractDescriptor" />
+ </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.operation.InvokeOperation" discriminator-value="invoke">
- <property name="methodName" column="TEXT_" />
- <list name="argDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_ARGDSCR_OPER">
+ <subclass name="org.jbpm.pvm.internal.wire.operation.InvokeOperation"
+ discriminator-value="invoke">
+ <property name="methodName" column="TEXT_" />
+ <list name="argDescriptors" cascade="all-delete-orphan">
+ <key foreign-key="FK_ARGDSCR_OPER">
<column name="OPER_" index="IDX_ARGDSCR_OPER" />
</key>
- <list-index column="OPER_IDX_" />
- <one-to-many class="ArgDescriptor" />
- </list>
- </subclass>
- </class>
-
+ <list-index column="OPER_IDX_" />
+ <one-to-many class="ArgDescriptor" />
+ </list>
+ </subclass>
+ </class>
+
<!-- ### ARG DESCRIPTOR ################################################# -->
<class name="ArgDescriptor" table="JBPM_ARGDESCRIPTOR">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
<version name="dbversion" column="DBVERSION_" />
- <property name="typeName" column="TYPENAME_" />
- <many-to-one name="descriptor"
- column="DESCRIPTOR_"
- class="AbstractDescriptor"
- foreign-key="FK_ARGDESCR_DESCR"
- index="IDX_ARGDESCR_DESCR"
- cascade="all"/>
+ <property name="typeName" column="TYPENAME_" />
+ <many-to-one name="descriptor" column="DESCRIPTOR_" class="AbstractDescriptor"
+ foreign-key="FK_ARGDESCR_DESCR" index="IDX_ARGDESCR_DESCR" cascade="all" />
</class>
<!-- ### PROPERTIES ##################################################### -->
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-01-13 18:03:40 UTC (rev 3633)
+++ jbpm4/trunk/pom.xml 2009-01-13 18:22:21 UTC (rev 3634)
@@ -44,7 +44,7 @@
<!-- Properties -->
<properties>
- <cactus.version>1.8.0</cactus.version>
+ <cactus.version>13-1.7.1</cactus.version>
<hibernate.version>3.2.6.ga</hibernate.version>
<hsqldb.version>1.8.0.7</hsqldb.version>
<jboss.j2ee.version>4.2.2.GA</jboss.j2ee.version>
@@ -85,16 +85,11 @@
<!-- Please sort by groupid -->
<dependency>
- <groupId>org.apache.cactus</groupId>
- <artifactId>cactus.core.framework.wrapper.javaEE.14</artifactId>
+ <groupId>cactus</groupId>
+ <artifactId>cactus</artifactId>
<version>${cactus.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.cactus</groupId>
- <artifactId>cactus.integration.shared.api</artifactId>
- <version>${cactus.version}</version>
- </dependency>
- <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
@@ -487,6 +482,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
+ <version>5.0.8</version>
<scope>test</scope>
</dependency>
</dependencies>
17 years, 3 months
JBoss JBPM SVN: r3633 - in jbpm3/trunk/modules: enterprise/scripts and 5 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-01-13 13:03:40 -0500 (Tue, 13 Jan 2009)
New Revision: 3633
Modified:
jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml
jbpm3/trunk/modules/enterprise/scripts/antrun-test-jars.xml
jbpm3/trunk/modules/enterprise/src/main/resources/META-INF/ejb-jar.xml
jbpm3/trunk/modules/enterprise/src/main/resources/META-INF/jboss.xml
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java
jbpm3/trunk/modules/enterprise/src/test/resources/enterprise/WEB-INF/jboss-web.xml
Log:
eliminate code redundancies in JtaDbPersistenceTest
fix jndi names of jbpm beans
minor edits to other enterprise tests
Modified: jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml 2009-01-13 11:39:31 UTC (rev 3632)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml 2009-01-13 18:03:40 UTC (rev 3633)
@@ -6,7 +6,6 @@
<!-- JTA transaction properties (begin) ===
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
- <property name="jta.UserTransaction">UserTransaction</property>
==== JTA transaction properties (end) -->
<!-- CMT transaction properties (begin) ===
Modified: jbpm3/trunk/modules/enterprise/scripts/antrun-test-jars.xml
===================================================================
--- jbpm3/trunk/modules/enterprise/scripts/antrun-test-jars.xml 2009-01-13 11:39:31 UTC (rev 3632)
+++ jbpm3/trunk/modules/enterprise/scripts/antrun-test-jars.xml 2009-01-13 18:03:40 UTC (rev 3633)
@@ -34,7 +34,7 @@
<include name="org/jbpm/enterprise/config/AppServerConfigurationsTest.class"/>
<include name="org/jbpm/enterprise/ejbtimer/EjbSchedulerTest*.class"/>
<include name="org/jbpm/enterprise/jms/JmsMessageTest*.class"/>
- <include name="org/jbpm/enterprise/jta/JtaDbPersistenceTest.class"/>
+ <include name="org/jbpm/enterprise/jta/JtaDbPersistenceTest*.class"/>
</classes>
<lib dir="${tests.output.dir}/test-dependencies">
<include name="aspectjrt*.jar"/>
Modified: jbpm3/trunk/modules/enterprise/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- jbpm3/trunk/modules/enterprise/src/main/resources/META-INF/ejb-jar.xml 2009-01-13 11:39:31 UTC (rev 3632)
+++ jbpm3/trunk/modules/enterprise/src/main/resources/META-INF/ejb-jar.xml 2009-01-13 18:03:40 UTC (rev 3633)
@@ -12,7 +12,7 @@
<session>
<description>Executes commands in a separate context.</description>
- <display-name>jBPM Command Service Session Bean</display-name>
+ <display-name>jBPM Command Service</display-name>
<ejb-name>CommandServiceBean</ejb-name>
<home>org.jbpm.ejb.RemoteCommandServiceHome</home>
<remote>org.jbpm.ejb.RemoteCommandService</remote>
@@ -36,8 +36,8 @@
<ejb-local-ref>
<description>
- Link to the local entity bean that implements the scheduler service. Required for
- processes that contain timers.
+ Link to the local entity bean that implements the scheduler service.
+ Required for that contain timers.
</description>
<ejb-ref-name>ejb/TimerEntityBean</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
@@ -49,8 +49,8 @@
<!-- Timer service bean ==>
<ejb-local-ref>
<description>
- Link to the local session bean that implements the scheduler service. Deprecated, replaced
- by the LocalTimerEntityBean.
+ Link to the local session bean that implements the scheduler service.
+ Deprecated, replaced by LocalTimerEntityBean.
</description>
<ejb-ref-name>ejb/LocalTimerServiceBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
@@ -62,8 +62,8 @@
<resource-ref>
<description>
- Logical name of the data source that provides connections to the persistence service. Must
- match the hibernate.connection.datasource property in the Hibernate configuration file.
+ Logical name of the data source that provides connections to the persistence service.
+ Must match the hibernate.connection.datasource property.
</description>
<res-ref-name>jdbc/JbpmDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
@@ -72,8 +72,8 @@
<resource-ref>
<description>
- Logical name of the factory that provides JMS connections to the message service. Required
- for processes that contain asynchronous continuations.
+ Logical name of the factory that provides JMS connections to the message service.
+ Required for processes that contain asynchronous continuations.
</description>
<res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
<res-type>javax.jms.ConnnectionFactory</res-type>
@@ -112,7 +112,7 @@
Interacts with the EJB timer service to schedule jBPM timers. Deprecated, replaced by the
TimerEntityBean.
</description>
- <display-name>jBPM Timer Service Session Bean</display-name>
+ <display-name>jBPM Timer Service</display-name>
<ejb-name>TimerServiceBean</ejb-name>
<local-home>org.jbpm.scheduler.ejbtimer.LocalTimerServiceHome</local-home>
<local>org.jbpm.scheduler.ejbtimer.LocalTimerService</local>
@@ -137,7 +137,7 @@
<description>
Listens for serialized commands and routes them to the command service session bean.
</description>
- <display-name>jBPM Command Listener Message Driven Bean</display-name>
+ <display-name>jBPM Command Listener</display-name>
<ejb-name>CommandListenerBean</ejb-name>
<ejb-class>org.jbpm.ejb.impl.CommandListenerBean</ejb-class>
<transaction-type>Container</transaction-type>
@@ -167,8 +167,8 @@
<message-destination-ref>
<description>
- Messages that do not contain a command are sent to the queue referenced here. Optional;
- if absent, such messages are rejected, which may cause the container to redeliver.
+ Messages that do not contain a command are sent to the queue referenced here.
+ If absent, said messages are rejected, which may cause the container to redeliver.
</description>
<message-destination-ref-name>jms/DeadLetterQueue</message-destination-ref-name>
<message-destination-type>javax.jms.Queue</message-destination-type>
@@ -181,7 +181,7 @@
Listens for job references and delegates execution of the referenced Job to the command
service session bean.
</description>
- <display-name>jBPM Job Listener Message Driven Bean</display-name>
+ <display-name>jBPM Job Listener</display-name>
<ejb-name>JobListenerBean</ejb-name>
<ejb-class>org.jbpm.ejb.impl.JobListenerBean</ejb-class>
<transaction-type>Container</transaction-type>
@@ -222,7 +222,7 @@
<entity>
<description>Interacts with the EJB timer service to schedule jBPM timers.</description>
- <display-name>jBPM Timer Entity Bean</display-name>
+ <display-name>jBPM Timer</display-name>
<ejb-name>TimerEntityBean</ejb-name>
<home>org.jbpm.ejb.TimerEntityHome</home>
<remote>org.jbpm.ejb.TimerEntity</remote>
Modified: jbpm3/trunk/modules/enterprise/src/main/resources/META-INF/jboss.xml
===================================================================
--- jbpm3/trunk/modules/enterprise/src/main/resources/META-INF/jboss.xml 2009-01-13 11:39:31 UTC (rev 3632)
+++ jbpm3/trunk/modules/enterprise/src/main/resources/META-INF/jboss.xml 2009-01-13 18:03:40 UTC (rev 3633)
@@ -9,11 +9,11 @@
<session>
<ejb-name>CommandServiceBean</ejb-name>
- <jndi-name>ejb/CommandServiceBean</jndi-name>
- <local-jndi-name>java:ejb/CommandServiceBean</local-jndi-name>
+ <jndi-name>jbpm/CommandServiceBean</jndi-name>
+ <local-jndi-name>java:jbpm/CommandServiceBean</local-jndi-name>
<resource-ref>
<res-ref-name>jdbc/JbpmDataSource</res-ref-name>
- <jndi-name>java:/JbpmDS</jndi-name>
+ <jndi-name>java:JbpmDS</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
@@ -47,8 +47,8 @@
<entity>
<ejb-name>TimerEntityBean</ejb-name>
- <jndi-name>ejb/TimerEntityBean</jndi-name>
- <local-jndi-name>java:ejb/TimerEntityBean</local-jndi-name>
+ <jndi-name>jbpm/TimerEntityBean</jndi-name>
+ <local-jndi-name>java:jbpm/TimerEntityBean</local-jndi-name>
</entity>
</enterprise-beans>
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java 2009-01-13 11:39:31 UTC (rev 3632)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java 2009-01-13 18:03:40 UTC (rev 3633)
@@ -67,7 +67,8 @@
if (commandServiceHome == null) {
Context initialContext = new InitialContext();
try {
- commandServiceHome = (LocalCommandServiceHome) initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
+ commandServiceHome = (LocalCommandServiceHome) initialContext
+ .lookup("java:comp/env/ejb/CommandServiceBean");
}
finally {
initialContext.close();
@@ -206,10 +207,9 @@
+ " <end-state name='end' />"
+ "</process-definition>");
long processId = launchProcess("sequence").getId();
- char state = 'b';
- for (int i = 0; i < 4; i++) {
+ for (char state = 'b'; state <= 'e'; state++) {
EventCallback.waitForEvent(Event.EVENTTYPE_TIMER);
- assertEquals(Character.toString(state++), getProcessState(processId));
+ assertEquals(Character.toString(state), getProcessState(processId));
}
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
assertTrue(isProcessFinished(processId));
@@ -266,14 +266,13 @@
private ProcessInstance launchProcess(String processName) throws RemoteException {
StartProcessInstanceCommand command = new StartProcessInstanceCommand();
- command.setProcessName(processName);
+ command.setProcessDefinitionName(processName);
command.setVariables(Collections.singletonMap("eventCallback", new EventCallback()));
return (ProcessInstance) commandService.execute(command);
}
private void signalProcess(final long processId) throws RemoteException {
commandService.execute(new Command() {
-
private static final long serialVersionUID = 1L;
public Object execute(JbpmContext jbpmContext) throws Exception {
@@ -285,7 +284,6 @@
private String getProcessState(final long processId) throws RemoteException {
return (String) commandService.execute(new Command() {
-
private static final long serialVersionUID = 1L;
public Object execute(JbpmContext jbpmContext) throws Exception {
@@ -296,7 +294,6 @@
private boolean isProcessFinished(final long processId) throws RemoteException {
Boolean isFinished = (Boolean) commandService.execute(new Command() {
-
private static final long serialVersionUID = 1L;
public Object execute(JbpmContext jbpmContext) throws Exception {
@@ -308,7 +305,6 @@
private void cancelTimer(final String timerName, final long tokenId) throws RemoteException {
commandService.execute(new Command() {
-
private static final long serialVersionUID = 1L;
public Object execute(JbpmContext jbpmContext) throws Exception {
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java 2009-01-13 11:39:31 UTC (rev 3632)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java 2009-01-13 18:03:40 UTC (rev 3633)
@@ -52,33 +52,28 @@
*
* @author Alejandro Guizar
*/
-public class JmsMessageTest extends ServletTestCase
-{
- private static Log log = LogFactory.getLog(JmsMessageTest.class);
-
- private LocalCommandService commandService;
+public class JmsMessageTest extends ServletTestCase {
+ private LocalCommandService commandService;
private static LocalCommandServiceHome commandServiceHome;
- static final int processExecutionCount = 5;
- static final int maxWaitTime = 10 * 1000;
+ private static final int processExecutionCount = 5;
+ private static final int maxWaitTime = 10 * 1000;
- public static Test suite() throws Exception
- {
+ private static final Log log = LogFactory.getLog(JmsMessageTest.class);
+
+ public static Test suite() throws Exception {
return new IntegrationTestSetup(JmsMessageTest.class, "enterprise-test.war");
}
- protected void setUp() throws Exception
- {
- if (commandServiceHome == null)
- {
+ protected void setUp() throws Exception {
+ if (commandServiceHome == null) {
Context initialContext = new InitialContext();
- try
- {
- commandServiceHome = (LocalCommandServiceHome)initialContext.lookup("java:comp/env/ejb/CommandServiceBean");
+ try {
+ commandServiceHome = (LocalCommandServiceHome) initialContext
+ .lookup("java:comp/env/ejb/CommandServiceBean");
}
- finally
- {
+ finally {
initialContext.close();
}
}
@@ -86,15 +81,13 @@
log.info("### " + getName() + " started ###");
}
- protected void tearDown() throws Exception
- {
+ protected void tearDown() throws Exception {
log.info("### " + getName() + " done ###");
commandService = null;
EventCallback.clear();
}
- public void testAsyncNode()
- {
+ public void testAsyncNode() {
deployProcess("<process-definition name='node'>"
+ " <event type='process-end'>"
+ " <action expression='#{eventCallback.processEnd}'/>"
@@ -107,14 +100,13 @@
+ " </node>"
+ " <end-state name='end' />"
+ "</process-definition>");
-
+
long processId = launchProcess("node").getId();
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
assertTrue("Process has ended", hasProcessEnded(processId));
}
- public void testAsyncAction()
- {
+ public void testAsyncAction() {
deployProcess("<process-definition name='action'>"
+ " <start-state name='start'>"
+ " <transition to='a' />"
@@ -132,7 +124,7 @@
+ " </node>"
+ " <end-state name='end' />"
+ "</process-definition>");
-
+
long processId = launchProcess("action").getId();
EventCallback.waitForEvent(Event.EVENTTYPE_NODE_ENTER);
EventCallback.waitForEvent(Event.EVENTTYPE_NODE_LEAVE);
@@ -140,8 +132,7 @@
assertTrue("Process has ended", hasProcessEnded(processId));
}
- public void testAsyncSequence()
- {
+ public void testAsyncSequence() {
deployProcess("<process-definition name='sequence'>"
+ " <event type='process-end'>"
+ " <action expression='#{eventCallback.processEnd}'/>"
@@ -166,17 +157,15 @@
+ " </node>"
+ " <end-state name='end' />"
+ "</process-definition>");
-
+
long processId = launchProcess("sequence").getId();
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
assertTrue("Process has ended", hasProcessEnded(processId));
}
- public void testAsyncFork() throws Exception
- {
+ public void testAsyncFork() throws Exception {
// [JBPM-1811] JmsMessageTest fails intermittently on HSQLDB
- if (getHibernateDialect().indexOf("HSQL") != -1)
- {
+ if (getHibernateDialect().indexOf("HSQL") != -1) {
return;
}
@@ -214,29 +203,26 @@
+ " </join>"
+ " <end-state name='end' />"
+ "</process-definition>");
-
+
long processId = launchProcess("fork").getId();
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
Thread.sleep(1000);
assertTrue("Process has ended", hasProcessEnded(processId));
}
- private String getHibernateDialect()
- {
- return (String)commandService.execute(new Command()
- {
+ private String getHibernateDialect() {
+ return (String) commandService.execute(new Command() {
private static final long serialVersionUID = 1L;
- public Object execute(JbpmContext jbpmContext) throws Exception
- {
- DbPersistenceServiceFactory factory = (DbPersistenceServiceFactory)jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
+ public Object execute(JbpmContext jbpmContext) throws Exception {
+ DbPersistenceServiceFactory factory = (DbPersistenceServiceFactory) jbpmContext
+ .getServiceFactory(Services.SERVICENAME_PERSISTENCE);
return factory.getConfiguration().getProperty(Environment.DIALECT);
}
});
}
- public void testAsyncExecutions()
- {
+ public void testAsyncExecutions() {
deployProcess("<process-definition name='execution'>"
+ " <event type='process-end'>"
+ " <action expression='#{eventCallback.processEnd}' />"
@@ -267,63 +253,51 @@
+ " </node>"
+ " <end-state name='end' />"
+ "</process-definition>");
-
+
long[] processIds = new long[processExecutionCount];
- for (int i = 0; i < processExecutionCount; i++)
- {
+ for (int i = 0; i < processExecutionCount; i++) {
processIds[i] = launchProcess("execution").getId();
EventCallback.waitForEvent(Event.EVENTTYPE_NODE_ENTER);
}
- for (int i = 0; i < processExecutionCount; i++)
- {
+ for (int i = 0; i < processExecutionCount; i++) {
EventCallback.waitForEvent(Event.EVENTTYPE_NODE_LEAVE);
}
- for (int i = 0; i < processExecutionCount; i++)
- {
+ for (int i = 0; i < processExecutionCount; i++) {
waitForProcessEnd(processIds[i]);
assertTrue(hasProcessEnded(processIds[i]));
}
}
- private ProcessDefinition deployProcess(String xml)
- {
- return (ProcessDefinition)commandService.execute(new DeployProcessCommand(xml));
+ private ProcessDefinition deployProcess(String xml) {
+ return (ProcessDefinition) commandService.execute(new DeployProcessCommand(xml));
}
- private ProcessInstance launchProcess(String processName)
- {
+ private ProcessInstance launchProcess(String processName) {
StartProcessInstanceCommand command = new StartProcessInstanceCommand();
command.setProcessDefinitionName(processName);
command.setVariables(Collections.singletonMap("eventCallback", new EventCallback()));
- return (ProcessInstance)commandService.execute(command);
+ return (ProcessInstance) commandService.execute(command);
}
- private boolean hasProcessEnded(final long processId)
- {
- Boolean isFinished = (Boolean)commandService.execute(new Command()
- {
+ private boolean hasProcessEnded(final long processId) {
+ Boolean isFinished = (Boolean) commandService.execute(new Command() {
private static final long serialVersionUID = 1L;
- public Object execute(JbpmContext jbpmContext) throws Exception
- {
+ public Object execute(JbpmContext jbpmContext) throws Exception {
return jbpmContext.loadProcessInstance(processId).hasEnded();
}
});
return isFinished.booleanValue();
}
- private void waitForProcessEnd(long processId)
- {
+ private void waitForProcessEnd(long processId) {
long startTime = System.currentTimeMillis();
- do
- {
+ do {
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END, 1000);
- if (System.currentTimeMillis() - startTime > maxWaitTime)
- {
+ if (System.currentTimeMillis() - startTime > maxWaitTime) {
log.warn("process " + processId + " took too long");
break;
}
- }
- while (!hasProcessEnded(processId));
+ } while (!hasProcessEnded(processId));
}
}
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java 2009-01-13 11:39:31 UTC (rev 3632)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java 2009-01-13 18:03:40 UTC (rev 3633)
@@ -32,229 +32,157 @@
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jboss.bpm.api.test.IntegrationTestSetup;
+import org.jbpm.command.Command;
+import org.jbpm.command.DeleteProcessDefinitionCommand;
+import org.jbpm.command.DeployProcessCommand;
+import org.jbpm.command.GetProcessInstanceCommand;
+import org.jbpm.command.StartProcessInstanceCommand;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.persistence.jta.JtaDbPersistenceService;
-public class JtaDbPersistenceTest extends ServletTestCase
-{
+public class JtaDbPersistenceTest extends ServletTestCase {
- private JbpmConfiguration jbpmConfiguration;
- private UserTransaction tx;
- private boolean rollback;
+ private CommandExecutor commandExecutor;
- private static long definitionId;
-
- public static Test suite() throws Exception
- {
+ public static Test suite() throws Exception {
return new IntegrationTestSetup(JtaDbPersistenceTest.class, "enterprise-test.war");
}
- protected void setUp() throws Exception
- {
- jbpmConfiguration = JbpmConfiguration.getInstance();
+ public void testExternalTx() throws Exception {
+ commandExecutor = new CommandExecutor(getUserTransaction());
+ playTx(false);
}
- public void testUserTx() throws Exception
- {
- tx = getUserTransaction();
- testServiceTx();
+ public void testExternalTxRollback() throws Exception {
+ commandExecutor = new CommandExecutor(getUserTransaction());
+ playTx(true);
}
- public void testUserTxRollback() throws Exception
- {
- tx = getUserTransaction();
- testServiceTxRollback();
+ public void testInternalTx() throws Exception {
+ commandExecutor = new CommandExecutor();
+ playTx(false);
}
- public void testServiceTx() throws Exception
- {
- long definitionId = deployProcess();
- long instanceId = launchProcess(definitionId);
- signal(instanceId);
- assertTrue(hasEnded(instanceId));
+ public void testInternalTxRollback() throws Exception {
+ commandExecutor = new CommandExecutor();
+ playTx(true);
}
- public void testServiceTxRollback() throws Exception
- {
- rollback = true;
+ private void playTx(boolean rollback) throws Exception {
long definitionId = deployProcess();
long instanceId = launchProcess(definitionId);
- signal(instanceId);
- assertFalse(hasEnded(instanceId));
+ signal(instanceId, rollback);
+ assertEquals(!rollback, hasEnded(instanceId));
+ deleteProcess(definitionId);
}
- private long deployProcess() throws Exception
- {
- if (definitionId == 0)
- {
- try
- {
- if (tx != null)
- tx.begin();
+ private long deployProcess() throws Exception {
+ ProcessDefinition definition = (ProcessDefinition) commandExecutor
+ .execute(new DeployProcessCommand("<process-definition name='tx'>"
+ + " <start-state name='start'>"
+ + " <transition to='midway' />"
+ + " </start-state>"
+ + " <state name='midway'>"
+ + " <transition to='end' />"
+ + " </state>"
+ + " <end-state name='end' />"
+ + "</process-definition>"));
+ return definition.getId();
+ }
+
+ private long launchProcess(long definitionId) throws Exception {
+ ProcessInstance instance = (ProcessInstance) commandExecutor
+ .execute(new StartProcessInstanceCommand().processDefinitionId(definitionId));
+ return instance.getId();
+ }
+
+ private void signal(final long instanceId, boolean rollback) throws Exception {
+ commandExecutor.execute(new Command() {
+ private static final long serialVersionUID = 1L;
+
+ public Object execute(JbpmContext jbpmContext) throws Exception {
+ jbpmContext.loadProcessInstance(instanceId).signal();
+ return null;
+ }
+ }, rollback);
+ }
+
+ private boolean hasEnded(long instanceId) throws Exception {
+ ProcessInstance instance = (ProcessInstance) commandExecutor
+ .execute(new GetProcessInstanceCommand(instanceId));
+ return instance.hasEnded();
+ }
+
+ private void deleteProcess(long definitionId) throws Exception {
+ commandExecutor.execute(new DeleteProcessDefinitionCommand(definitionId));
+ }
+
+ static class CommandExecutor {
+
+ private JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
+ private UserTransaction tx;
+
+ public CommandExecutor() {
+ }
+
+ public CommandExecutor(UserTransaction userTransaction) {
+ tx = userTransaction;
+ }
+
+ public Object execute(Command command) throws Exception {
+ return execute(command, false);
+ }
+
+ public Object execute(Command command, boolean rollback) throws Exception {
+ if (tx != null)
+ tx.begin();
+ try {
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try
- {
+ Object result;
+ try {
assertEquals(tx == null, isTxCreatedByService(jbpmContext));
- ProcessDefinition definition = ProcessDefinition.parseXmlString(
- "<process-definition name='tx'>" +
- " <start-state name='start'>" +
- " <transition to='midway' />" +
- " </start-state>" +
- " <state name='midway'>" +
- " <transition to='end' />" +
- " </state>" +
- " <end-state name='end' />" +
- "</process-definition>");
- jbpmContext.deployProcessDefinition(definition);
- definitionId = definition.getId();
+ result = command.execute(jbpmContext);
+ if (rollback && tx == null)
+ jbpmContext.setRollbackOnly();
}
- catch (RuntimeException e)
- {
+ catch (RuntimeException e) {
if (tx == null)
jbpmContext.setRollbackOnly();
throw e;
}
- finally
- {
+ finally {
jbpmContext.close();
}
- if (tx != null)
- tx.commit();
+ if (tx != null) {
+ if (rollback)
+ tx.rollback();
+ else
+ tx.commit();
+ }
+ return result;
}
- catch (Exception e)
- {
+ catch (Exception e) {
if (tx != null)
tx.rollback();
throw e;
}
}
- return definitionId;
}
- private long launchProcess(long definitionId) throws Exception
- {
- try
- {
- if (tx != null)
- tx.begin();
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- ProcessInstance instance;
- try
- {
- assertEquals(tx == null, isTxCreatedByService(jbpmContext));
- ProcessDefinition definition = jbpmContext.getGraphSession().loadProcessDefinition(definitionId);
- instance = new ProcessInstance(definition);
- instance.signal();
- jbpmContext.save(instance);
- }
- catch (RuntimeException e)
- {
- if (tx == null)
- jbpmContext.setRollbackOnly();
- throw e;
- }
- finally
- {
- jbpmContext.close();
- }
- if (tx != null)
- tx.commit();
- return instance.getId();
- }
- catch (Exception e)
- {
- if (tx != null)
- tx.rollback();
- throw e;
- }
+ private static boolean isTxCreatedByService(JbpmContext jbpmContext) {
+ JtaDbPersistenceService persistenceService = (JtaDbPersistenceService) jbpmContext
+ .getServices().getPersistenceService();
+ return persistenceService.isJtaTxCreated();
}
- private void signal(long instanceId) throws Exception
- {
- try
- {
- if (tx != null)
- tx.begin();
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try
- {
- assertEquals(tx == null, isTxCreatedByService(jbpmContext));
- ProcessInstance instance = jbpmContext.loadProcessInstanceForUpdate(instanceId);
- instance.signal();
- if (rollback && tx == null)
- jbpmContext.setRollbackOnly();
- }
- catch (RuntimeException e)
- {
- if (tx == null)
- jbpmContext.setRollbackOnly();
- throw e;
- }
- finally
- {
- jbpmContext.close();
- }
- if (tx != null)
- {
- if (rollback)
- tx.rollback();
- else
- tx.commit();
- }
+ private static UserTransaction getUserTransaction() throws NamingException {
+ Context initial = new InitialContext();
+ try {
+ return (UserTransaction) initial.lookup("java:comp/UserTransaction");
}
- catch (Exception e)
- {
- if (tx != null)
- tx.rollback();
- throw e;
+ finally {
+ initial.close();
}
}
-
- private boolean hasEnded(long instanceId) throws Exception
- {
- try
- {
- if (tx != null)
- tx.begin();
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- ProcessInstance instance;
- try
- {
- assertEquals(tx == null, isTxCreatedByService(jbpmContext));
- instance = jbpmContext.loadProcessInstanceForUpdate(instanceId);
- }
- catch (RuntimeException e)
- {
- if (tx == null)
- jbpmContext.setRollbackOnly();
- throw e;
- }
- finally
- {
- jbpmContext.close();
- }
- if (tx != null)
- tx.commit();
- return instance.hasEnded();
- }
- catch (Exception e)
- {
- if (tx != null)
- tx.rollback();
- throw e;
- }
- }
-
- private boolean isTxCreatedByService(JbpmContext jbpmContext)
- {
- JtaDbPersistenceService persistenceService = (JtaDbPersistenceService)jbpmContext.getServices().getPersistenceService();
- return persistenceService.isJtaTxCreated();
- }
-
- private static UserTransaction getUserTransaction() throws NamingException
- {
- Context initial = new InitialContext();
- return (UserTransaction)initial.lookup("java:comp/UserTransaction");
- }
}
Modified: jbpm3/trunk/modules/enterprise/src/test/resources/enterprise/WEB-INF/jboss-web.xml
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/resources/enterprise/WEB-INF/jboss-web.xml 2009-01-13 11:39:31 UTC (rev 3632)
+++ jbpm3/trunk/modules/enterprise/src/test/resources/enterprise/WEB-INF/jboss-web.xml 2009-01-13 18:03:40 UTC (rev 3633)
@@ -16,16 +16,17 @@
<ejb-ref>
<ejb-ref-name>ejb/CommandServiceBean</ejb-ref-name>
- <jndi-name>java:ejb/CommandServiceBean</jndi-name>
+ <jndi-name>java:jbpm/CommandServiceBean</jndi-name>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/TimerEntityBean</ejb-ref-name>
- <jndi-name>java:ejb/TimerEntityBean</jndi-name>
+ <jndi-name>java:jbpm/TimerEntityBean</jndi-name>
</ejb-ref>
<message-destination-ref>
<message-destination-ref-name>jms/JobQueue</message-destination-ref-name>
<jndi-name>queue/JbpmJobQueue</jndi-name>
</message-destination-ref>
+
</jboss-web>
\ No newline at end of file
17 years, 3 months
JBoss JBPM SVN: r3632 - jbpm3/trunk/modules/core/src/test/java/org/jbpm/command.
by do-not-reply@jboss.org
Author: camunda
Date: 2009-01-13 06:39:31 -0500 (Tue, 13 Jan 2009)
New Revision: 3632
Modified:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/command/ProcessInstanceCommandTest.java
Log:
Fixed problems with test case after introducing forUpdate methods in CancelCommands (JBPM-1962)
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/command/ProcessInstanceCommandTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/command/ProcessInstanceCommandTest.java 2009-01-12 17:29:23 UTC (rev 3631)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/command/ProcessInstanceCommandTest.java 2009-01-13 11:39:31 UTC (rev 3632)
@@ -78,6 +78,11 @@
Token childToken = (Token)iterator.next();
assertTrue(childToken.hasEnded());
}
+
+ // required to close jbpm context which has an auto save registered for the ProcessInstance
+ // If this is missing, the ProcessInstance gets deleted by the tearDown
+ // and the auto save will cause an exception!
+ super.newTransaction();
}
public void testSuspendResumeProcessInstanceCommand() throws Exception {
17 years, 3 months
JBoss JBPM SVN: r3631 - jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-01-12 12:29:23 -0500 (Mon, 12 Jan 2009)
New Revision: 3631
Modified:
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ProcessInstanceImpl.java
Log:
Fix JBPM-1968: Integration layer didn't write process logs and start events
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ProcessInstanceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ProcessInstanceImpl.java 2009-01-12 08:55:44 UTC (rev 3630)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ProcessInstanceImpl.java 2009-01-12 17:29:23 UTC (rev 3631)
@@ -44,6 +44,7 @@
import org.jboss.bpm.api.service.ProcessEngine;
import org.jboss.bpm.api.service.ProcessInstanceService;
import org.jbpm.JbpmContext;
+import org.jbpm.graph.log.ProcessInstanceCreateLog;
import org.jbpm.integration.spec.runtime.InvocationProxy;
import org.jbpm.integration.spec.runtime.TokenImpl;
import org.jbpm.util.Clock;
@@ -198,6 +199,12 @@
procInst.setStart(Clock.getCurrentTime());
procInst.setRootToken(rootToken);
+ // https://jira.jboss.org/jira/browse/JBPM-1968
+ // logging and events
+ rootToken.addLog(new ProcessInstanceCreateLog());
+ org.jbpm.graph.def.Node initialNode = rootToken.getNode();
+ procInst.fireStartEvent(initialNode);
+
// Create the root token
Token token = TokenImpl.newInstance(getProcessEngine(), rootToken);
17 years, 3 months
JBoss JBPM SVN: r3630 - jbpm3/trunk/hudson/hudson-home.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-01-12 03:55:44 -0500 (Mon, 12 Jan 2009)
New Revision: 3630
Modified:
jbpm3/trunk/hudson/hudson-home/command.sh
Log:
[JBPM-1408] When nothing matches, grep exits with a non-zero status
Modified: jbpm3/trunk/hudson/hudson-home/command.sh
===================================================================
--- jbpm3/trunk/hudson/hudson-home/command.sh 2009-01-11 08:22:21 UTC (rev 3629)
+++ jbpm3/trunk/hudson/hudson-home/command.sh 2009-01-12 08:55:44 UTC (rev 3630)
@@ -103,7 +103,7 @@
MVN_CMD="mvn -o -fae $ENVIRONMENT test"
echo $MVN_CMD; $MVN_CMD 2>&1 | tee $WORKSPACE/tests.log
cat $WORKSPACE/tests.log | egrep FIXME\|FAILED | sort -u | tee $WORKSPACE/fixme.txt
-cat $WORKSPACE/fixme.txt | egrep "\[\S*]" > $WORKSPACE/errata-$CONTAINER.txt
+cat $WORKSPACE/fixme.txt | egrep "\[\S*]" > $WORKSPACE/errata-$CONTAINER.txt || :
#
# stop jbossas
17 years, 3 months
JBoss JBPM SVN: r3629 - jbpm4/trunk/modules/pvm.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-01-11 03:22:21 -0500 (Sun, 11 Jan 2009)
New Revision: 3629
Modified:
jbpm4/trunk/modules/pvm/pom.xml
Log:
excluded normal message test
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2009-01-11 05:15:48 UTC (rev 3628)
+++ jbpm4/trunk/modules/pvm/pom.xml 2009-01-11 08:22:21 UTC (rev 3629)
@@ -105,6 +105,9 @@
<configuration>
<excludes>
<exclude>**/*TestCase.java</exclude>
+
+ <!-- https://jira.jboss.org/jira/browse/JBPM-1965 -->
+ <exclude>**/NormalMessageTest.java</exclude>
</excludes>
</configuration>
</plugin>
17 years, 3 months
JBoss JBPM SVN: r3628 - jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-01-11 00:15:48 -0500 (Sun, 11 Jan 2009)
New Revision: 3628
Modified:
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandExecutorTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java
Log:
minor edits to enterprise tests
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandExecutorTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandExecutorTest.java 2009-01-09 20:15:34 UTC (rev 3627)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandExecutorTest.java 2009-01-11 05:15:48 UTC (rev 3628)
@@ -48,12 +48,14 @@
private LocalCommandExecutor commandExecutor;
- private static final Log log = Log.getLog(CommandExecutorTest.class.getName());
+ private static final Log log = Log
+ .getLog(CommandExecutorTest.class.getName());
private static LocalCommandExecutorHome commandExecutorHome;
public static Test suite() {
- return new IntegrationTestSetup(CommandExecutorTest.class, "jbpm-enterprise-test.ear");
+ return new IntegrationTestSetup(CommandExecutorTest.class,
+ "jbpm-enterprise-test.ear");
}
@Override
@@ -62,8 +64,10 @@
// retrieve managed objects
InitialContext initialContext = new InitialContext();
try {
- commandExecutorHome = (LocalCommandExecutorHome) initialContext.lookup("java:comp/env/ejb/LocalCommandExecutor");
- } finally {
+ commandExecutorHome = (LocalCommandExecutorHome) initialContext
+ .lookup("java:comp/env/ejb/LocalCommandExecutor");
+ }
+ finally {
initialContext.close();
}
}
@@ -76,15 +80,23 @@
}
/**
+ * <p>
* This scenario tests a command that completes with no incident.
+ * </p>
* <h3>Preconditions</h3>
+ * <p>
* The TEST_PHRASE table does not contain any row with the specified text.
+ * </p>
* <h3>Behavior</h3>
+ * <p>
* The {@link InsertCommentCmd} command creates a row with the specified text.
+ * </p>
* <h3>Postconditions</h3>
+ * <p>
* A new row with the specified text exists in the table. The
- * {@link RemoveCommentCmd} command removes the row, and the return value confirms
- * it was there.
+ * {@link RemoveCommentCmd} command removes the row, and the return value
+ * confirms it was there.
+ * </p>
*/
public void testHappyCommand() throws CreateException {
String text = "been there, done that";
@@ -94,18 +106,26 @@
}
/**
+ * <p>
* This scenario tests a command that throws a checked exception inside the
* {@link InsertCommentCmd#execute(org.jbpm.env.Environment) execute} method.
+ * </p>
* <h3>Preconditions</h3>
+ * <p>
* The TEST_PHRASE table does not contain any row with the specified text.
+ * </p>
* <h3>Behavior</h3>
- * The {@link InsertCommentCmd} command creates a row with the specified text. The
- * command is configured to throw a checked exception before completing.
+ * <p>
+ * The {@link InsertCommentCmd} command creates a row with the specified text.
+ * The command is configured to throw a checked exception before completing.
+ * </p>
* <h3>Postconditions</h3>
+ * <p>
* The command executor throws an {@link EJBException} and rolls back the
* managed transaction. No row with the specified text exists in the database.
* The {@link RemoveCommentCmd} command return value confirms the row was not
* there.
+ * </p>
*/
public void testNoisyCommand() throws CreateException {
String text = "houston, we have a problem";
@@ -113,7 +133,8 @@
try {
commandExecutor.execute(new InsertCommentCmd(text, /* fail? */true));
fail("expected: " + EJBException.class.getSimpleName());
- } catch (EJBException e) {
+ }
+ catch (EJBException e) {
log.info("noisy command threw exception", e);
// verify phrase was NOT inserted
assertFalse(commandExecutor.execute(new RemoveCommentCmd(text)));
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java 2009-01-09 20:15:34 UTC (rev 3627)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java 2009-01-11 05:15:48 UTC (rev 3628)
@@ -91,14 +91,25 @@
}
/**
- * This scenario tests a command message that completes with no incident. <h3>
- * Preconditions</h3> The TEST_PHRASE table does not contain any row with the
- * specified text. <h3>Behavior</h3> The {@link InsertCommentCmd} command
- * message creates a row with the specified text. Once the command completes,
- * the command receiver sends the result to the reply queue. <h3>
- * Postconditions</h3> A new row with the specified text exists in the table.
- * The {@link RemoveCommentCmd} command message removes the row. The result
- * sent to the reply queue confirms the row was there.
+ * <p>
+ * This scenario tests a command message that completes with no incident.
+ * </p>
+ * <h3>Preconditions</h3>
+ * <p>
+ * The TEST_PHRASE table does not contain any row with the specified text.
+ * </p>
+ * <h3>Behavior</h3>
+ * <p>
+ * The {@link InsertCommentCmd} command message creates a row with the
+ * specified text. Once the command completes, the command receiver sends the
+ * result to the reply queue.
+ * </p>
+ * <h3>Postconditions</h3>
+ * <p>
+ * A new row with the specified text exists in the table. The
+ * {@link RemoveCommentCmd} command message removes the row. The result sent
+ * to the reply queue confirms the row was there.
+ * </p>
*/
public void testHappyMessage() throws JMSException {
final String text = "been there, done that";
@@ -139,18 +150,29 @@
}
/**
+ * <p>
* This scenario tests a command message that throws a checked exception
* inside the {@link InsertCommentCmd#execute(org.jbpm.env.Environment)
- * execute} method. <h3>Preconditions</h3> The TEST_PHRASE table does not
- * contain any row with the specified text. <h3>Behavior</h3> The
- * {@link InsertCommentCmd} command message creates a row with the specified
- * text. The command is configured to throw a checked exception before
- * completing. The exception prevents the command receiver from sending the
- * result to the reply queue. <h3>Postconditions</h3> The command receiver
- * rolls back the managed transaction and puts the insertion message back in
- * the command queue. No row with the specified exists in the database. The
- * {@link RemoveCommentCmd} command result sent to the reply queue confirms
- * the row was not there.
+ * execute} method.
+ * </p>
+ * <h3>Preconditions</h3>
+ * <p>
+ * The TEST_PHRASE table does not contain any row with the specified text.
+ * </p>
+ * <h3>Behavior</h3>
+ * <p>
+ * The {@link InsertCommentCmd} command message creates a row with the
+ * specified text. The command is configured to throw a checked exception
+ * before completing. The exception prevents the command receiver from sending
+ * the result to the reply queue.
+ * </p>
+ * <h3>Postconditions</h3>
+ * <p>
+ * The command receiver rolls back the managed transaction and puts the
+ * insertion message back in the command queue. No row with the specified
+ * exists in the database. The {@link RemoveCommentCmd} command result sent to
+ * the reply queue confirms the row was not there.
+ * </p>
*/
public void testNoisyMessage() throws JMSException {
final String text = "houston, we have a problem";
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-01-09 20:15:34 UTC (rev 3627)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-01-11 05:15:48 UTC (rev 3628)
@@ -59,6 +59,7 @@
private String processDefinitionId;
+ private Date dueDate;
private static final int TIMEOUT = 2000;
public static Test suite() {
@@ -80,11 +81,16 @@
}
// create local bean
commandExecutor = commandExecutorHome.create();
- // deploy process
+ // define process
+ dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
ClientProcessDefinition processDefinition = ProcessFactory.build(getName())
- .node().initial().timer(TIMEOUT + " milliseconds", null).event(
- "timeout").listener(new ObjectDescriptor(HappyActivity.class))
+ .node()
+ .initial()
+ .timer(dueDate, null)
+ .event("timeout")
+ .listener(new ObjectDescriptor(HappyActivity.class))
.done();
+ // deploy process
List<ProcessDefinition> processDefinitions = commandExecutor
.execute(new DeployCmd(new DeploymentImpl(processDefinition)));
assertEquals(1, processDefinitions.size());
@@ -96,17 +102,27 @@
}
/**
+ * <p>
* This scenario schedules a non-repeating timer whose referenced activity
- * completes with no incident. <h3>Preconditions</h3> The activity has not
- * executed. <h3>Behavior</h3> The {@link ScheduleTimerCmd} command activates
- * a timer. After that, the test waits for the activity to execute. Upon
- * timeout, the {@linkplain HappyActivity activity} notifies the test of its
- * execution. <h3>Postconditions</h3> The activity executes on or after the
- * timer's due date.
+ * completes with no incident.
+ * </p>
+ * <h3>Preconditions</h3>
+ * <p>
+ * The activity has not executed.
+ * </p>
+ * <h3>Behavior</h3>
+ * <p>
+ * The {@link ScheduleTimerCmd} command activates a timer. After that, the
+ * test waits for the activity to execute. Upon timeout, the
+ * {@linkplain HappyActivity activity} notifies the test of its execution.
+ * </p>
+ * <h3>Postconditions</h3>
+ * <p>
+ * The activity executes on or after the timer's due date.
+ * </p>
*/
public void testSchedule() throws CreateException {
// start an execution
- Date dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
commandExecutor.execute(new StartExecutionCmd(processDefinitionId, null,
null));
@@ -116,12 +132,23 @@
}
/**
+ * <p>
* This scenario schedules a non-repeating timer and immediately cancels it.
- * <h3>Preconditions</h3> The activity has not executed. <h3>Behavior</h3> The
- * {@link ScheduleTimerCmd} command activates a timer, which is immediately
- * disabled by the {@link CancelTimerCmd} command. After that, the test waits
- * past the timer's due date. <h3>Postconditions</h3> The activity does not
- * execute, ever.
+ * </p>
+ * <h3>Preconditions</h3>
+ * <p>
+ * The activity has not executed.
+ * </p>
+ * <h3>Behavior</h3>
+ * <p>
+ * The {@link ScheduleTimerCmd} command activates a timer, which is
+ * immediately disabled by the {@link CancelTimerCmd} command. After that, the
+ * test waits past the timer's due date.
+ * </p>
+ * <h3>Postconditions</h3>
+ * <p>
+ * The activity does not execute, ever.
+ * </p>
*/
public void testCancel() throws CreateException {
// start an execution
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-01-09 20:15:34 UTC (rev 3627)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-01-11 05:15:48 UTC (rev 3628)
@@ -31,6 +31,7 @@
import junit.framework.Test;
import org.apache.cactus.ServletTestCase;
+import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.cmd.Command;
import org.jbpm.enterprise.internal.custom.HappyActivity;
import org.jbpm.enterprise.internal.custom.NoisyActivity;
@@ -41,7 +42,6 @@
import org.jbpm.enterprise.internal.ejb.TimerEB;
import org.jbpm.env.Environment;
import org.jbpm.log.Log;
-import org.jbpm.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.cmd.DeployCmd;
import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
@@ -54,15 +54,16 @@
import org.jbpm.test.enterprise.IntegrationTestSetup;
/**
- * Server-side test for the {@linkplain TimerEB timerImpl bean}. The local
- * interface is used.
+ * Server-side test for the {@linkplain TimerEB timer bean}. The local interface
+ * is used.
*
* @author Alejandro Guizar
*/
public class TimerTest extends ServletTestCase {
- private OpenProcessDefinition processDefinition;
+ private ClientProcessDefinition processDefinition;
private ObjectDescriptor activityDescriptor = new ObjectDescriptor();
+ private Date dueDate;
private LocalCommandExecutor commandExecutor;
@@ -95,9 +96,14 @@
// create local bean
commandExecutor = commandExecutorHome.create();
// define process
- processDefinition = ProcessFactory.build(getName()).node().initial().timer(
- TIMEOUT + " milliseconds", null).event("timeout").listener(
- activityDescriptor).done();
+ dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
+ processDefinition = ProcessFactory.build(getName())
+ .node()
+ .initial()
+ .timer(dueDate, null)
+ .event("timeout")
+ .listener(activityDescriptor)
+ .done();
}
protected void tearDown() throws Exception {
@@ -105,13 +111,25 @@
}
/**
- * This scenario tests a non-repeating timerImpl whose referenced activity
- * completes with no incident. <h3>Preconditions</h3> The activity has not
- * executed. <h3>Behavior</h3> The {@link CreateTimerCmd} command subscribes a
- * timerImpl bean to the EJB timerImpl service. After that, the test waits for
- * the activity to execute. Upon timeout, the {@linkplain HappyActivity
- * activity} notifies the test of its execution. <h3>Postconditions</h3> The
- * activity executes on or after the timerImpl's due date.
+ * <p>
+ * This scenario tests a non-repeating timer whose referenced activity
+ * completes with no incident.
+ * </p>
+ * <h3>Preconditions</h3>
+ * <p>
+ * The activity has not executed.
+ * </p>
+ * <h3>Behavior</h3>
+ * <p>
+ * The {@link CreateTimerCmd} command subscribes a timer bean to the EJB
+ * timer service. After that, the test waits for the activity to execute.
+ * Upon timeout, the {@linkplain HappyActivity activity} notifies the test of
+ * its execution.
+ * </p>
+ * <h3>Postconditions</h3>
+ * <p>
+ * The activity executes on or after the timer's due date.
+ * </p>
*/
public void testHappyTimer() throws CreateException {
activityDescriptor.setClassName(HappyActivity.class.getName());
@@ -121,27 +139,37 @@
ExecutionImpl execution = (ExecutionImpl) commandExecutor
.execute(new StartExecutionCmd(processDefinition.getId(), null, null));
- Date dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
- TimerImpl timerImpl = new TimerImpl();
- timerImpl.setEventName("timeout");
- timerImpl.setDueDate(dueDate);
- timerImpl.setExecution(execution);
- commandExecutor.execute(new CreateTimerCmd(timerImpl));
+ TimerImpl timer = new TimerImpl();
+ timer.setEventName("timeout");
+ timer.setDueDate(dueDate);
+ timer.setExecution(execution);
+ commandExecutor.execute(new CreateTimerCmd(timer));
Date executionDate = HappyActivity.waitFor();
assertTrue(dueDate.compareTo(executionDate) <= 0);
}
/**
- * This scenario tests a non-repeating timerImpl whose referenced activity
- * throws a checked exception. <h3>Preconditions</h3> The activity has not
- * executed. <h3>Behavior</h3> The {@link CreateTimerCmd} command subscribes a
- * timerImpl bean to the EJB timerImpl service. After that, the test waits for
- * the activity to execute. Upon timeout, the {@linkplain NoisyActivity
- * activity} notifies the test of its execution, sets a variable and throws a
- * checked exception. <h3>Postconditions</h3> The activity executes on or
- * after the timerImpl's due date. The EJB timerImpl service rolls back the
- * managed transaction. The variable is unset.
+ * <p>
+ * This scenario tests a non-repeating timer whose referenced activity throws
+ * a checked exception.
+ * </p>
+ * <h3>Preconditions</h3>
+ * <p>
+ * The activity has not executed.
+ * </p>
+ * <h3>Behavior</h3>
+ * <p>
+ * The {@link CreateTimerCmd} command subscribes a timer bean to the EJB timer
+ * service. After that, the test waits for the activity to execute. Upon
+ * timeout, the {@linkplain NoisyActivity activity} notifies the test of its
+ * execution, sets a variable and throws a checked exception.
+ * </p>
+ * <h3>Postconditions</h3>
+ * <p>
+ * The activity executes on or after the timer's due date. The EJB timer
+ * service rolls back the managed transaction. The variable is unset.
+ * </p>
*/
public void testNoisyTimer() throws CreateException {
activityDescriptor.setClassName(NoisyActivity.class.getName());
@@ -151,12 +179,11 @@
ExecutionImpl execution = (ExecutionImpl) commandExecutor
.execute(new StartExecutionCmd(processDefinition.getId(), null, null));
- Date dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
- TimerImpl timerImpl = new TimerImpl();
- timerImpl.setEventName("timeout");
- timerImpl.setDueDate(dueDate);
- timerImpl.setExecution(execution);
- commandExecutor.execute(new CreateTimerCmd(timerImpl));
+ TimerImpl timer = new TimerImpl();
+ timer.setEventName("timeout");
+ timer.setDueDate(dueDate);
+ timer.setExecution(execution);
+ commandExecutor.execute(new CreateTimerCmd(timer));
Date executionDate = NoisyActivity.waitFor();
assertTrue(dueDate.compareTo(executionDate) <= 0);
@@ -169,16 +196,29 @@
}
/**
- * This scenario tests a repeating timerImpl whose referenced activity
- * completes with no incident. <h3>Preconditions</h3> The activity has not
- * executed. <h3>Behavior</h3> The {@link CreateTimerCmd} command subscribes a
- * timerImpl bean to the EJB timerImpl service. After that, the test waits for
- * the first execution of the activity, and then for the subsequent <em>n</em>
- * executions of the activity. Upon each timeout, the
- * {@linkplain HappyActivity activity} notifies the test of its execution. <h3>
- * Postconditions</h3> The first execution of the activity occurs on or after
- * the timerImpl's due date. The subsequent <em>n</em> executions of the
- * activity occur on or after the timerImpl's repeat interval.
+ * <p>
+ * This scenario tests a repeating timer whose referenced activity completes
+ * with no incident.
+ * </p>
+ * <h3>Preconditions</h3>
+ * <p>
+ * The activity has not executed.
+ * </p>
+ * <h3>Behavior</h3>
+ * <p>
+ * The {@link CreateTimerCmd} command subscribes a timer bean to the EJB timer
+ * service. After that, the test waits for the first execution of the
+ * activity, and then for the subsequent <em>n</em> executions of the
+ * activity. Upon each timeout, the {@linkplain HappyActivity activity}
+ * notifies the test of its execution.
+ * </p>
+ * <h3>
+ * Postconditions</h3>
+ * <p>
+ * The first execution of the activity occurs on or after the timer's due
+ * date. The subsequent <em>n</em> executions of the activity occur on or
+ * after the timer's repeat interval.
+ * </p>
*/
public void testCyclicTimer() throws CreateException {
activityDescriptor.setClassName(HappyActivity.class.getName());
@@ -188,13 +228,12 @@
ExecutionImpl execution = (ExecutionImpl) commandExecutor
.execute(new StartExecutionCmd(processDefinition.getId(), null, null));
- Date dueDate = new Date(System.currentTimeMillis() + TIMEOUT);
- TimerImpl timerImpl = new TimerImpl();
- timerImpl.setEventName("timeout");
- timerImpl.setDueDate(dueDate);
- timerImpl.setRepeat(REPEAT + " milliseconds");
- timerImpl.setExecution(execution);
- commandExecutor.execute(new CreateTimerCmd(timerImpl));
+ TimerImpl timer = new TimerImpl();
+ timer.setEventName("timeout");
+ timer.setDueDate(dueDate);
+ timer.setRepeat(REPEAT + " milliseconds");
+ timer.setExecution(execution);
+ commandExecutor.execute(new CreateTimerCmd(timer));
try {
Date executionTime = HappyActivity.waitFor();
@@ -208,34 +247,34 @@
}
}
finally {
- commandExecutor.execute(new CancelTimerCmd(timerImpl.getDbid()));
+ commandExecutor.execute(new CancelTimerCmd(timer.getDbid()));
}
}
static class CreateTimerCmd implements Command<Void> {
- private final TimerImpl timerImpl;
+ private final TimerImpl timer;
private static final long serialVersionUID = 1L;
- CreateTimerCmd(TimerImpl timerImpl) {
- this.timerImpl = timerImpl;
+ CreateTimerCmd(TimerImpl timer) {
+ this.timer = timer;
}
public Void execute(Environment environment) throws Exception {
DbSession dbSession = environment.get(DbSession.class);
- dbSession.save(timerImpl);
+ dbSession.save(timer);
dbSession.flush();
- long timerDbid = timerImpl.getDbid();
- log.info("scheduling " + timerImpl + " #" + timerDbid);
+ long timerDbid = timer.getDbid();
+ log.info("scheduling " + timer + " #" + timerDbid);
LocalTimer timerBean = timerHome.findByPrimaryKey(timerDbid);
timerBean.schedule();
return null;
}
public String toString() {
- return CreateTimerCmd.class.getSimpleName() + '(' + timerImpl + ')';
+ return CreateTimerCmd.class.getSimpleName() + '(' + timer + ')';
}
}
17 years, 3 months