JBoss JBPM SVN: r4815 - in jbpm4/trunk/modules/pvm/src/main: java/org/jbpm/pvm/internal/task and 1 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-14 12:04:40 -0400 (Thu, 14 May 2009)
New Revision: 4815
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
Log:
JBPM-2124 removed task id property
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java 2009-05-14 14:08:17 UTC (rev 4814)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java 2009-05-14 16:04:40 UTC (rev 4815)
@@ -54,9 +54,6 @@
if (! taskImpl.isPersisted()) {
Serializable dbid = session.save(taskImpl);
- if (taskImpl.getId() == null) {
- taskImpl.setId(dbid.toString());
- }
} else {
session.update(taskImpl);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-05-14 14:08:17 UTC (rev 4814)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-05-14 16:04:40 UTC (rev 4815)
@@ -67,7 +67,6 @@
public static final String STATE_SUSPENDED = "suspended";
public static final String STATE_ACTIVE = "active";
- protected String id;
protected String name;
protected String description;
@@ -388,12 +387,6 @@
public long getDbid() {
return dbid;
}
- public String getId() {
- return id;
- }
- public void setId(String id) {
- this.id = id;
- }
public String getName() {
return name;
}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml 2009-05-14 14:08:17 UTC (rev 4814)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml 2009-05-14 16:04:40 UTC (rev 4815)
@@ -4,65 +4,6 @@
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="false" package="org.jbpm.pvm.internal.task" default-access="field">
- <!-- ### ASSIGNABLE DEFINITIONS #########################################
- <class name="AssignableDefinitionImpl"
- table="JBPM4_ASSIGNDEF"
- discriminator-value="A" >
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator><column name="CLASS_" /></discriminator>
- <version name="dbversion" column="DBVERSION_" />
-
- <property name="name" column="NAME_"/>
- <property name="description" column="DESCR_"/>
- <property name="assigneeExpression" column="ASS_EXPR_"/>
- <property name="assigneeExpressionLanguage" column="ASS_EXPR_LANG_"/>
- <property name="candidateUsersExpression" column="CNDUSR_EXPR_"/>
- <property name="candidateUsersExpressionLanguage" column="CNDUSR_EXPRLANG_"/>
- <property name="candidateGroupsExpression" column="CNDGRP_EXPR_"/>
- <property name="candidateGroupsExpressionLanguage" column="CNDGRP_EXPRLANG_"/>
-
- <many-to-one name="assignmentHandlerDescriptor"
- column="ASSHNDLR_DESCR_"
- cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_ASSHNDLR_DESCR"
- index="IDX_ASSHNDLR_DESCR" />
-
- <subclass name="SwimlaneDefinitionImpl" discriminator-value="S">
- </subclass>
- -->
-
- <!-- ### TASK DEFINITION ################################################
- <subclass name="TaskDefinitionImpl" discriminator-value="T">
-
- <property name="priority" column="PRIORITY_"/>
- <property name="dueDateDuration" column="DUEDATE_"/>
-
- <many-to-one name="taskHandlerDescriptor"
- column="TSKHNDLRDESCR_"
- cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_TSKHNDLR_DESCR"
- index="IDX_TSKHNDLR_DESCR" />
-
- <many-to-one name="swimlaneDefinition"
- column="SWIMLDEF_"
- cascade="all"
- class="SwimlaneDefinitionImpl"
- foreign-key="FK_TSK_SWIMLDEF"
- index="IDX_TSK_SWIMLDEF" />
-
- <list name="subTaskDefinitions" cascade="all-delete-orphan">
- <key column="TASKDEF_" />
- <list-index column="TASKDEF_IDX_" />
- <one-to-many class="TaskDefinitionImpl" />
- </list>
- </subclass>
- </class>
- -->
-
<!-- ### TASK ########################################################### -->
<class name="TaskImpl"
table="JBPM4_TASK"
@@ -73,7 +14,6 @@
<discriminator type="char" column="CLASS_"/>
<version name="dbversion" column="DBVERSION_" />
- <property name="id" column="ID_" unique="true" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
<property name="state" column="STATE_"/>
15 years, 4 months
JBoss JBPM SVN: r4814 - in projects/gwt-console/trunk/gui/war/src/main: resources/org/jboss/bpm/console/public and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-14 10:08:17 -0400 (Thu, 14 May 2009)
New Revision: 4814
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css
Log:
Cleanup SettingsEditor layout
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java 2009-05-14 13:53:17 UTC (rev 4813)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java 2009-05-14 14:08:17 UTC (rev 4814)
@@ -40,14 +40,13 @@
public final static String ID = ServerStatusView.class.getName();
private Controller controller;
- private LayoutPanel container;
+
private ApplicationContext appContext;
public ServerStatusView(ApplicationContext appContext)
{
+ super();
this.appContext = appContext;
- container = new LayoutPanel();
-
}
public void setController(Controller controller)
@@ -57,15 +56,13 @@
public void update(ServerStatus status)
{
- Grid g = new Grid(status.getPlugins().size()+1, 2);
+ Grid g = new Grid(status.getPlugins().size(), 2);
+ g.setWidth("100%");
- g.setWidget(0, 0, new Label("Plugins:"));
-
- for (int row = 1; row < status.getPlugins().size()+1; ++row)
+ for (int row = 0; row < status.getPlugins().size(); ++row)
{
- PluginInfo p = status.getPlugins().get(row-1);
- g.setText(row, 0, p.getType());
- g.setStyleName("bpm-info-table");
+ PluginInfo p = status.getPlugins().get(row);
+ g.setText(row, 0, p.getType());
final Image img = p.isAvailable() ?
new Image("images/icons/confirm_small.png"):
@@ -74,10 +71,9 @@
g.setWidget(row, 1, img );
}
- container.add(g);
- this.add(container);
+ this.add(g);
this.invalidate();
- appContext.refreshView();
+
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2009-05-14 13:53:17 UTC (rev 4813)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2009-05-14 14:08:17 UTC (rev 4814)
@@ -56,6 +56,7 @@
final ScrollLayoutPanel layoutPanel = new ScrollLayoutPanel(
new BoxLayout(BoxLayout.Orientation.VERTICAL)
);
+ layoutPanel.setPadding(5);
// console info
Label console = new Label("Console Info");
@@ -65,23 +66,28 @@
Grid g1 = new Grid(1,2);
g1.setWidget(0,0, new Label("Version:"));
g1.setWidget(0,1, new Label(Version.VERSION));
+ g1.getColumnFormatter().setWidth(0, "20%");
- layoutPanel.add(g1);
+ layoutPanel.add(g1, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
// server info
Label server = new Label("Server Info");
server.setStyleName("bpm-label-header");
layoutPanel.add(server, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
- Grid g2 = new Grid(1,2);
+ ServerStatusView serverStatus = new ServerStatusView(appContext);
+
+ Grid g2 = new Grid(2,2);
g2.setWidget(0,0, new Label("Host:"));
g2.setWidget(0,1, new Label(appContext.getConfig().getConsoleServerUrl()));
- layoutPanel.add(g2);
-
- ServerStatusView serverStatus = new ServerStatusView(appContext);
- layoutPanel.add(serverStatus); // Doesn't render in grid
+ g2.setWidget(1,0 , new Label("Plugins:"));
+ g2.setWidget(1,1, serverStatus);
+ g2.getColumnFormatter().setWidth(0, "20%");
+
+ layoutPanel.add(g2, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
tabPanel.add(layoutPanel, "System Overview");
this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-05-14 13:53:17 UTC (rev 4813)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-05-14 14:08:17 UTC (rev 4814)
@@ -230,15 +230,6 @@
/* end - override gwt-log styles */
-.bpm-info-table {
- border:0px solid;
- width:100%;
- //background:#F8F8F8;
- background:#ffffff;
- border-left:5px solid #ffffff;
- padding:5px;
-}
-
/* start - custom widgets */
.bpm-detail-panel {
border:1px solid #E8E8E8;
15 years, 4 months
JBoss JBPM SVN: r4813 - in jbpm4/trunk/modules: distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF and 5 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-14 09:53:17 -0400 (Thu, 14 May 2009)
New Revision: 4813
Modified:
jbpm4/trunk/modules/distro/src/main/files/db/example.identities.sql
jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/jbosscmp-jdbc.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/META-INF/jboss-service.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/pvm/pom.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.history.hbm.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.identity.hbm.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.repository.hbm.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
Log:
JBPM-2174 verify different table names for jbpm 4: changed prefix to JBPM4_
Modified: jbpm4/trunk/modules/distro/src/main/files/db/example.identities.sql
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/example.identities.sql 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/distro/src/main/files/db/example.identities.sql 2009-05-14 13:53:17 UTC (rev 4813)
@@ -1,17 +1,17 @@
-INSERT INTO JBPM_ID_GROUP VALUES (1,0,'manager','manager','security-role',NULL);
-INSERT INTO JBPM_ID_GROUP VALUES (2,0,'administrator','administrator','security-role',NULL);
-INSERT INTO JBPM_ID_GROUP VALUES (3,0,'user','user','security-role',NULL);
-INSERT INTO JBPM_ID_GROUP VALUES(4,0,'sales','sales',NULL,NULL);
+INSERT INTO JBPM4_ID_GROUP VALUES (1,0,'manager','manager','security-role',NULL);
+INSERT INTO JBPM4_ID_GROUP VALUES (2,0,'administrator','administrator','security-role',NULL);
+INSERT INTO JBPM4_ID_GROUP VALUES (3,0,'user','user','security-role',NULL);
+INSERT INTO JBPM4_ID_GROUP VALUES(4,0,'sales','sales',NULL,NULL);
-INSERT INTO JBPM_ID_USER VALUES (1,0,'alex','password','Administrator Login','');
-INSERT INTO JBPM_ID_USER VALUES (2,0,'mike','password','Managers Login','');
-INSERT INTO JBPM_ID_USER VALUES (3,0,'peter','password','Users Login','');
-INSERT INTO JBPM_ID_USER VALUES (4,0,'mary','password','Users Login','');
+INSERT INTO JBPM4_ID_USER VALUES (1,0,'alex','password','Administrator Login','');
+INSERT INTO JBPM4_ID_USER VALUES (2,0,'mike','password','Managers Login','');
+INSERT INTO JBPM4_ID_USER VALUES (3,0,'peter','password','Users Login','');
+INSERT INTO JBPM4_ID_USER VALUES (4,0,'mary','password','Users Login','');
-INSERT INTO JBPM_ID_MEMBERSHIP VALUES (1,0,1,2,NULL);
-INSERT INTO JBPM_ID_MEMBERSHIP VALUES (2,0,2,1,NULL);
-INSERT INTO JBPM_ID_MEMBERSHIP VALUES (3,0,3,3,NULL);
-INSERT INTO JBPM_ID_MEMBERSHIP VALUES (4,0,3,4,NULL);
-INSERT INTO JBPM_ID_MEMBERSHIP VALUES (5,0,4,3,NULL);
-INSERT INTO JBPM_ID_MEMBERSHIP VALUES (6,0,4,4,NULL);
+INSERT INTO JBPM4_ID_MEMBERSHIP VALUES (1,0,1,2,NULL);
+INSERT INTO JBPM4_ID_MEMBERSHIP VALUES (2,0,2,1,NULL);
+INSERT INTO JBPM4_ID_MEMBERSHIP VALUES (3,0,3,3,NULL);
+INSERT INTO JBPM4_ID_MEMBERSHIP VALUES (4,0,3,4,NULL);
+INSERT INTO JBPM4_ID_MEMBERSHIP VALUES (5,0,4,3,NULL);
+INSERT INTO JBPM4_ID_MEMBERSHIP VALUES (6,0,4,4,NULL);
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/jbosscmp-jdbc.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/jbosscmp-jdbc.xml 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/jbosscmp-jdbc.xml 2009-05-14 13:53:17 UTC (rev 4813)
@@ -11,7 +11,7 @@
<enterprise-beans>
<entity>
<ejb-name>Timer</ejb-name>
- <table-name>JBPM_JOB</table-name>
+ <table-name>JBPM4_JOB</table-name>
<cmp-field>
<field-name>dbid</field-name>
<column-name>DBID_</column-name>
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/META-INF/jboss-service.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/META-INF/jboss-service.xml 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/META-INF/jboss-service.xml 2009-05-14 13:53:17 UTC (rev 4813)
@@ -14,9 +14,9 @@
<!-- Authenticate against the Identiy database -->
<jaas:login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
<jaas:module-option name="dsJndiName">java:/JbpmDS</jaas:module-option>
- <jaas:module-option name="principalsQuery"> SELECT PASSWORD_ FROM JBPM_ID_USER WHERE ID_=? </jaas:module-option>
+ <jaas:module-option name="principalsQuery"> SELECT PASSWORD_ FROM JBPM4_ID_USER WHERE ID_=? </jaas:module-option>
<jaas:module-option name="rolesQuery">
- SELECT g.NAME_ ,'Roles' FROM JBPM_ID_USER u, JBPM_ID_MEMBERSHIP m, JBPM_ID_GROUP g
+ SELECT g.NAME_ ,'Roles' FROM JBPM4_ID_USER u, JBPM4_ID_MEMBERSHIP m, JBPM4_ID_GROUP g
WHERE g.TYPE_='security-role' AND m.GROUP_ = g.DBID_ AND m.USER_ = u.DBID_ AND u.ID_=? </jaas:module-option>
</jaas:login-module>
</jaas:authentication>
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml 2009-05-14 13:53:17 UTC (rev 4813)
@@ -11,7 +11,7 @@
g="96,16,126,52">
<query>
select NAME_
- from JBPM_TASK
+ from JBPM4_TASK
where NAME_ like :name
</query>
<parameters>
@@ -26,7 +26,7 @@
g="254,16,92,52">
<query>
select count(*)
- from JBPM_TASK
+ from JBPM4_TASK
</query>
<transition to="wait" />
</sql>
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml 2009-05-14 13:53:17 UTC (rev 4813)
@@ -38,7 +38,7 @@
</map>
</subclass>
- <!-- class name="org.jbpm.jpdl.internal.activity.JpdlActivity" table="JBPM_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
+ <!-- class name="org.jbpm.jpdl.internal.activity.JpdlActivity" table="JBPM4_JPDL_ACTIVITY" abstract="true" discriminator-value="X">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/pvm/pom.xml 2009-05-14 13:53:17 UTC (rev 4813)
@@ -28,11 +28,6 @@
<relativePath>../../pom.xml</relativePath>
</parent>
- <!-- Properties -->
- <properties>
- <table.prefix>JBPM_</table.prefix>
- <!--test.resources.directory>${project.build.directory}/test-resources</test.resources.directory-->
- </properties>
<repositories>
<repository>
<id>Snapshot</id>
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-14 13:53:17 UTC (rev 4813)
@@ -20,7 +20,7 @@
<!-- ### PROCESS DEFINITION ############################################# -->
<class name="ExecutionImpl"
- table="JBPM_EXECUTION"
+ table="JBPM4_EXECUTION"
discriminator-value="pvm">
<id name="dbid" column="DBID_">
<generator class="native" />
@@ -103,7 +103,7 @@
</class>
<!-- ### COMMENTS ####################################################### -->
- <class name="CommentImpl" table="JBPM_COMMENT">
+ <class name="CommentImpl" table="JBPM4_COMMENT">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -124,7 +124,7 @@
</class>
<!-- ### VARIABLE ####################################################### -->
- <class name="org.jbpm.pvm.internal.type.Variable" abstract="true" discriminator-value=" " table="JBPM_VARIABLE">
+ <class name="org.jbpm.pvm.internal.type.Variable" abstract="true" discriminator-value=" " table="JBPM4_VARIABLE">
<!-- discriminator values:
date : org.jbpm.pvm.internal.type.variable.DateVariable
double : org.jbpm.pvm.internal.type.variable.DoubleVariable
@@ -198,7 +198,7 @@
</subclass>
<!-- ### LOB ############################################################ -->
- <class name="org.jbpm.pvm.internal.lob.Lob" table="JBPM_LOB">
+ <class name="org.jbpm.pvm.internal.lob.Lob" table="JBPM4_LOB">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -209,7 +209,7 @@
<property name="text" type="text" column="TEXT_VALUE_"/>
</class>
- <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM_JOB" discriminator-value="Job">
+ <class name="org.jbpm.pvm.internal.job.JobImpl" table="JBPM4_JOB" discriminator-value="Job">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.history.hbm.xml 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.history.hbm.xml 2009-05-14 13:53:17 UTC (rev 4813)
@@ -4,7 +4,7 @@
<hibernate-mapping package="org.jbpm.pvm.internal.history.model" default-access="field">
<!-- ### HISTORY PROCESS INSTANCE ####################################### -->
- <class name="HistoryProcessInstanceImpl" table="JBPM_HIST_PROCINST">
+ <class name="HistoryProcessInstanceImpl" table="JBPM4_HIST_PROCINST">
<id name="processInstanceId" column="ID_">
<generator class="assigned" />
</id>
@@ -35,7 +35,7 @@
</class>
<!-- ### HISTORY PROCESS INSTANCE ####################################### -->
- <class name="HistoryActivityInstanceImpl" table="JBPM_HIST_ACTINST" discriminator-value="ACT">
+ <class name="HistoryActivityInstanceImpl" table="JBPM4_HIST_ACTINST" discriminator-value="ACT">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.identity.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.identity.hbm.xml 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.identity.hbm.xml 2009-05-14 13:53:17 UTC (rev 4813)
@@ -4,7 +4,7 @@
<hibernate-mapping package="org.jbpm.pvm.internal.identity.impl" default-access="field">
<!-- ### USER ########################################################### -->
- <class name="UserImpl" table="JBPM_ID_USER">
+ <class name="UserImpl" table="JBPM4_ID_USER">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -18,7 +18,7 @@
</class>
<!-- ### MEMBERSHIP ##################################################### -->
- <class name="MembershipImpl" table="JBPM_ID_MEMBERSHIP">
+ <class name="MembershipImpl" table="JBPM4_ID_MEMBERSHIP">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -40,7 +40,7 @@
</class>
<!-- ### GROUP ########################################################### -->
- <class name="GroupImpl" table="JBPM_ID_GROUP">
+ <class name="GroupImpl" table="JBPM4_ID_GROUP">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.repository.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.repository.hbm.xml 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.repository.hbm.xml 2009-05-14 13:53:17 UTC (rev 4813)
@@ -5,7 +5,7 @@
<!-- ### Deployment ##################################################### -->
<class name="org.jbpm.pvm.internal.repository.DeploymentImpl"
- table="JBPM_DEPLOYMENT">
+ table="JBPM4_DEPLOYMENT">
<!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<id name="dbid" column="DBID_">
@@ -25,7 +25,7 @@
</map>
<set name="objectProperties"
- table="JBPM_DEPLOYPROPS"
+ table="JBPM4_DEPLOYPROPS"
cascade="all">
<key column="DEPLOYMENT_" />
<one-to-many class="org.jbpm.pvm.internal.repository.DeploymentProperty" />
@@ -33,7 +33,7 @@
</class>
- <class name="org.jbpm.pvm.internal.repository.DeploymentProperty" table="JBPM_DEPLOYPROP">
+ <class name="org.jbpm.pvm.internal.repository.DeploymentProperty" table="JBPM4_DEPLOYPROP">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml 2009-05-14 13:36:10 UTC (rev 4812)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml 2009-05-14 13:53:17 UTC (rev 4813)
@@ -6,7 +6,7 @@
<!-- ### ASSIGNABLE DEFINITIONS #########################################
<class name="AssignableDefinitionImpl"
- table="JBPM_ASSIGNDEF"
+ table="JBPM4_ASSIGNDEF"
discriminator-value="A" >
<id name="dbid" column="DBID_">
<generator class="native" />
@@ -65,7 +65,7 @@
<!-- ### TASK ########################################################### -->
<class name="TaskImpl"
- table="JBPM_TASK"
+ table="JBPM4_TASK"
discriminator-value="T">
<id name="dbid" column="DBID_">
<generator class="native" />
@@ -136,7 +136,7 @@
</class>
<!-- ### PARTICIPANT #################################################### -->
- <class name="ParticipationImpl" table="JBPM_PARTICIPATION">
+ <class name="ParticipationImpl" table="JBPM4_PARTICIPATION">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
@@ -160,7 +160,7 @@
</class>
<!-- ### SWIMLANE ####################################################### -->
- <class name="SwimlaneImpl" table="JBPM_SWIMLANE">
+ <class name="SwimlaneImpl" table="JBPM4_SWIMLANE">
<id name="dbid" column="DBID_">
<generator class="native" />
</id>
15 years, 4 months
JBoss JBPM SVN: r4812 - in jbpm4/trunk: modules/distro/src/main/files/jboss and 5 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-14 09:36:10 -0400 (Thu, 14 May 2009)
New Revision: 4812
Added:
jbpm4/trunk/qa/jdbc/
jbpm4/trunk/qa/jdbc/hsqldb.properties
jbpm4/trunk/qa/jdbc/mysql.properties
jbpm4/trunk/qa/jdbc/oracle.properties
jbpm4/trunk/qa/jdbc/postgresql.properties
jbpm4/trunk/qa/jdbc/sybase.properties
Removed:
jbpm4/trunk/qa/db/
Modified:
jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/oracle.hibernate.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml
jbpm4/trunk/modules/examples/pom.xml
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/qa/build.xml
Log:
JBPM-2150 updated oracle dialect to 9i and reestablished local database testing capability with 'mvn -Ddatabase=oracle clean test' on modules examples and test-db
Modified: jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/oracle.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/oracle.hibernate.cfg.xml 2009-05-14 13:10:14 UTC (rev 4811)
+++ jbpm4/trunk/modules/distro/src/main/files/db/hibernate.cfg/oracle.hibernate.cfg.xml 2009-05-14 13:36:10 UTC (rev 4812)
@@ -7,7 +7,7 @@
<hibernate-configuration>
<session-factory>
- <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
+ <property name="hibernate.dialect">org.hibernate.dialect.Oracle9iDialect</property>
<property name="hibernate.connection.driver_class">@jdbc.driver@</property>
<property name="hibernate.connection.url">@jdbc.url@</property>
<property name="hibernate.connection.username">@jdbc.username@</property>
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-05-14 13:10:14 UTC (rev 4811)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-05-14 13:36:10 UTC (rev 4812)
@@ -7,7 +7,7 @@
<!-- JDBC PROPERTIES -->
<property file="${user.home}/jdbc/${database}.properties" />
- <property file="${jbpm.home}/jdbc/${database}.properties" />
+ <property file="${jbpm.home}/db/jdbc/${database}.properties" />
<!-- DEFAULT PROPERTY VALUES -->
<property name="database" value="hsqldb" />
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml 2009-05-14 13:10:14 UTC (rev 4811)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml 2009-05-14 13:36:10 UTC (rev 4812)
@@ -7,7 +7,7 @@
<hibernate-configuration>
<session-factory>
- <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
+ <property name="hibernate.dialect">org.hibernate.dialect.Oracle9iDialect</property>
<property name="hibernate.connection.datasource">java:JbpmDS</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
Modified: jbpm4/trunk/modules/examples/pom.xml
===================================================================
--- jbpm4/trunk/modules/examples/pom.xml 2009-05-14 13:10:14 UTC (rev 4811)
+++ jbpm4/trunk/modules/examples/pom.xml 2009-05-14 13:36:10 UTC (rev 4812)
@@ -98,12 +98,24 @@
</goals>
<configuration>
<tasks>
- <copy todir="target/test-classes" overwrite="true" failonerror="false">
- <fileset dir="../../qa/db/${database}" />
+ <copy file="../../qa/jdbc/${database}.properties"
+ tofile="target/jdbc.properties" />
+ <copy file="${user.home}/.jbpm4/jdbc/${database}.properties"
+ tofile="target/jdbc.properties"
+ overwrite="true"
+ failonerror="true "/>
+ <copy file="../../modules/distro/src/main/files/db/hibernate.cfg/${database}.hibernate.cfg.xml"
+ tofile="target/test-classes/jbpm.hibernate.cfg.xml"
+ overwrite="true">
+ <filterset>
+ <filtersfile file="target/jdbc.properties" />
+ </filterset>
</copy>
- <copy todir="target/test-classes" overwrite="true" failonerror="false">
- <fileset dir="${user.home}/.jbpm4/qa/db/${database}" />
- </copy>
+ <replace file="target/test-classes/jbpm.hibernate.cfg.xml">
+ <replacetoken><![CDATA[<property name="hibernate.format_sql">true</property>]]></replacetoken>
+ <replacevalue><![CDATA[<property name="hibernate.format_sql">true</property>
+ <property name="hibernate.hbm2ddl.auto">create-drop</property>]]></replacevalue>
+ </replace>
</tasks>
</configuration>
</execution>
@@ -160,7 +172,7 @@
<fileset dir="../distro/src/main/files/jboss/jbpm.cfg.remote.client" />
</copy>
<copy todir="target/test-classes" overwrite="true" failonerror="false">
- <fileset dir="${user.home}/.jbpm4/qa/jbpm.cfg.remote.client" />
+ <fileset dir="${user.home}/.jbpm4/jbpm.cfg.remote.client" />
</copy>
</tasks>
</configuration>
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2009-05-14 13:10:14 UTC (rev 4811)
+++ jbpm4/trunk/modules/test-db/pom.xml 2009-05-14 13:36:10 UTC (rev 4812)
@@ -72,12 +72,24 @@
</goals>
<configuration>
<tasks>
- <copy todir="target/test-classes" overwrite="true" failonerror="false">
- <fileset dir="../../qa/db/${database}" />
+ <copy file="../../qa/jdbc/${database}.properties"
+ tofile="target/jdbc.properties" />
+ <copy file="${user.home}/.jbpm4/jdbc/${database}.properties"
+ tofile="target/jdbc.properties"
+ overwrite="true"
+ failonerror="true "/>
+ <copy file="../../modules/distro/src/main/files/db/hibernate.cfg/${database}.hibernate.cfg.xml"
+ tofile="target/test-classes/jbpm.hibernate.cfg.xml"
+ overwrite="true">
+ <filterset>
+ <filtersfile file="target/jdbc.properties" />
+ </filterset>
</copy>
- <copy todir="target/test-classes" overwrite="true" failonerror="false">
- <fileset dir="${user.home}/.jbpm4/qa/db/${database}" />
- </copy>
+ <replace file="target/test-classes/jbpm.hibernate.cfg.xml">
+ <replacetoken><![CDATA[<property name="hibernate.format_sql">true</property>]]></replacetoken>
+ <replacevalue><![CDATA[<property name="hibernate.format_sql">true</property>
+ <property name="hibernate.hbm2ddl.auto">create-drop</property>]]></replacevalue>
+ </replace>
</tasks>
</configuration>
</execution>
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-05-14 13:10:14 UTC (rev 4811)
+++ jbpm4/trunk/qa/build.xml 2009-05-14 13:36:10 UTC (rev 4812)
@@ -56,12 +56,12 @@
<target name="post.install">
<!-- overwrite the default jdbc properties in the distro with those specified in the qa jdbc directory -->
- <copy file="db/${database}.properties"
+ <copy file="jdbc/${database}.properties"
todir="${jbpm.home}/db/jdbc"
overwrite="true"
failonerror="false" />
<!-- overwrite the jdbc properties in the distro with those specified in the user specific properties -->
- <copy file="${user.home}/.jbpm4/db/${database}.properties"
+ <copy file="${user.home}/.jbpm4/jdbc/${database}.properties"
todir="${jbpm.home}/db/jdbc"
overwrite="true"
failonerror="false" />
Added: jbpm4/trunk/qa/jdbc/hsqldb.properties
===================================================================
--- jbpm4/trunk/qa/jdbc/hsqldb.properties (rev 0)
+++ jbpm4/trunk/qa/jdbc/hsqldb.properties 2009-05-14 13:36:10 UTC (rev 4812)
@@ -0,0 +1,4 @@
+jdbc.driver=org.hsqldb.jdbcDriver
+jdbc.url=jdbc:hsqldb:hsql://localhost:1701
+jdbc.username=sa
+jdbc.password=
Property changes on: jbpm4/trunk/qa/jdbc/hsqldb.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/qa/jdbc/mysql.properties
===================================================================
--- jbpm4/trunk/qa/jdbc/mysql.properties (rev 0)
+++ jbpm4/trunk/qa/jdbc/mysql.properties 2009-05-14 13:36:10 UTC (rev 4812)
@@ -0,0 +1,4 @@
+jdbc.driver=com.mysql.jdbc.Driver
+jdbc.url=jdbc:mysql://dev02.qa.atl.jboss.com:3306/pvm1
+jdbc.username=pvm1
+jdbc.password=pvm1
Property changes on: jbpm4/trunk/qa/jdbc/mysql.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/qa/jdbc/oracle.properties
===================================================================
--- jbpm4/trunk/qa/jdbc/oracle.properties (rev 0)
+++ jbpm4/trunk/qa/jdbc/oracle.properties 2009-05-14 13:36:10 UTC (rev 4812)
@@ -0,0 +1,4 @@
+jdbc.driver=oracle.jdbc.driver.OracleDriver
+jdbc.url=jdbc:oracle:thin:@dev01.qa.atl.jboss.com:1521:qadb01
+jdbc.username=PVM3
+jdbc.password=PVM3
Property changes on: jbpm4/trunk/qa/jdbc/oracle.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/qa/jdbc/postgresql.properties
===================================================================
--- jbpm4/trunk/qa/jdbc/postgresql.properties (rev 0)
+++ jbpm4/trunk/qa/jdbc/postgresql.properties 2009-05-14 13:36:10 UTC (rev 4812)
@@ -0,0 +1,7 @@
+jdbc.driver=org.postgresql.Driver
+jdbc.port=5432
+jdbc.server=dev01.qa.atl.jboss.com
+jdbc.databasename=pvm3
+jdbc.url=jdbc:postgresql://dev01.qa.atl.jboss.com:5432/pvm3
+jdbc.username=pvm3
+jdbc.password=pvm3
Property changes on: jbpm4/trunk/qa/jdbc/postgresql.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/qa/jdbc/sybase.properties
===================================================================
--- jbpm4/trunk/qa/jdbc/sybase.properties (rev 0)
+++ jbpm4/trunk/qa/jdbc/sybase.properties 2009-05-14 13:36:10 UTC (rev 4812)
@@ -0,0 +1,5 @@
+jdbc.driver=net.sourceforge.jtds.jdbc.Driver
+# jdbc.driver=com.sybase.jdbc3.jdbc.SybDriver
+jdbc.url=jdbc:sybase:Tds:localhost:5000/jbpmdb
+jdbc.username=jbpm
+jdbc.password=jbpm
Property changes on: jbpm4/trunk/qa/jdbc/sybase.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
JBoss JBPM SVN: r4811 - in projects/gwt-console/trunk/gui/war/src/main: resources/org/jboss/bpm/console/public and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-14 09:10:14 -0400 (Thu, 14 May 2009)
New Revision: 4811
Added:
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_loading.gif
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_splash.gif
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading_lite.gif
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css
Log:
Fix sluggish loading
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java 2009-05-14 12:19:13 UTC (rev 4810)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java 2009-05-14 13:10:14 UTC (rev 4811)
@@ -24,6 +24,7 @@
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.DOM;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import com.allen_sauer.gwt.log.client.Log;
@@ -42,6 +43,13 @@
DeferredCommand.addCommand(new Command() {
public void execute() {
+
+ // hide spash image
+ DOM.getElementById("splash_loading").getStyle().setProperty("display", "none");
+
+ // move the loading div to background
+ DOM.getElementById("splash").getStyle().setProperty("z-index", "-1");
+
onModuleLoad2();
}
});
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java 2009-05-14 12:19:13 UTC (rev 4810)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java 2009-05-14 13:10:14 UTC (rev 4811)
@@ -23,6 +23,9 @@
import com.mvc4g.client.ActionInterface;
import com.mvc4g.client.Controller;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.Command;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -31,7 +34,7 @@
{
public void execute(Controller controller, Object object)
- {
+ {
LoginView loginView = (LoginView)controller.getView(LoginView.NAME);
loginView.display();
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2009-05-14 12:19:13 UTC (rev 4810)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2009-05-14 13:10:14 UTC (rev 4811)
@@ -23,7 +23,7 @@
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.Response;
-import com.google.gwt.user.client.WindowCloseListener;
+import com.google.gwt.user.client.*;
import com.google.gwt.user.client.ui.*;
import com.google.gwt.core.client.GWT;
import com.mvc4g.client.Controller;
@@ -31,9 +31,7 @@
import org.gwt.mosaic.forms.client.builder.DefaultFormBuilder;
import org.gwt.mosaic.forms.client.layout.FormLayout;
import org.gwt.mosaic.ui.client.WindowPanel;
-import org.gwt.mosaic.ui.client.layout.BorderLayout;
-import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
-import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.layout.*;
import org.jboss.bpm.console.client.Authentication;
import org.jboss.bpm.console.client.ConsoleConfig;
import org.jboss.bpm.console.client.URLBuilder;
@@ -85,9 +83,10 @@
}
public void display()
- {
- createLayoutWindowPanel();
+ {
+ createLayoutWindowPanel();
window.center();
+
}
/**
@@ -95,7 +94,7 @@
*/
private void createLayoutWindowPanel() {
window = new WindowPanel("jBPM Management Console");
- window.setAnimationEnabled(false);
+ window.setAnimationEnabled(true);
window.setSize("320px", "180px");
LayoutPanel panel = new LayoutPanel();
@@ -145,8 +144,19 @@
// display main console
window.hide();
- // assemble main layout
- new MainLayout(controller, auth, urlBuilder, config);
+ // assemble main layout
+ DeferredCommand.add( new Command()
+ {
+ public void execute()
+ {
+ // move the loading div to foreground
+ DOM.getElementById("splash").getStyle().setProperty("z-index", "1000");
+ DOM.getElementById("ui_loading").getStyle().setProperty("display", "run-in");
+ new MainLayout(controller, auth, urlBuilder, config);
+ }
+ });
+
+ window = null;
}
public void onLoginFailed(Request request, Throwable t)
@@ -161,38 +171,31 @@
}
});
- // TODO: does this load the imagebundle already?
- ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ Widget form = createForm();
+ layoutPanel.add(form, new BorderLayoutData(BorderLayout.Region.CENTER));
+ layoutPanel.add(submit, new BorderLayoutData(BorderLayout.Region.SOUTH));
- LayoutPanel imgPanel = new LayoutPanel();
- imgPanel.add(icons.userIcon().createImage());
- imgPanel.setVisible(false);
-
- layoutPanel.add(imgPanel, new BorderLayoutData(BorderLayout.Region.NORTH, 50, 200));
- layoutPanel.add(createForm(), new BorderLayoutData(BorderLayout.Region.CENTER, 10, 200));
- layoutPanel.add(submit, new BorderLayoutData(BorderLayout.Region.SOUTH, 10, 200));
-
}
private Widget createForm()
{
- FormLayout layout = new FormLayout(
- "right:pref, 10px, left:pref:grow", // 3 columns
- "pref, pref, 5px, pref"); // 4 rows
+ LayoutPanel p = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ Label label = new Label("Login");
+ label.setStyleName("bpm-label-header");
+ p.add(label, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
- DefaultFormBuilder builder = new DefaultFormBuilder(layout);
- builder.appendSeparator("Login");
-
usernameInput = new TextBox();
- builder.append("Username:", usernameInput);
- builder.nextLine();
+ passwordInput = new PasswordTextBox();
- builder.nextLine(); // empty space
+ Grid grid = new Grid(2,2);
+ grid.setWidget(0,0, new Label("Username:"));
+ grid.setWidget(0,1, usernameInput);
- passwordInput = new PasswordTextBox();
- builder.append("Password:", passwordInput);
- builder.nextLine();
+ grid.setWidget(1,0, new Label("Password:"));
+ grid.setWidget(1,1, passwordInput);
- return builder.getPanel();
+ p.add(grid);
+
+ return p;
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-05-14 12:19:13 UTC (rev 4810)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-05-14 13:10:14 UTC (rev 4811)
@@ -24,7 +24,7 @@
import com.allen_sauer.gwt.log.client.DivLogger;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.*;
import com.google.gwt.user.client.ui.*;
import com.google.gwt.user.client.ui.HTML;
import com.mvc4g.client.Controller;
@@ -78,43 +78,59 @@
LayoutPanel layout = createLayout();
viewport.add(layout);
+ Timer t = new Timer() {
+
+ public void run()
+ {
+ // hide the loading div
+ DeferredCommand.add( new Command()
+ {
+ public void execute()
+ {
+ DOM.getElementById("splash").getStyle().setProperty("display", "none");
+ }
+ });
+
+ }
+ };
+ t.schedule(2000);
+
RootPanel.get().add(viewport);
-
}
private LayoutPanel createLayout()
{
final LayoutPanel layoutPanel = new LayoutPanel(new BorderLayout());
- // header
+// header
header = new Header(this, auth.getUsername(), auth.getRolesAssigned());
layoutPanel.add(header, new BorderLayoutData(Region.NORTH, 50));
- // menu
+// menu
menu = new Menu();
layoutPanel.add(menu, new BorderLayoutData(Region.WEST, 200));
- // workspace
+// workspace
workspace = createWorkspace();
layoutPanel.add(workspace, new BorderLayoutData(Region.CENTER, false));
- // register views and actions
+// register views and actions
controller.addView(Header.ID, header);
controller.addAction(LoadingStatusAction.ID, new LoadingStatusAction());
- // message Panel
+// message Panel
final CaptionLayoutPanel messagePanel = createMessagePanel(layoutPanel);
messagePanel.add(Log.getDivLogger().getWidget());
messagePanel.setCollapsed(true);
layoutPanel.add(messagePanel, new BorderLayoutData(Region.SOUTH, true));
- // Turn on DivLogger
+// Turn on DivLogger
Log.getDivLogger().getWidget().setVisible(true);
- // default editor
+// default editor
if(workspace.hasEditor(SettingsEditor.ID))
workspace.showEditor(SettingsEditor.ID);
@@ -158,7 +174,7 @@
return workspace;
}
- // ---- ApplicationContext interface ----
+// ---- ApplicationContext interface ----
public Viewport getViewport()
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2009-05-14 12:19:13 UTC (rev 4810)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2009-05-14 13:10:14 UTC (rev 4811)
@@ -54,47 +54,39 @@
tabPanel.setPadding(5);
final ScrollLayoutPanel layoutPanel = new ScrollLayoutPanel(
- new BoxLayout(BoxLayout.Orientation.VERTICAL)
+ new BoxLayout(BoxLayout.Orientation.VERTICAL)
);
// console info
- StringBuffer sb = new StringBuffer();
- sb.append("<table>");
- sb.append("<tr>");
- sb.append("<td colspan=2><h3>Console Info</h3></td>");
- sb.append("</tr>");
+ Label console = new Label("Console Info");
+ console.setStyleName("bpm-label-header");
+ layoutPanel.add(console, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
- sb.append("<tr>");
- sb.append("<td>Version: </td>");
- sb.append("<td>"+Version.VERSION+"</td>");
- sb.append("</tr>");
+ Grid g1 = new Grid(1,2);
+ g1.setWidget(0,0, new Label("Version:"));
+ g1.setWidget(0,1, new Label(Version.VERSION));
- sb.append("<tr>");
- sb.append("<td colspan=2><br/></td>");
- sb.append("</tr>");
+ layoutPanel.add(g1);
- sb.append("<tr>");
- sb.append("<td colspan=2><h3>Server Info</h3></td>");
- sb.append("</tr>");
+ // server info
+ Label server = new Label("Server Info");
+ server.setStyleName("bpm-label-header");
+ layoutPanel.add(server, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
- sb.append("<tr>");
- sb.append("<td>Host: </td>");
- sb.append("<td>"+appContext.getConfig().getConsoleServerUrl()+"</td>");
- sb.append("</tr>");
+ Grid g2 = new Grid(1,2);
+ g2.setWidget(0,0, new Label("Host:"));
+ g2.setWidget(0,1, new Label(appContext.getConfig().getConsoleServerUrl()));
- sb.append("</table>");
-
- layoutPanel.add(new HTML(sb.toString()));
+ layoutPanel.add(g2);
+
ServerStatusView serverStatus = new ServerStatusView(appContext);
layoutPanel.add(serverStatus); // Doesn't render in grid
-
tabPanel.add(layoutPanel, "System Overview");
this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
// view and actions
-
super.controller.addView(ServerStatusView.ID, serverStatus);
super.controller.addAction(ServerStatusAction.ID, new ServerStatusAction(appContext));
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html 2009-05-14 12:19:13 UTC (rev 4810)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/Application.html 2009-05-14 13:10:14 UTC (rev 4811)
@@ -1,29 +1,51 @@
<html>
<head>
- <title>GWT Console Application</title>
+ <title>GWT Console Application</title>
- <!-- BPM console configuration -->
- <script type="text/javascript">
- var consoleConfig = {
- consoleServerUrl: "http://localhost:8080/gwt-console-server",
- reportServerUrl: "http://localhost:8080/report-server",
- overviewReportFile:"process_activity.rptdesign",
- definitionReportFile:"definition_report.rptdesign",
- instanceReportFile:"instance_report.rptdesign"
- };
- </script>
+ <!-- BPM console configuration -->
+ <script type="text/javascript">
+ var consoleConfig = {
+ consoleServerUrl: "http://localhost:8080/gwt-console-server",
+ reportServerUrl: "http://localhost:8080/report-server",
+ overviewReportFile:"process_activity.rptdesign",
+ definitionReportFile:"definition_report.rptdesign",
+ instanceReportFile:"instance_report.rptdesign"
+ };
+ </script>
- <!-- -->
- <!-- This script loads your compiled module. -->
- <!-- If you add any GWT meta tags, they must -->
- <!-- be added before this line. -->
- <!-- -->
- <script language='javascript' src='org.jboss.bpm.console.Application.nocache.js'>
-
- </script>
+ <!-- -->
+ <!-- This script loads your compiled module. -->
+ <!-- If you add any GWT meta tags, they must -->
+ <!-- be added before this line. -->
+ <!-- -->
+ <script language='javascript' src='org.jboss.bpm.console.Application.nocache.js'>
- <link rel="stylesheet" href="console.css" type="text/css">
+ </script>
+ <link rel="stylesheet" href="console.css" type="text/css">
+
+ <style type="text/css">
+ html, body { height: 100%; overflow: hidden; margin: 0; padding: 0; }
+ #splash {
+ background:#ffffff;
+ cursor: wait;
+ position:
+ absolute; top: 0; left: 0;
+ z-index:1000;
+ }
+ .bpm-loader {
+ background-image: url('images/loading_lite.gif');
+ background-repeat:no-repeat;
+ height: 24px; width: 130px;
+ padding-left:26px;
+ padding-top:8px;
+ font-family: Arial, sans-serif;
+ font-size: 10px;
+ font-weight: bold;
+ color: #777;
+ cursor: wait;
+ }
+ </style>
</head>
<!-- -->
@@ -36,5 +58,16 @@
<!-- OPTIONAL: include this if you want history support -->
<!--iframe src="javascript:''" id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe-->
+<div id="splash" style="height:100%;width:100%;">
+ <table width="100%" height="100%" >
+ <tr>
+ <td width="100%" height="100%" align="center" valign="middle">
+ <div id="ui_loading" class="bpm-loader" style="display:none;z-index:1001;" alttext="Error">Creating Workspace ...</div>
+ <div id="splash_loading" class="bpm-loader" alttext="Error">Loading ...</div>
+ </td>
+ </tr>
+ </table>
+</div>
+
</body>
</html>
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-05-14 12:19:13 UTC (rev 4810)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-05-14 13:10:14 UTC (rev 4811)
@@ -1,3 +1,4 @@
+
.bpm-layout {
border: 1px solid green;
margin: 10px;
@@ -10,6 +11,14 @@
background-repeat:no-repeat;
}
+.bpm-label-header {
+ background-color:#F8F8F8;
+ font-weight:BOLD;
+ //border-bottom:1px solid #D8D8D8 ;
+ padding-bottom:2px;
+ padding-left:5px;
+ margin-bottom:5px;
+}
.bpm-header-userinfo {
font-family: sans-serif;
width:150px;
@@ -224,7 +233,9 @@
.bpm-info-table {
border:0px solid;
width:100%;
- background:#F8F8F8;
+ //background:#F8F8F8;
+ background:#ffffff;
+ border-left:5px solid #ffffff;
padding:5px;
}
Added: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_loading.gif
===================================================================
(Binary files differ)
Property changes on: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_loading.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_splash.gif
===================================================================
(Binary files differ)
Property changes on: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/blank_splash.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading_lite.gif
===================================================================
(Binary files differ)
Property changes on: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/images/loading_lite.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 4 months
JBoss JBPM SVN: r4810 - in jbpm4/trunk: modules/distro/src/main/files/jboss and 10 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-14 08:19:13 -0400 (Thu, 14 May 2009)
New Revision: 4810
Added:
jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.mail.properties
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailTemplateMap.java
Removed:
jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.xml
Modified:
jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
jbpm4/trunk/modules/examples/pom.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MailTemplateWireTest.java
jbpm4/trunk/qa/build.xml
Log:
JBPM-2251 separate specific integration test suite deployments
Modified: jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/examples/build.xml 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/distro/src/main/files/examples/build.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -25,10 +25,8 @@
<echo message="jbpm.version....... ${jbpm.version}" />
<echo message="jbpm.home.......... ${jbpm.home}" />
</target>
-
- <!-- ### DEPLOY EXAMPLE BUSINESS ARCHIVES ############################### -->
- <target name="deploy.examples"
- description="deploys all the example processes">
+
+ <target name="jbpm.libs.path">
<path id="jbpm.libs.incl.dependencies">
<pathelement location="${jbpm.home}/examples/target/classes" />
<fileset dir="${jbpm.home}">
@@ -36,15 +34,13 @@
</fileset>
<fileset dir="${jbpm.home}/lib" />
</path>
- <mkdir dir="${jbpm.home}/examples/target/classes" />
- <javac srcdir="${jbpm.home}/examples/src"
- destdir="${jbpm.home}/examples/target/classes"
- classpathref="jbpm.libs.incl.dependencies" />
- <copy todir="${jbpm.home}/examples/target/classes">
- <fileset dir="${jbpm.home}/examples/src">
- <exclude name="**/*.java" />
- </fileset>
- </copy>
+ </target>
+
+ <!-- ### DEPLOY EXAMPLE BUSINESS ARCHIVES ############################### -->
+ <target name="deploy.examples"
+ description="deploys all the example processes"
+ depends="jbpm.libs.path">
+ <mkdir dir="${jbpm.home}/examples/target" />
<copy file="${jbpm.home}/db/hibernate.cfg/${database}.hibernate.cfg.xml"
tofile="${jbpm.home}/examples/target/classes/jbpm.hibernate.cfg.xml"
overwrite="true">
@@ -76,5 +72,22 @@
classpathref="jbpm.libs.incl.dependencies" />
<jbpm-deploy file="${jbpm.home}/examples/target/examples.bar" />
</target>
+
+ <target name="examples.jar" depends="jbpm.libs.path">
+ <mkdir dir="${jbpm.home}/examples/target/classes" />
+ <javac srcdir="${jbpm.home}/examples/src"
+ destdir="${jbpm.home}/examples/target/classes"
+ classpathref="jbpm.libs.incl.dependencies" />
+ <copy todir="${jbpm.home}/examples/target/classes">
+ <fileset dir="${jbpm.home}/examples/src">
+ <exclude name="**/*.java" />
+ </fileset>
+ </copy>
+ <jar destfile="${jbpm.home}/examples/target/examples.jar" >
+ <fileset dir="${jbpm.home}/examples/target/classes">
+ <include name="**/*.class" />
+ </fileset>
+ </jar>
+ </target>
</project>
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -43,6 +43,7 @@
<equals arg1="${jboss.version}" arg2="5.0.0.GA" />
<equals arg1="${jboss.version}" arg2="5.0.1.GA" />
<equals arg1="${jboss.version}" arg2="5.1.0.GA" />
+ <equals arg1="${jboss.version}" arg2="5.1.0.CR1" />
</or>
</condition>
@@ -183,7 +184,18 @@
</fileset>
</copy>
</target>
-
+
+ <!-- ### THE JBOSS INTEGRATION TEST SPECIFICS ####################### -->
+ <target name="internal.install.jbpm.into.jboss.integrationtestspecifics">
+ <copy todir="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar" overwrite="true">
+ <fileset dir="${jbpm.home}/jboss/jbpm.cfg.integration.tests" />
+ </copy>
+ <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
+ <mkdir dir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
+ <copy file="${jbpm.home}/examples/target/examples.jar"
+ todir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
+ </target>
+
<!-- ### THE HSQLDB SPECIFIC PART ####################################### -->
<target name="internal.install.jbpm.into.jboss.db.hsqldb" />
Deleted: jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <import resource="jbpm.default.cfg.xml" />
- <import resource="jbpm.tx.jta.cfg.xml" />
- <import resource="jbpm.jpdl.cfg.xml" />
- <import resource="jbpm.identity.cfg.xml" />
-
-</jbpm-configuration>
Added: jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.tx.jta.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+ <import resource="jbpm.jobexecutor.cfg.xml" />
+
+</jbpm-configuration>
Added: jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.mail.properties
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.mail.properties (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.mail.properties 2009-05-14 12:19:13 UTC (rev 4810)
@@ -0,0 +1,3 @@
+mail.smtp.host=localhost
+mail.smtp.port=25
+mail.from=noreply(a)jbpm.org
Property changes on: jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-service.sar/jbpm.mail.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -7,18 +7,10 @@
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
+ <import resource="jbpm.mail.templates.examples.xml" />
+
<!-- Job executor is excluded for running the example test cases.
To enable timers and messages in production use, this should be included.
import resource="jbpm.jobexecutor.cfg.xml" / -->
- <process-engine-context>
-
- <mail-template name="MemoTemplate">
- <to addresses='dilbert@office, alice@work, dogbert@house' />
- <subject>bureaucracy</subject>
- <text>Order http://example.com/order/#{orderId} is stalled.</text>
- </mail-template>
-
- </process-engine-context>
-
</jbpm-configuration>
Added: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties 2009-05-14 12:19:13 UTC (rev 4810)
@@ -0,0 +1,3 @@
+mail.smtp.host localhost
+mail.smtp.port 2525
+mail.from noreply(a)jbpm.org
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+
+ <mail-template name="rectify template">
+ <to addresses="${addressee}" />
+ <cc users="bb" groups="innerparty" />
+ <bcc groups="thinkpol" />
+ <subject>rectify ${newspaper}</subject>
+ <text>${newspaper} ${date} ${details}</text>
+ </mail-template>
+
+ </process-engine-context>
+
+</jbpm-configuration>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/examples/pom.xml
===================================================================
--- jbpm4/trunk/modules/examples/pom.xml 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/examples/pom.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -177,21 +177,12 @@
<!-- https://jira.jboss.org/jira/browse/JBPM-2147 -->
<!-- https://jira.jboss.org/jira/browse/JBPM-2200 -->
<exclude>org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java</exclude>
- <exclude>org/jbpm/examples/task/candidates/TaskCandidatesTest.java</exclude>
<exclude>org/jbpm/examples/concurrency/graphbased/ConcurrencyGraphBasedTest.java</exclude>
- <exclude>org/jbpm/examples/timer/repeat/TimerRepeatTest.java</exclude>
+ <exclude>org/jbpm/examples/task/candidates/TaskCandidatesTest.java</exclude>
<exclude>org/jbpm/examples/esb/EsbTest.java</exclude>
- <exclude>org/jbpm/examples/script/text/ScriptTextTest.java</exclude>
- <exclude>org/jbpm/examples/decision/handler/DecisionHandlerTest.java</exclude>
<exclude>org/jbpm/examples/mail/template/TemplateMailTest.java</exclude>
- <exclude>org/jbpm/examples/script/expression/ScriptExpressionTest.java</exclude>
- <exclude>org/jbpm/examples/task/assignee/TaskAssigneeTest.java</exclude>
<exclude>org/jbpm/examples/mail/inline/InlineMailTest.java</exclude>
- <exclude>org/jbpm/examples/mail/template/TemplateMailTest.java</exclude>
<exclude>org/jbpm/examples/eventlistener/EventListenerTest.java</exclude>
- <exclude>org/jbpm/examples/timer/event/TimerEventTest.java</exclude>
- <exclude>org/jbpm/examples/task/assignmenthandler/TaskAssignmentHandlerTest.java</exclude>
- <exclude>**/JavaInstantiateTest.java</exclude>
</excludes>
</configuration>
</plugin>
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -13,6 +13,6 @@
<import resource="jbpm.jobexecutor.cfg.xml" />
-->
- <import resource="jbpm.mail.templates.xml" />
+ <import resource="jbpm.mail.templates.examples.xml" />
</jbpm-configuration>
Copied: jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml (from rev 4809, jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.xml)
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+
+ <mail-template name="rectify template">
+ <to addresses="${addressee}" />
+ <cc users="bb" groups="innerparty" />
+ <bcc groups="thinkpol" />
+ <subject>rectify ${newspaper}</subject>
+ <text>${newspaper} ${date} ${details}</text>
+ </mail-template>
+
+ </process-engine-context>
+
+</jbpm-configuration>
\ No newline at end of file
Deleted: jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.xml 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <process-engine-context>
-
- <mail-template name="rectify template">
- <to addresses="${addressee}" />
- <cc users="bb" groups="innerparty" />
- <bcc groups="thinkpol" />
- <subject>rectify ${newspaper}</subject>
- <text>${newspaper} ${date} ${details}</text>
- </mail-template>
-
- </process-engine-context>
-
-</jbpm-configuration>
\ No newline at end of file
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailBinding.java 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailBinding.java 2009-05-14 12:19:13 UTC (rev 4810)
@@ -24,12 +24,14 @@
import org.jbpm.api.env.Environment;
import org.jbpm.pvm.internal.email.impl.MailProducerImpl;
import org.jbpm.pvm.internal.email.impl.MailTemplate;
+import org.jbpm.pvm.internal.email.impl.MailTemplateMap;
import org.jbpm.pvm.internal.email.spi.MailProducer;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.binding.MailTemplateBinding;
import org.jbpm.pvm.internal.wire.binding.ObjectBinding;
+import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -69,19 +71,18 @@
String templateName = XmlUtil.attribute(element, "template");
if (templateName != null) {
// load template from configuration
- Object template = Environment.getCurrent().get(templateName);
- if (template instanceof MailTemplate) {
- return (MailTemplate) template;
+ MailTemplateMap mailTemplateMap = Environment.getFromCurrent(MailTemplateMap.class);
+ MailTemplate template = mailTemplateMap.getTemplate(templateName);
+ if (template==null) {
+ parse.addProblem("mail-template "+templateName+" is not configured", element);
}
- else {
- parse.addProblem("mail template not found: " + templateName);
- }
- }
- else {
- // parse inline template
- Descriptor templateDescriptor = (Descriptor) templateBinding.parse(element, parse, parser);
- return (MailTemplate) WireContext.create(templateDescriptor);
- }
- return null;
+ return template;
+ }
+
+ // parse inline template
+ ProvidedObjectDescriptor templateDescriptor = (ProvidedObjectDescriptor) templateBinding.parse(element, parse, parser);
+ MailTemplateMap mailTemplateMap = (MailTemplateMap) templateDescriptor.getProvidedObject();
+ String name = XmlUtil.attribute(element, "name");
+ return mailTemplateMap.getTemplate(name);
}
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailTemplateMap.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailTemplateMap.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailTemplateMap.java 2009-05-14 12:19:13 UTC (rev 4810)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.email.impl;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Tom Baeyens
+ */
+public class MailTemplateMap implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ Map<String, MailTemplate> templates = new HashMap<String, MailTemplate>();
+
+ public void addTemplate(String templateName, MailTemplate template) {
+ templates.put(templateName, template);
+ }
+
+ public MailTemplate getTemplate(String templateName) {
+ return templates.get(templateName);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailTemplateMap.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java 2009-05-14 12:19:13 UTC (rev 4810)
@@ -24,14 +24,13 @@
import java.util.ArrayList;
import java.util.List;
+import org.jbpm.pvm.internal.email.impl.AddressTemplate;
import org.jbpm.pvm.internal.email.impl.AttachmentTemplate;
import org.jbpm.pvm.internal.email.impl.MailTemplate;
-import org.jbpm.pvm.internal.email.impl.AddressTemplate;
+import org.jbpm.pvm.internal.email.impl.MailTemplateMap;
import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
+import org.jbpm.pvm.internal.wire.WireDefinition;
+import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.DocumentFragment;
@@ -48,115 +47,84 @@
}
public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor templateDescriptor = new ObjectDescriptor(MailTemplate.class);
- // name
- String name = element.getAttribute("name");
- if (name != null) {
- templateDescriptor.setName(name);
+
+ // MailTemplateMap is added to the WireDescriptor with a ProvidedObjectDescriptor
+ // The MailTemplateMap descriptor is lazy initialized by this binding
+ // mail-templates will add a MailTemplate to the MailTemplateMap
+
+ ProvidedObjectDescriptor mailTemplateMapDescriptor = null;
+ MailTemplateMap mailTemplateMap = null;
+
+ WireDefinition wireDefinition = parse.findObject(WireDefinition.class);
+ String templateMapDescriptorName = (wireDefinition!=null ? wireDefinition.getDescriptorName(MailTemplateMap.class) : null);
+ if (templateMapDescriptorName!=null) {
+ mailTemplateMapDescriptor = (ProvidedObjectDescriptor) wireDefinition.getDescriptor(templateMapDescriptorName);
+ mailTemplateMap = (MailTemplateMap) mailTemplateMapDescriptor.getProvidedObject();
+ mailTemplateMapDescriptor = null; // setting it to null so that the wire parser won't be add it to the wiredefinition a second time
+ } else {
+ mailTemplateMap = new MailTemplateMap();
+ mailTemplateMapDescriptor = new ProvidedObjectDescriptor(mailTemplateMap, true);
}
- else {
- parse.addProblem("template has no name");
- }
- // language
- String language = XmlUtil.attribute(element, "language");
- if (language != null) {
- templateDescriptor.addInjection("language", new StringDescriptor(language));
- }
- // from
- Element fromElement = XmlUtil.element(element, "from");
- if (fromElement != null) {
- Descriptor fromDescriptor = parseRecipientTemplate(fromElement, parse, parser);
- templateDescriptor.addInjection("from", fromDescriptor);
- }
- // to
- Element toElement = XmlUtil.element(element, "to");
- if (toElement != null) {
- Descriptor toDescriptor = parseRecipientTemplate(toElement, parse, parser);
- templateDescriptor.addPropertyInjection("to", toDescriptor);
- }
- else {
- parse.addProblem("template '" + name + "' has no 'to' recipients");
- }
- // cc
- Element ccElement = XmlUtil.element(element, "cc");
- if (ccElement != null) {
- Descriptor ccDescriptor = parseRecipientTemplate(ccElement, parse, parser);
- templateDescriptor.addPropertyInjection("cc", ccDescriptor);
- }
- // bcc
- Element bccElement = XmlUtil.element(element, "bcc");
- if (bccElement != null) {
- Descriptor bccDescriptor = parseRecipientTemplate(bccElement, parse, parser);
- templateDescriptor.addPropertyInjection("bcc", bccDescriptor);
- }
- // subject
+
+ // create the mail template and add it to the mailTemplateMap
+ MailTemplate mailTemplate = new MailTemplate();
+ String templateName = XmlUtil.attribute(element, "name", true, parse);
+ mailTemplateMap.addTemplate(templateName, mailTemplate);
+
+ mailTemplate.setLanguage(XmlUtil.attribute(element, "language"));
+ mailTemplate.setFrom(parseRecipientTemplate(element, "from", parse, parser));
+ mailTemplate.setTo(parseRecipientTemplate(element, "to", parse, parser));
+ mailTemplate.setCc(parseRecipientTemplate(element, "cc", parse, parser));
+ mailTemplate.setBcc(parseRecipientTemplate(element, "bcc", parse, parser));
+
Element subjectElement = XmlUtil.element(element, "subject");
- if (subjectElement != null) {
- StringDescriptor subjectDescriptor =
- new StringDescriptor(XmlUtil.getContentText(subjectElement));
- templateDescriptor.addInjection("subject", subjectDescriptor);
+ if (subjectElement!=null) {
+ mailTemplate.setSubject(XmlUtil.getContentText(subjectElement));
}
- else {
- parse.addProblem("template '" + name + "' has no subject");
- }
- // text
+
Element textElement = XmlUtil.element(element, "text");
- if (textElement != null) {
- StringDescriptor textDescriptor = new StringDescriptor(XmlUtil.getContentText(textElement));
- templateDescriptor.addInjection("text", textDescriptor);
+ if (textElement!=null) {
+ mailTemplate.setText(XmlUtil.getContentText(textElement));
}
- // html
+
Element htmlElement = XmlUtil.element(element, "html");
- if (htmlElement != null) {
+ if (htmlElement!=null) {
// extract child nodes from html element
DocumentFragment fragment = htmlElement.getOwnerDocument().createDocumentFragment();
for (Node child = htmlElement.getFirstChild(), next; child != null; child = next) {
next = child.getNextSibling();
fragment.appendChild(child);
}
- StringDescriptor htmlDescriptor = new StringDescriptor(XmlUtil.toString(fragment));
- templateDescriptor.addInjection("html", htmlDescriptor);
+ mailTemplate.setHtml(XmlUtil.toString(fragment));
}
+
// attachments
Element attachmentsElement = XmlUtil.element(element, "attachments");
if (attachmentsElement != null) {
- List<Descriptor> attachmentDescriptors = new ArrayList<Descriptor>();
+ List<AttachmentTemplate> attachmentTemplates = new ArrayList<AttachmentTemplate>();
for (Element attachmentElement : XmlUtil.elements(attachmentsElement, "attachment")) {
- ObjectDescriptor attachmentDescriptor = new ObjectDescriptor(AttachmentTemplate.class);
- attachmentDescriptors.add(attachmentDescriptor);
- // url
- String url = XmlUtil.attribute(attachmentElement, "url");
- if (url != null) attachmentDescriptor.addInjection("url", new StringDescriptor(url));
- // resource
- String resource = XmlUtil.attribute(attachmentElement, "resource");
- if (resource != null)
- attachmentDescriptor.addInjection("resource", new StringDescriptor(resource));
- // file
- String file = XmlUtil.attribute(attachmentElement, "file");
- if (file != null) attachmentDescriptor.addInjection("file", new StringDescriptor(file));
+ AttachmentTemplate attachmentTemplate = new AttachmentTemplate();
+ mailTemplate.addAttachmentTemplate(attachmentTemplate);
+
+ attachmentTemplate.setUrl(XmlUtil.attribute(attachmentElement, "url"));
+ attachmentTemplate.setResource(XmlUtil.attribute(attachmentElement, "resource"));
+ attachmentTemplate.setFile(XmlUtil.attribute(attachmentElement, "file"));
}
-
- ListDescriptor attachmentsDescriptor = new ListDescriptor();
- attachmentsDescriptor.setValueDescriptors(attachmentDescriptors);
- templateDescriptor.addInjection("attachmentTemplates", attachmentsDescriptor);
}
- return templateDescriptor;
+ return mailTemplateMapDescriptor;
}
- protected Descriptor parseRecipientTemplate(Element element, Parse parse, Parser parser) {
- ObjectDescriptor recipientDescriptor = new ObjectDescriptor(AddressTemplate.class);
-
- String addresses = XmlUtil.attribute(element, "addresses");
- if (addresses != null)
- recipientDescriptor.addInjection("addresses", new StringDescriptor(addresses));
-
- String users = XmlUtil.attribute(element, "users");
- if (users != null) recipientDescriptor.addInjection("users", new StringDescriptor(users));
-
- String groups = XmlUtil.attribute(element, "groups");
- if (groups != null) recipientDescriptor.addInjection("groups", new StringDescriptor(groups));
-
- return recipientDescriptor;
+ protected AddressTemplate parseRecipientTemplate(Element element, String tagName, Parse parse, Parser parser) {
+ AddressTemplate addressTemplate = null;
+
+ Element recipientElement = XmlUtil.element(element, tagName);
+ if (recipientElement!=null) {
+ addressTemplate = new AddressTemplate();
+
+ addressTemplate.setAddresses(XmlUtil.attribute(recipientElement, "addresses"));
+ addressTemplate.setUsers(XmlUtil.attribute(recipientElement, "users"));
+ addressTemplate.setGroups(XmlUtil.attribute(recipientElement, "groups"));
+ }
+ return addressTemplate;
}
-
}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -40,6 +40,11 @@
<friday hours="9:00-12:00 and 12:30-17:00"/>
<holiday period="01/07/2008 - 31/08/2008"/>
</business-calendar>
+
+ <!--mail-template name="TaskNotification"
+ -->
+ <!--mail-template name="TaskReminder"
+ -->
</process-engine-context>
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MailTemplateWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MailTemplateWireTest.java 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MailTemplateWireTest.java 2009-05-14 12:19:13 UTC (rev 4810)
@@ -25,6 +25,7 @@
import org.jbpm.pvm.internal.email.impl.AttachmentTemplate;
import org.jbpm.pvm.internal.email.impl.MailTemplate;
+import org.jbpm.pvm.internal.email.impl.MailTemplateMap;
/**
* @author Alejandro Guizar
@@ -40,8 +41,9 @@
+ "</mail-template>"
+ "</objects>");
- Object template = wireContext.get("memo");
- assertTrue(template instanceof MailTemplate);
+ MailTemplateMap mailTemplateMap = wireContext.get(MailTemplateMap.class);
+ assertNotNull(mailTemplateMap);
+ assertNotNull(mailTemplateMap.getTemplate("memo"));
}
public void testLanguage() {
@@ -53,7 +55,7 @@
+ "</mail-template>"
+ "</objects>");
- MailTemplate template = wireContext.get(MailTemplate.class);
+ MailTemplate template = wireContext.get(MailTemplateMap.class).getTemplate("memo");
assertEquals("juel", template.getLanguage());
}
@@ -67,7 +69,7 @@
+ "</mail-template>"
+ "</objects>");
- MailTemplate template = wireContext.get(MailTemplate.class);
+ MailTemplate template = wireContext.get(MailTemplateMap.class).getTemplate("memo");
assertEquals("wacko(a)jbpm.org", template.getFrom().getAddresses());
}
@@ -80,7 +82,7 @@
+ "</mail-template>"
+ "</objects>");
- MailTemplate template = wireContext.get(MailTemplate.class);
+ MailTemplate template = wireContext.get(MailTemplateMap.class).getTemplate("memo");
assertEquals("dilbert@office, alice@work, dogbert@house", template.getTo().getAddresses());
}
@@ -94,7 +96,7 @@
+ "</mail-template>"
+ "</objects>");
- MailTemplate template = wireContext.get(MailTemplate.class);
+ MailTemplate template = wireContext.get(MailTemplateMap.class).getTemplate("memo");
assertEquals("theboss, hrpolicymaker", template.getCc().getUsers());
}
@@ -108,7 +110,7 @@
+ "</mail-template>"
+ "</objects>");
- MailTemplate template = wireContext.get(MailTemplate.class);
+ MailTemplate template = wireContext.get(MailTemplateMap.class).getTemplate("memo");
assertEquals("thoughtpolice", template.getBcc().getGroups());
}
@@ -121,7 +123,7 @@
+ "</mail-template>"
+ "</objects>");
- MailTemplate template = wireContext.get(MailTemplate.class);
+ MailTemplate template = wireContext.get(MailTemplateMap.class).getTemplate("memo");
assertEquals("bureaucracy", template.getSubject());
}
@@ -135,7 +137,7 @@
+ "</mail-template>"
+ "</objects>");
- MailTemplate template = wireContext.get(MailTemplate.class);
+ MailTemplate template = wireContext.get(MailTemplateMap.class).getTemplate("memo");
assertEquals("plain text content", template.getText());
}
@@ -149,7 +151,7 @@
+ "</mail-template>"
+ "</objects>");
- MailTemplate template = wireContext.get(MailTemplate.class);
+ MailTemplate template = wireContext.get(MailTemplateMap.class).getTemplate("memo");
assertEquals("<strong>rich</strong> content", template.getHtml());
}
@@ -167,7 +169,7 @@
+ "</mail-template>"
+ "</objects>");
- MailTemplate template = wireContext.get(MailTemplate.class);
+ MailTemplate template = wireContext.get(MailTemplateMap.class).getTemplate("memo");
List<AttachmentTemplate> attachmentTemplates = template.getAttachmentTemplates();
assertEquals(3, attachmentTemplates.size());
// url
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-05-13 20:34:25 UTC (rev 4809)
+++ jbpm4/trunk/qa/build.xml 2009-05-14 12:19:13 UTC (rev 4810)
@@ -49,6 +49,7 @@
description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
<ant antfile="${jbpm.home}/jboss/build.xml" target="reinstall.jboss" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="install.jbpm.into.jboss" />
+ <ant antfile="${jbpm.home}/jboss/build.xml" target="internal.install.jbpm.into.jboss.integrationtestspecifics" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="start.jboss" />
<ant antfile="${jbpm.home}/db/build.xml" target="create.jbpm.schema" />
</target>
15 years, 4 months
JBoss JBPM SVN: r4809 - jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-13 16:34:25 -0400 (Wed, 13 May 2009)
New Revision: 4809
Modified:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
Log:
More finegrained task list access methods
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-05-13 20:23:37 UTC (rev 4808)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-05-13 20:34:25 UTC (rev 4809)
@@ -23,11 +23,9 @@
import org.jboss.bpm.console.client.model.TaskRef;
import org.jboss.bpm.console.server.integration.TaskManagement;
-import org.jbpm.api.IdentityService;
import org.jbpm.api.TaskService;
import org.jbpm.api.env.Environment;
import org.jbpm.api.env.EnvironmentFactory;
-import org.jbpm.api.task.GroupRef;
import org.jbpm.api.task.Participation;
import org.jbpm.api.task.Task;
@@ -41,17 +39,27 @@
*/
public class TaskManagementImpl extends JBPMIntegration implements TaskManagement
{
- public List<TaskRef> getTasksForIdentity(String idRef)
+ public List<TaskRef> getAssignedTasks(String idRef)
{
- return internalGetTaskForIdentity(idRef, null);
- }
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
- public List<TaskRef> getTasksForIdentity(String idRef, String participationType)
- {
- return internalGetTaskForIdentity(idRef, participationType);
+ try
+ {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ List<TaskRef> results = new ArrayList<TaskRef>();
+
+ List<Task> assignedTasks = taskService.findAssignedTasks(idRef);
+ adoptTasks(assignedTasks, results);
+
+ return results;
+ }
+ finally
+ {
+ env.close();
+ }
}
- private List<TaskRef> internalGetTaskForIdentity(String idRef, String participationType)
+ public List<TaskRef> getUnassignedTasks(String idRef, String participationType)
{
Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
@@ -62,11 +70,7 @@
if(null==participationType || participationType.equals(Participation.CANDIDATE))
{
- // TODO: Paging
- List<Task> assignedTasks = taskService.findAssignedTasks(idRef);
List<Task> takableTasks = taskService.findTakableTasks(idRef);
-
- adoptTasks(assignedTasks, results);
adoptTasks(takableTasks, results);
}
else
@@ -90,21 +94,6 @@
}
}
- private GroupRef[] getGroupIdsForIdentityRef(String idRef)
- {
- IdentityService idService = this.processEngine.get(IdentityService.class);
- List<String> groupIds = idService.findGroupIdsByUser(idRef);
- GroupRef[] groupRefs = new GroupRef[groupIds.size()];
- int i = 0;
- for(String groupId : groupIds)
- {
- groupRefs[i] = new GroupRef(groupId);
- i++;
- }
-
- return groupRefs;
- }
-
public TaskRef getTaskById(long taskId)
{
Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
@@ -120,20 +109,6 @@
}
}
- public void takeTask(long taskId, String idRef)
- {
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.takeTask(taskId, idRef);
- }
- finally{
- env.close();
- }
- }
-
public void assignTask(long taskId, String idRef)
{
Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
@@ -171,7 +146,7 @@
TaskService taskService = this.processEngine.get(TaskService.class);
if(data!=null)
taskService.setVariables(taskId, data);
-
+
taskService.completeTask(taskId);
}
finally{
15 years, 4 months
JBoss JBPM SVN: r4808 - in projects/gwt-console/trunk: gui/war/src/main/java/org/jboss/bpm/console/client/task/events and 3 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-13 16:23:37 -0400 (Wed, 13 May 2009)
New Revision: 4808
Added:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantPanel.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/AssignEvent.java
Removed:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantTree.java
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java
Log:
Fix JBPM-2253, JBPM-2234: Task re-assignment & duplicate task list entries
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -0,0 +1,69 @@
+/*
+ * 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.task;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.task.events.AssignEvent;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class AssignTaskAction extends AbstractRESTAction
+{
+
+ public final static String ID = AssignTaskAction.class.getName();
+
+ public AssignTaskAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ AssignEvent payload = (AssignEvent)event;
+ return appContext.getUrlBuilder().getTaskAssignURL(payload.getTask().getId(), payload.getIdRef());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(
+ final Controller controller, final Object event, Response response)
+ {
+ // refresh all task list
+ controller.handleEvent(
+ new Event(ReloadAllTaskListsAction.ID, null)
+ );
+ }
+}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -138,7 +138,7 @@
public void onClick(Widget sender) {
// force loading
controller.handleEvent(
- new Event(LoadTasksAction.ID, getAssignedIdentity())
+ new Event(LoadTasksAction.ID, appContext.getAuthentication().getUsername())
);
}
}
@@ -180,7 +180,7 @@
if(selection!=null)
{
TaskIdentityEvent payload = new TaskIdentityEvent(
- getAssignedIdentity(), selection
+ null, selection
);
controller.handleEvent(
@@ -221,7 +221,7 @@
windowPanel.addWindowCloseListener(new WindowCloseListener() {
public void onWindowClosed() {
controller.handleEvent(
- new Event(LoadTasksAction.ID, getAssignedIdentity())
+ new Event(LoadTasksAction.ID, appContext.getAuthentication().getUsername())
);
windowPanel = null;
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -62,10 +62,8 @@
public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
{
- TaskIdentityEvent claimEvent = (TaskIdentityEvent)event;
-
controller.handleEvent(
- new Event(LoadTasksAction.ID, claimEvent.getIdentity())
+ new Event(ReloadAllTaskListsAction.ID, null)
);
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -36,7 +36,6 @@
* Loads a task list for a particular identity.
*
* @see org.jboss.bpm.console.client.task.AssignedTasksView
- * @see org.jboss.bpm.console.client.task.OpenTasksView
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -71,11 +70,9 @@
String identity = (String)event;
List<TaskRef> tasks = DTOParser.parseTaskReferenceList(response.getText());
- OpenTasksView openTasks = (OpenTasksView)controller.getView(OpenTasksView.ID);
- AssignedTasksView personalTasks = (AssignedTasksView)controller.getView(AssignedTasksView.ID);
+ AssignedTasksView view = (AssignedTasksView)controller.getView(AssignedTasksView.ID);
- ConsoleLog.info("Loaded " + tasks.size() + " tasks");
- openTasks.update(identity, tasks);
- personalTasks.update(identity, tasks);
+ ConsoleLog.info("Loaded " + tasks.size() + " tasks");
+ view.update(identity, tasks);
}
}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -0,0 +1,78 @@
+/*
+ * 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.task;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.TaskRef;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+
+import java.util.List;
+
+/**
+ * Load a task list where user participates
+ *
+ * @see OpenTasksView
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class LoadTasksParticipationAction extends AbstractRESTAction
+{
+ public final static String ID = LoadTasksParticipationAction.class.getName();
+
+ public LoadTasksParticipationAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String identity = (String)event;
+ return appContext.getUrlBuilder().getParticipationTaskListURL(identity);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(
+ final Controller controller, final Object event, Response response)
+ {
+ String identity = (String)event;
+
+ List<TaskRef> tasks = DTOParser.parseTaskReferenceList(response.getText());
+ OpenTasksView view = (OpenTasksView)controller.getView(OpenTasksView.ID);
+
+ ConsoleLog.info("Loaded " + tasks.size() + " tasks");
+ view.update(identity, tasks);
+ }
+}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -23,7 +23,6 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.*;
-import com.google.gwt.user.client.ui.HTML;
import com.mvc4g.client.Event;
import org.gwt.mosaic.ui.client.*;
import org.gwt.mosaic.ui.client.ListBox;
@@ -33,9 +32,9 @@
import org.jboss.bpm.console.client.model.TaskRef;
import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
import org.jboss.bpm.console.client.task.events.DetailViewEvent;
+import org.jboss.bpm.console.client.ApplicationContext;
import java.util.List;
-import java.util.Date;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -47,10 +46,13 @@
private TaskDetailView detailsView;
- public OpenTasksView(TaskDetailView detailView)
+ private ApplicationContext appContext;
+
+ public OpenTasksView(ApplicationContext appContext, TaskDetailView detailView)
{
super();
-
+ this.appContext = appContext;
+
ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
setTitle("Open Tasks");
setIcon(icons.taskIcon());
@@ -133,7 +135,7 @@
public void onClick(Widget sender) {
// force loading
controller.handleEvent(
- new Event(LoadTasksAction.ID, getAssignedIdentity())
+ new Event(LoadTasksParticipationAction.ID, getAssignedIdentity())
);
}
}
@@ -153,7 +155,7 @@
controller.handleEvent(
new Event(
ClaimTaskAction.ID,
- new TaskIdentityEvent(getAssignedIdentity(), selection)
+ new TaskIdentityEvent(appContext.getAuthentication().getUsername(), selection)
)
);
}
Copied: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantPanel.java (from rev 4798, projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantTree.java)
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantPanel.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantPanel.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -0,0 +1,151 @@
+/*
+ * 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.task;
+
+
+import com.google.gwt.user.client.ui.*;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.model.ParticipantRef;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.task.events.AssignEvent;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+class ParticipantPanel extends LayoutPanel implements ViewInterface
+{
+
+ public final static String ID = ParticipantPanel.class.getName();
+
+ public final static String PARTICIPANTS = "Participants";
+ public final static String GROUPS = "Groups";
+ public final static String USERS = "Users";
+
+ private Controller controller;
+
+ private Tree tree;
+ private Button assignmentBtn;
+ private String selection = null;
+ private TaskRef currentTask;
+
+ public ParticipantPanel()
+ {
+ super(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+ setPadding(5);
+
+ // particpants
+ ScrollLayoutPanel treePanel = new ScrollLayoutPanel();
+ tree = new Tree();
+ treePanel.add(tree);
+ this.add(treePanel, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ tree.addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ String name = treeItem.getText();
+ if(
+ !name.equals(PARTICIPANTS)
+ &! name.equals(GROUPS)
+ &! name.equals(USERS)
+ )
+ {
+ selection = name;
+ assignmentBtn.setEnabled(true);
+ }
+ else
+ {
+ selection = null;
+ assignmentBtn.setEnabled(false);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+
+ // operations
+ assignmentBtn = new Button(
+ "Assign",
+ new ClickListener() {
+
+ public void onClick(Widget widget)
+ {
+ if(selection!=null)
+ {
+ controller.handleEvent(
+ new Event(AssignTaskAction.ID, new AssignEvent(selection, currentTask))
+ );
+ }
+ }
+ }
+ );
+
+ assignmentBtn.setEnabled(false);
+ add(assignmentBtn);
+ }
+
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(TaskRef task)
+ {
+ currentTask = task;
+
+ TreeItem root = tree.addItem(PARTICIPANTS);
+
+ // groups
+ TreeItem groups = root.addItem(GROUPS);
+ for(ParticipantRef gref : task.getParticipantGroups())
+ {
+ groups.addItem(gref.getIdRef());
+ }
+
+ // users
+ TreeItem users = root.addItem(USERS);
+ for(ParticipantRef uref : task.getParticipantUsers())
+ {
+ users.addItem(uref.getIdRef());
+ }
+
+ this.invalidate();
+ }
+
+ public void clear()
+ {
+ tree.clear();
+ currentTask = null;
+ }
+}
\ No newline at end of file
Deleted: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantTree.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantTree.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ParticipantTree.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -1,90 +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.task;
-
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.TreeItem;
-import com.google.gwt.user.client.ui.TreeListener;
-import org.jboss.bpm.console.client.model.TaskRef;
-import org.jboss.bpm.console.client.model.ParticipantRef;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-class ParticipantTree extends Tree
-{
-
- public final static String PARTICIPANTS = "Participants";
- public final static String GROUPS = "Groups";
- public final static String USERS = "Users";
-
- public ParticipantTree()
- {
- super();
- this.addTreeListener(
- new TreeListener()
- {
- public void onTreeItemSelected(TreeItem treeItem)
- {
- String name = treeItem.getText();
- if(
- !name.equals(PARTICIPANTS)
- &! name.equals(GROUPS)
- &! name.equals(USERS)
- )
- {
- System.out.println("Selected " + name);
- }
- }
-
- public void onTreeItemStateChanged(TreeItem treeItem)
- {
-
- }
- }
- );
- }
-
- public void update(TaskRef task)
- {
- TreeItem root = this.addItem(PARTICIPANTS);
-
- // groups
- TreeItem groups = root.addItem(GROUPS);
- for(ParticipantRef gref : task.getParticipantGroups())
- {
- groups.addItem(gref.getIdRef());
- }
-
- // users
- TreeItem users = root.addItem(USERS);
- for(ParticipantRef uref : task.getParticipantUsers())
- {
- users.addItem(uref.getIdRef());
- }
- }
-
- public void clear()
- {
- super.clear();
- }
-}
\ No newline at end of file
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -59,11 +59,9 @@
public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
{
- TaskIdentityEvent tie = (TaskIdentityEvent)event;
-
// force refresh reload
controller.handleEvent(
- new Event(LoadTasksAction.ID, tie.getIdentity())
+ new Event(ReloadAllTaskListsAction.ID, null)
);
}
}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -0,0 +1,59 @@
+/*
+ * 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.task;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+
+/**
+ * Reloads all task lists after assignment or completion of a task.
+
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ReloadAllTaskListsAction implements ActionInterface
+{
+
+ public final static String ID = ReloadAllTaskListsAction.class.getName();
+
+ private ApplicationContext appContext;
+
+ public ReloadAllTaskListsAction(ApplicationContext appContext)
+ {
+ this.appContext = appContext;
+ }
+
+ public void execute(Controller controller, Object object)
+ {
+ // assigned tasks
+ String currentUser = appContext.getAuthentication().getUsername();
+ controller.handleEvent(
+ new Event(LoadTasksAction.ID, currentUser)
+ );
+
+ // open tasks
+ controller.handleEvent(
+ new Event(LoadTasksParticipationAction.ID, currentUser)
+ );
+ }
+}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskDetailView.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -22,93 +22,104 @@
package org.jboss.bpm.console.client.task;
import com.google.gwt.user.client.ui.ChangeListener;
-import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.TreeItem;
import com.mvc4g.client.Controller;
import com.mvc4g.client.ViewInterface;
import org.gwt.mosaic.ui.client.Caption;
import org.gwt.mosaic.ui.client.CaptionLayoutPanel;
import org.gwt.mosaic.ui.client.DeckLayoutPanel;
-import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
import org.gwt.mosaic.ui.client.layout.BoxLayout;
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
-import org.gwt.mosaic.ui.client.layout.LayoutPanel;
import org.jboss.bpm.console.client.common.PropertyGrid;
import org.jboss.bpm.console.client.model.TaskRef;
-import org.jboss.bpm.console.client.model.ParticipantRef;
+import org.jboss.bpm.console.client.LazyPanel;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class TaskDetailView extends CaptionLayoutPanel implements ViewInterface
+public class TaskDetailView extends CaptionLayoutPanel
+ implements ViewInterface, LazyPanel
{
public final static String ID = TaskDetailView.class.getName();
-
+
private Controller controller;
private TaskRef currentTask = null;
private PropertyGrid grid;
- private ParticipantTree participantTree;
-
+ private ParticipantPanel participantPanel;
+
private boolean openView;
+ private boolean initialzed;
+
public TaskDetailView(boolean openView)
{
// render
super("Task details");
this.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
-
+
super.setStyleName("bpm-detail-panel");
this.openView = openView;
-
- grid = new PropertyGrid(
- new String[] {"ID:", "Name:", "Description:"}
- );
- if(openView)
+ }
+
+ public boolean isInitialized()
+ {
+ return initialzed;
+ }
+
+ public void initialize()
+ {
+ if(!this.initialzed)
{
- // properties
- final DeckLayoutPanel deck = new DeckLayoutPanel();
- deck.add(grid);
- // participants
- ScrollLayoutPanel participants = new ScrollLayoutPanel();
- participantTree = new ParticipantTree();
- participants.add(participantTree);
+ grid = new PropertyGrid(
+ new String[] {"ID:", "Name:", "Assignee:", "Description:"}
+ );
- // selection
- final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
- dropBox.addItem("Properties");
- dropBox.addItem("Participants");
- dropBox.addChangeListener(new ChangeListener() {
- public void onChange(Widget sender) {
- deck.showWidget(dropBox.getSelectedIndex());
- deck.layout();
- }
- });
+ if(openView)
+ {
+ // properties
+ final DeckLayoutPanel deck = new DeckLayoutPanel();
+ deck.add(grid);
- deck.add(participants);
+ // participants
+ participantPanel = new ParticipantPanel();
+ participantPanel.setController(controller);
- this.getHeader().add(dropBox, Caption.CaptionRegion.RIGHT);
- this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+ // selection
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.addItem("Properties");
+ dropBox.addItem("Participants");
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ deck.showWidget(dropBox.getSelectedIndex());
+ deck.layout();
+ }
+ });
- deck.showWidget(dropBox.getSelectedIndex());
- }
- else
- {
- this.add(grid);
- }
+ deck.add(participantPanel);
+ this.getHeader().add(dropBox, Caption.CaptionRegion.RIGHT);
+ this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+ deck.showWidget(dropBox.getSelectedIndex());
+ }
+ else
+ {
+ this.add(grid);
+ }
+
+ this.initialzed = true;
+ }
}
public void setController(Controller controller)
{
- this.controller = controller;
+ this.controller = controller;
}
public void update(TaskRef task)
@@ -118,13 +129,14 @@
String[] values = new String[] {
String.valueOf(task.getId()),
task.getName(),
+ task.getAssignee(),
description
};
grid.update(values);
- if(openView && participantTree!=null)
- participantTree.update(task);
+ if(openView && participantPanel !=null)
+ participantPanel.update(task);
}
public void clear()
@@ -132,8 +144,8 @@
currentTask = null;
grid.clear();
- if(openView && participantTree!=null) // event handling is broken. The change listener fires too early
- participantTree.clear();
+ if(openView && participantPanel !=null) // event handling is broken. The change listener fires too early
+ participantPanel.clear();
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -81,26 +81,33 @@
this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
TaskDetailView openDetailView = new TaskDetailView(true);
- TaskDetailView assingnedDetailView = new TaskDetailView(false);
- controller.addView("OpenDetailView", openDetailView);
- controller.addView("AssignedDetailView", assingnedDetailView);
+ TaskDetailView assignedDetailView = new TaskDetailView(false);
// create and register views
- registerView(OpenTasksView.ID, new OpenTasksView(openDetailView));
- registerView(AssignedTasksView.ID, new AssignedTasksView(appContext, assingnedDetailView));
+ controller.addView("OpenDetailView", openDetailView);
+ controller.addView("AssignedDetailView", assignedDetailView);
+ openDetailView.initialize();
+ assignedDetailView.initialize();
+
+ registerView(OpenTasksView.ID, new OpenTasksView(appContext, openDetailView));
+ registerView(AssignedTasksView.ID, new AssignedTasksView(appContext, assignedDetailView));
+
// create and register actions
registerAction(LoadTasksAction.ID, new LoadTasksAction(appContext));
+ registerAction(LoadTasksParticipationAction.ID, new LoadTasksParticipationAction(appContext));
registerAction(ClaimTaskAction.ID, new ClaimTaskAction(appContext));
registerAction(ReleaseTaskAction.ID, new ReleaseTaskAction(appContext));
registerAction(UpdateDetailsAction.ID, new UpdateDetailsAction());
+ registerAction(AssignTaskAction.ID, new AssignTaskAction(appContext));
+ registerAction(ReloadAllTaskListsAction.ID, new ReloadAllTaskListsAction(appContext));
// display tab, needs to visible for correct rendering
tabPanel.selectTab(0);
// force loading
super.controller.handleEvent(
- new Event(LoadTasksAction.ID, appContext.getAuthentication().getUsername())
+ new Event(ReloadAllTaskListsAction.ID, null)
);
appContext.refreshView();
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/AssignEvent.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/AssignEvent.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/events/AssignEvent.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -0,0 +1,49 @@
+/*
+ * 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.task.events;
+
+import org.jboss.bpm.console.client.model.TaskRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public final class AssignEvent
+{
+ private String idRef;
+ private TaskRef task;
+
+ public AssignEvent(String idRef, TaskRef task)
+ {
+ this.idRef = idRef;
+ this.task = task;
+ }
+
+ public String getIdRef()
+ {
+ return idRef;
+ }
+
+ public TaskRef getTask()
+ {
+ return task;
+ }
+}
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -110,9 +110,9 @@
return getConsoleServerUrl() + "/rs/tasks/" + URL.encode(idRef);
}
- public String getParticipationTaskListURL(String idRef, String participation)
+ public String getParticipationTaskListURL(String idRef)
{
- return getConsoleServerUrl() + "/rs/tasks/" + URL.encode(idRef) +"/participation/"+URL.encode(participation);
+ return getConsoleServerUrl() + "/rs/tasks/" + URL.encode(idRef) +"/participation";
}
public String getTaskReleaseURL(long id)
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskListFacade.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -35,6 +35,7 @@
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import java.util.List;
+import java.util.ArrayList;
import java.net.URL;
/**
@@ -87,13 +88,29 @@
String idRef
)
{
- List<TaskRef> refs = getTaskManagement().getTasksForIdentity(idRef);
+ List<TaskRef> assignedTasks = getTaskManagement().getAssignedTasks(idRef);
+ return processTaskListResponse(assignedTasks);
+ }
+ @GET
+ @Path("{idRef}/participation")
+ @Produces("application/json")
+ public Response getTasksForIdRefParticipation(
+ @PathParam("idRef")
+ String idRef
+ )
+ {
+ List<TaskRef> taskParticipation = getTaskManagement().getUnassignedTasks(idRef, null);
+ return processTaskListResponse(taskParticipation);
+ }
+
+ private Response processTaskListResponse(List<TaskRef> taskList)
+ {
// decorate task form URL if plugin available
TaskDispatcherPlugin formPlugin = getTaskDispatcherPlugin();
if(formPlugin!=null)
{
- for(TaskRef task : refs)
+ for(TaskRef task : taskList)
{
URL taskFormURL = formPlugin.getDispatchUrl(task.getId());
if(taskFormURL!=null)
@@ -102,23 +119,8 @@
}
}
}
-
- TaskRefWrapper wrapper = new TaskRefWrapper(refs);
- return createJsonResponse(wrapper);
- }
- @GET
- @Path("{idRef}/participation/{type}")
- @Produces("application/json")
- public Response getTasksForIdRefAndParticipation(
- @PathParam("idRef")
- String idRef,
- @PathParam("type")
- String participationType
- )
- {
- TaskRefWrapper wrapper =
- new TaskRefWrapper(getTaskManagement().getTasksForIdentity(idRef, participationType));
+ TaskRefWrapper wrapper = new TaskRefWrapper(taskList);
return createJsonResponse(wrapper);
}
Modified: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java 2009-05-13 15:15:51 UTC (rev 4807)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java 2009-05-13 20:23:37 UTC (rev 4808)
@@ -30,18 +30,39 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public interface TaskManagement
-{
+{
+ /**
+ * fetch a single task
+ */
TaskRef getTaskById(long taskId);
+ /**
+ * assign user to task
+ */
void assignTask(long taskId, String idRef);
+ /**
+ * unset a task assignment
+ */
void releaseTask(long taskId);
+ /**
+ * complete a task
+ */
void completeTask(long taskId, Map data);
- void completeTask(long taskId, String outcome, Map data);
+ /**
+ * complete a task with a given outcome (trigger)
+ */
+ void completeTask(long taskId, String outcome, Map data);
- List<TaskRef> getTasksForIdentity(String idRef);
+ /**
+ * get tasks assingned to a user
+ */
+ List<TaskRef> getAssignedTasks(String idRef);
- List<TaskRef> getTasksForIdentity(String idRef, String participationType);
+ /**
+ * get unassigned tasks where a user participates
+ */
+ List<TaskRef> getUnassignedTasks(String idRef, String participationType);
}
15 years, 4 months
JBoss JBPM SVN: r4807 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/job and 14 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-13 11:15:51 -0400 (Wed, 13 May 2009)
New Revision: 4807
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessInstanceQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.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/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateJobDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessInstanceQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.repository.hbm.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
Log:
JBPM-2242 added deployment state and introduced suspend and resume
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -26,19 +26,19 @@
import java.net.URL;
import java.util.zip.ZipInputStream;
-import org.jbpm.api.client.ClientProcessDefinition;
-
-/**
+/**
* @author Tom Baeyens
*/
public interface Deployment {
+ long getDbid();
+
String getName();
Deployment setName(String name);
long getTimestamp();
Deployment setTimestamp(long timestamp);
-
+
Deployment addResourceFromString(String resourceName, String string);
Deployment addResourceFromInputStream(String resourceName, InputStream inputStream);
Deployment addResourceFromClasspath(String resourceName);
@@ -48,6 +48,4 @@
/** @return deploymentId */
long deploy();
-
- Deployment addProcessDefinition(ClientProcessDefinition processDefinition);
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -205,4 +205,7 @@
* Returns an empty set in case there are no activities active.
* @see #findActiveExecutionIn(String) */
Set<String> findActiveActivityNames();
+
+ /** id of the process definition used for this execution */
+ String getProcessDefinitionId();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -39,6 +39,7 @@
ProcessDefinitionQuery nameLike(String name);
ProcessDefinitionQuery name(String name);
ProcessDefinitionQuery deploymentDbid(long deploymentDbid);
+ ProcessDefinitionQuery suspended();
ProcessDefinitionQuery orderAsc(String property);
ProcessDefinitionQuery orderDesc(String property);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessInstanceQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessInstanceQuery.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessInstanceQuery.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -35,6 +35,8 @@
ProcessInstanceQuery processInstanceId(String processInstanceId);
+ ProcessInstanceQuery suspended();
+
ProcessInstanceQuery orderAsc(String property);
ProcessInstanceQuery orderDesc(String property);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -33,6 +33,8 @@
Deployment createDeployment();
+ void suspendDeployment(long deploymentDbid);
+ void resumeDeployment(long deploymentDbid);
void deleteDeployment(long deploymentDbid);
void deleteDeploymentCascade(long deploymentDbid);
@@ -41,5 +43,4 @@
ProcessDefinitionQuery createProcessDefinitionQuery();
ActivityCoordinates getActivityCoordinates(String processDefinitionId, String activityName);
-
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -35,8 +35,6 @@
String getLockOwner();
- boolean isSuspended();
-
Date getDueDate();
String getException();
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-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -82,10 +82,10 @@
.endProcess();
// deploy process
- environment.get(RepositoryService.class)
- .createDeployment()
- .addProcessDefinition(processDefinition)
- .deploy();
+// environment.get(RepositoryService.class)
+// .createDeployment()
+// .addProcessDefinition(processDefinition)
+// .deploy();
processDefinitionId = processDefinition.getId();
}
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-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -130,10 +130,10 @@
public void testHappyTimer() throws CreateException {
// deploy process
listenerDescriptor.setClassName(HappyListener.class.getName());
- environment.get(RepositoryService.class)
- .createDeployment()
- .addProcessDefinition(processDefinition)
- .deploy();
+// environment.get(RepositoryService.class)
+// .createDeployment()
+// .addProcessDefinition(processDefinition)
+// .deploy();
// start execution
Execution execution = environment.get(ExecutionService.class).startProcessInstanceById(
@@ -175,10 +175,10 @@
public void testNoisyTimer() throws CreateException {
// deploy process
listenerDescriptor.setClassName(NoisyListener.class.getName());
- environment.get(RepositoryService.class)
- .createDeployment()
- .addProcessDefinition(processDefinition)
- .deploy();
+// environment.get(RepositoryService.class)
+// .createDeployment()
+// .addProcessDefinition(processDefinition)
+// .deploy();
// start execution
ExecutionService executionService = environment.get(ExecutionService.class);
@@ -228,10 +228,10 @@
public void testCyclicTimer() throws CreateException {
// deploy process
listenerDescriptor.setClassName(HappyListener.class.getName());
- environment.get(RepositoryService.class)
- .createDeployment()
- .addProcessDefinition(processDefinition)
- .deploy();
+// environment.get(RepositoryService.class)
+// .createDeployment()
+// .addProcessDefinition(processDefinition)
+// .deploy();
// start execution
ExecutionImpl execution = (ExecutionImpl) environment.get(ExecutionService.class)
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -44,10 +44,6 @@
private static Log log = Log.getLog(JpdlDeployer.class.getName());
- public static final String KEY_ID = "id";
- public static final String KEY_KEY = "key";
- public static final String KEY_VERSION = "version";
-
static JpdlParser jpdlParser = new JpdlParser();
public void deploy(DeploymentImpl deployment) {
@@ -67,9 +63,9 @@
processDefinition.setDeploymentDbid(deployment.getDbid());
if (deployment.hasObjectProperties(processDefinitionName)) {
- String key = (String) deployment.getObjectProperty(processDefinitionName, KEY_KEY);
- String id = (String) deployment.getObjectProperty(processDefinitionName, KEY_ID);
- Long version = (Long) deployment.getObjectProperty(processDefinitionName, KEY_VERSION);
+ String key = deployment.getProcessDefinitionKey(processDefinitionName);
+ String id = deployment.getProcessDefinitionId(processDefinitionName);
+ Long version = deployment.getProcessDefinitionVersion(processDefinitionName);
processDefinition.setId(id);
processDefinition.setKey(key);
processDefinition.setVersion(version.intValue());
@@ -79,9 +75,9 @@
checkVersion(processDefinition, deployment);
checkId(processDefinition, deployment);
- deployment.addObjectProperty(processDefinitionName, KEY_KEY, processDefinition.getKey());
- deployment.addObjectProperty(processDefinitionName, KEY_VERSION, new Long(processDefinition.getVersion()));
- deployment.addObjectProperty(processDefinitionName, KEY_ID, processDefinition.getId());
+ deployment.setProcessDefinitionId(processDefinitionName, processDefinition.getId());
+ deployment.setProcessDefinitionKey(processDefinitionName, processDefinition.getKey());
+ deployment.setProcessDefinitionVersion(processDefinitionName, new Long(processDefinition.getVersion()));
}
deployment.addObject(processDefinitionName, processDefinition);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/JbpmDeployTask.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -86,6 +86,8 @@
private void deployFile(ProcessEngine processEngine, File processFile) {
RepositoryService repositoryService = processEngine.getRepositoryService();
Deployment deployment = repositoryService.createDeployment();
+ deployment.setName(processFile.getName());
+ deployment.setTimestamp(System.currentTimeMillis());
if (processFile.getName().endsWith(".xml")) {
log("deploying process file "+processFile.getName());
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import org.hibernate.Session;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ResumeDeploymentCmd implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+
+ long deploymentDbid;
+
+ public ResumeDeploymentCmd(long deploymentDbid) {
+ this.deploymentDbid = deploymentDbid;
+ }
+
+ public Object execute(Environment environment) throws Exception {
+ Session session = environment.get(Session.class);
+ DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, deploymentDbid);
+ deployment.resume();
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -57,6 +57,9 @@
RepositorySession repositorySession = environment.get(RepositorySession.class);
processDefinition = (ClientProcessDefinition) repositorySession.findProcessDefinitionByKey(processDefinitionKey);
+ if (processDefinition==null) {
+ throw new JbpmException("no process definition with key "+processDefinitionKey);
+ }
ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
processInstance.setVariables(variables);
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import org.hibernate.Session;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SuspendDeploymentCmd implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+
+ long deploymentDbid;
+
+ public SuspendDeploymentCmd(long deploymentDbid) {
+ this.deploymentDbid = deploymentDbid;
+ }
+
+ public Object execute(Environment environment) throws Exception {
+ Session session = environment.get(Session.class);
+ DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, deploymentDbid);
+ deployment.suspend();
+ return null;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateJobDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateJobDbSession.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateJobDbSession.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -35,7 +35,6 @@
public class HibernateJobDbSession extends HibernateDbSession implements JobDbSession {
public JobImpl<?> findFirstAcquirableJob() {
- // query definition can be found at the bottom of resource jbpm.pvm.job.hbm.xml
Query query = session.getNamedQuery("findFirstAcquirableJob");
query.setTimestamp("now", Clock.getCurrentTime());
query.setMaxResults(1);
@@ -43,7 +42,6 @@
}
public List<JobImpl<?>> findExclusiveJobs(Execution processInstance) {
- // query definition can be found at the bottom of resource jbpm.pvm.job.hbm.xml
Query query = session.getNamedQuery("findExclusiveJobs");
query.setTimestamp("now", Clock.getCurrentTime());
query.setEntity("processInstance", processInstance);
@@ -51,7 +49,6 @@
}
public JobImpl<?> findFirstDueJob() {
- // query definition can be found at the bottom of resource jbpm.pvm.job.hbm.xml
Query query = session.getNamedQuery("findFirstDueJob");
query.setMaxResults(1);
return (JobImpl<?>) query.uniqueResult();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -37,6 +37,7 @@
import org.jbpm.api.session.PvmDbSession;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
+import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.svc.DefaultCommandService;
@@ -264,6 +265,62 @@
}
}
+ public void cascadeExecutionSuspend(ExecutionImpl execution) {
+ // cascade suspend to jobs
+ Query query = session.createQuery(
+ "select job " +
+ "from "+JobImpl.class.getName()+" as job " +
+ "where job.execution = :execution " +
+ " and job.state != '"+JobImpl.STATE_SUSPENDED+"' "
+ );
+ query.setEntity("execution", execution);
+ List<JobImpl> jobs = query.list();
+ for (JobImpl job: jobs) {
+ job.suspend();
+ }
+
+ // cascade suspend to tasks
+ query = session.createQuery(
+ "select task " +
+ "from "+TaskImpl.class.getName()+" as task " +
+ "where task.execution = :execution " +
+ " and task.state != '"+TaskImpl.STATE_SUSPENDED+"' "
+ );
+ query.setEntity("execution", execution);
+ List<TaskImpl> tasks = query.list();
+ for (TaskImpl task: tasks) {
+ task.suspend();
+ }
+ }
+
+ public void cascadeExecutionResume(ExecutionImpl execution) {
+ // cascade suspend to jobs
+ Query query = session.createQuery(
+ "select job " +
+ "from "+JobImpl.class.getName()+" as job " +
+ "where job.execution = :execution " +
+ " and job.state = '"+TaskImpl.STATE_SUSPENDED+"' "
+ );
+ query.setEntity("execution", execution);
+ List<JobImpl> jobs = query.list();
+ for (JobImpl job: jobs) {
+ job.resume();
+ }
+
+ // cascade suspend to tasks
+ query = session.createQuery(
+ "select task " +
+ "from "+TaskImpl.class.getName()+" as task " +
+ "where task.execution = :execution " +
+ " and task.state = '"+TaskImpl.STATE_SUSPENDED+"' "
+ );
+ query.setEntity("execution", execution);
+ List<TaskImpl> tasks = query.list();
+ for (TaskImpl task: tasks) {
+ task.resume();
+ }
+ }
+
private List<TaskImpl> findTasks(String processInstanceId) {
Query query = session.createQuery(
"select task " +
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernateTaskDbSession.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -28,7 +28,6 @@
import org.jbpm.api.session.TaskDbSession;
import org.jbpm.api.task.Task;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.task.LifeCycle;
import org.jbpm.pvm.internal.task.SwimlaneImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
import org.jbpm.pvm.internal.util.Clock;
@@ -67,7 +66,6 @@
public Task createTask() {
TaskImpl task = newTask();
task.setCreate(Clock.getCurrentTime());
- task.setState(LifeCycle.initialise(task));
return task;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -13,6 +13,11 @@
private static final long serialVersionUID = 1L;
// private static final DateFormat dateFormat = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss,SSS");
+ public static final String STATE_WAITING = "waiting";
+ public static final String STATE_ACQUIRED = "acquired";
+ public static final String STATE_ERROR = "error";
+ public static final String STATE_SUSPENDED = "suspended";
+
protected long dbid;
protected int dbversion;
@@ -20,8 +25,8 @@
* for async messages, this dueDate should be set to null. */
protected Date dueDate = null;
- /** suspended jobs will not execute. */
- protected boolean isSuspended;
+ /** job state. */
+ protected String state;
/** the execution (if any) for this jobImpl */
protected ExecutionImpl execution;
@@ -62,6 +67,30 @@
this.processInstance = execution.getProcessInstance();
}
+ public void acquire(String lockOwner, Date lockExpirationTime) {
+ this.state = STATE_ACQUIRED;
+ this.lockOwner = lockOwner;
+ this.lockExpirationTime = lockExpirationTime;
+ }
+ public void release() {
+ this.state = STATE_WAITING;
+ this.lockOwner = null;
+ this.lockExpirationTime = null;
+ }
+ public void setRetries(int retries) {
+ this.retries = retries;
+ if (this.retries==0) {
+ this.state = STATE_ERROR;
+ }
+ }
+ public void suspend() {
+ this.state = STATE_SUSPENDED;
+ }
+ public void resume() {
+ this.state = STATE_WAITING;
+ }
+
+
public long getDbid() {
return dbid;
}
@@ -71,9 +100,6 @@
public String getLockOwner() {
return lockOwner;
}
- public boolean isSuspended() {
- return isSuspended;
- }
public Date getDueDate() {
return dueDate;
}
@@ -92,24 +118,18 @@
public ExecutionImpl getExecution() {
return execution;
}
- public void setException(String exception) {
- this.exception = exception;
- }
public void setExclusive(boolean isExclusive) {
this.isExclusive = isExclusive;
}
public void setLockOwner(String jobExecutorName) {
this.lockOwner = jobExecutorName;
}
- public void setRetries(int retries) {
- this.retries = retries;
- }
- public void setSuspended(boolean isSuspended) {
- this.isSuspended = isSuspended;
- }
public ExecutionImpl getProcessInstance() {
return processInstance;
}
+ public void setException(String exception) {
+ this.exception = exception;
+ }
public Date getLockExpirationTime() {
return lockExpirationTime;
}
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-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -136,8 +136,7 @@
if (log.isDebugEnabled()) log.debug("rescheduled "+this+" for "+formatDueDate(dueDate));
// release the lock on the timer
- setLockOwner(null);
- setLockExpirationTime(null);
+ release();
// notify the jobExecutor at the end of the transaction
JobExecutor jobExecutor = environment.get(JobExecutor.class);
@@ -153,7 +152,7 @@
return deleteThisJob;
}
-
+
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("timer[");
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -72,8 +72,7 @@
for (JobImpl<?> acquiredJob: acquiredJobs) {
long lockExpirationTime = System.currentTimeMillis()+jobExecutor.getLockMillis();
log.trace("trying to obtain a lock for '"+acquiredJob+"' with exp "+timeFormat.format(new Date(lockExpirationTime)));
- acquiredJob.setLockExpirationTime(new Date(lockExpirationTime));
- acquiredJob.setLockOwner(jobExecutor.getName());
+ acquiredJob.acquire(jobExecutor.getName(), new Date(lockExpirationTime));
acquiredJobDbids.add(acquiredJob.getDbid());
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -26,7 +26,6 @@
import javax.transaction.Synchronization;
-import org.hibernate.Session;
import org.jbpm.api.JbpmException;
import org.jbpm.api.cmd.Command;
import org.jbpm.api.cmd.CommandService;
@@ -83,11 +82,9 @@
// decrement the number of retries
int decrementedRetries = job.getRetries()-1;
log.debug("decrementing retries to "+decrementedRetries+" for "+job);
+ job.release();
job.setRetries(decrementedRetries);
- job.setException(sw.toString());
- log.debug("unlocking "+job);
- job.setLockOwner(null);
- job.setLockExpirationTime(null);
+ job.setException(sw.toString());
// notify the job executor after the transaction is completed
Transaction transaction = environment.get(Transaction.class);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -52,8 +52,10 @@
import org.jbpm.api.model.OpenExecution;
import org.jbpm.api.model.Transition;
import org.jbpm.api.session.MessageSession;
+import org.jbpm.api.session.PvmDbSession;
import org.jbpm.api.session.RepositorySession;
import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.hibernate.HibernatePvmDbSession;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.HistorySession;
import org.jbpm.pvm.internal.history.events.ActivityEnd;
@@ -70,6 +72,7 @@
import org.jbpm.pvm.internal.model.op.ProceedToDestination;
import org.jbpm.pvm.internal.model.op.Signal;
import org.jbpm.pvm.internal.model.op.TakeTransition;
+import org.jbpm.pvm.internal.repository.RepositorySessionImpl;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.pvm.internal.util.Priority;
@@ -355,6 +358,10 @@
if (isSuspended()) {
throw new JbpmException(toString()+" is suspended");
}
+ HibernatePvmDbSession hibernatePvmDbSession = Environment.getFromCurrent(HibernatePvmDbSession.class, false);
+ if (hibernatePvmDbSession!=null) {
+ hibernatePvmDbSession.cascadeExecutionSuspend(this);
+ }
lock(STATE_SUSPENDED);
}
@@ -363,6 +370,10 @@
if (! isSuspended()) {
throw new JbpmException(toString()+" is not suspended");
}
+ HibernatePvmDbSession hibernatePvmDbSession = Environment.getFromCurrent(HibernatePvmDbSession.class, false);
+ if (hibernatePvmDbSession!=null) {
+ hibernatePvmDbSession.cascadeExecutionResume(this);
+ }
unlock();
}
@@ -1202,4 +1213,7 @@
public void setHistoryActivityStart(Date historyActivityStart) {
this.historyActivityStart = historyActivityStart;
}
+ public String getProcessDefinitionId() {
+ return processDefinitionId;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -57,6 +57,7 @@
protected String key;
protected String nameLike;
protected String name;
+ protected boolean suspended;
protected Long deploymentDbid;
public ProcessDefinitionQueryImpl(CommandService commandService) {
@@ -102,15 +103,21 @@
hql.append(" as keyProperty, ");
hql.append(DeploymentProperty.class.getName());
hql.append(" as versionProperty ");
-
- appendWhereClause("idProperty.key = 'id'", hql);
+
+ if (suspended) {
+ appendWhereClause("deployment.state = '"+DeploymentImpl.STATE_SUSPENDED+"'", hql);
+ } else {
+ appendWhereClause("deployment.state != '"+DeploymentImpl.STATE_SUSPENDED+"'", hql);
+ }
+
+ appendWhereClause("idProperty.key = '"+DeploymentImpl.KEY_PROCESS_DEFINITION_ID+"'", hql);
appendWhereClause("idProperty.deployment = deployment ", hql);
- appendWhereClause("keyProperty.key = 'key' ", hql);
+ appendWhereClause("keyProperty.key = '"+DeploymentImpl.KEY_PROCESS_DEFINITION_KEY+"' ", hql);
appendWhereClause("keyProperty.objectName = idProperty.objectName ", hql);
appendWhereClause("keyProperty.deployment = deployment ", hql);
- appendWhereClause("versionProperty.key = 'version' ", hql);
+ appendWhereClause("versionProperty.key = '"+DeploymentImpl.KEY_PROCESS_DEFINITION_VERSION+"' ", hql);
appendWhereClause("versionProperty.objectName = idProperty.objectName ", hql);
appendWhereClause("versionProperty.deployment = deployment ", hql);
@@ -159,6 +166,11 @@
this.key = key;
return this;
}
+
+ public ProcessDefinitionQuery suspended() {
+ this.suspended = true;
+ return this;
+ }
public ProcessDefinitionQuery nameLike(String name) {
this.nameLike = name;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessInstanceQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessInstanceQueryImpl.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessInstanceQueryImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -39,6 +39,7 @@
protected String processDefinitionId;
protected String processInstanceId;
+ protected boolean suspended;
public ProcessInstanceQueryImpl(CommandService commandService) {
super(commandService);
@@ -61,6 +62,12 @@
appendWhereClause("processInstance.parent is null ", hql);
+ if (suspended) {
+ appendWhereClause("processInstance.state = '"+ExecutionImpl.STATE_SUSPENDED+"' ", hql);
+ } else {
+ appendWhereClause("processInstance.state != '"+ExecutionImpl.STATE_SUSPENDED+"' ", hql);
+ }
+
if (processInstanceId!=null) {
appendWhereClause("processInstance.processInstance.id = '"+processInstanceId+"' ", hql);
}
@@ -87,11 +94,6 @@
return this;
}
- public ProcessInstanceQuery processDefinitionId(String processDefinitionId) {
- this.processDefinitionId = processDefinitionId;
- return this;
- }
-
public ProcessInstanceQuery page(int firstResult, int maxResults) {
this.page = new Page(firstResult, maxResults);
return this;
@@ -101,4 +103,14 @@
this.processInstanceId = processInstanceId;
return this;
}
+
+ public ProcessInstanceQuery processDefinitionId(String processDefinitionId) {
+ this.processDefinitionId = processDefinitionId;
+ return this;
+ }
+
+ public ProcessInstanceQuery suspended() {
+ this.suspended = true;
+ return this;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -37,8 +37,9 @@
import org.jbpm.api.Deployment;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.client.ClientProcessDefinition;
import org.jbpm.api.cmd.CommandService;
+import org.jbpm.api.env.Environment;
+import org.jbpm.api.session.RepositorySession;
import org.jbpm.pvm.internal.cmd.DeployCmd;
import org.jbpm.pvm.internal.lob.Lob;
import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
@@ -57,9 +58,17 @@
*/
public class DeploymentImpl extends ProblemList implements Deployment {
+ public static final String STATE_ACTIVE = "active";
+ public static final String STATE_SUSPENDED = "suspended";
+
+ public static final String KEY_PROCESS_DEFINITION_ID = "pdid";
+ public static final String KEY_PROCESS_DEFINITION_KEY = "pdkey";
+ public static final String KEY_PROCESS_DEFINITION_VERSION = "pdversion";
+
protected long dbid;
protected String name;
protected long timestamp;
+ protected String state = STATE_ACTIVE;
protected Map<String, Lob> resources;
protected CommandService commandService;
@@ -164,8 +173,34 @@
}
objects.put(objectName, object);
}
+
+ // object properties ////////////////////////////////////////////////////////
+
+ public void setProcessDefinitionId(String processDefinitionName, String processDefinitionId) {
+ setObjectProperty(processDefinitionName, KEY_PROCESS_DEFINITION_ID, processDefinitionId);
+ }
+
+ public String getProcessDefinitionId(String processDefinitionName) {
+ return (String) getObjectProperty(processDefinitionName, KEY_PROCESS_DEFINITION_ID);
+ }
- public void addObjectProperty(String objectName, String key, Object value) {
+ public void setProcessDefinitionKey(String processDefinitionName, String processDefinitionKey) {
+ setObjectProperty(processDefinitionName, KEY_PROCESS_DEFINITION_KEY, processDefinitionKey);
+ }
+
+ public String getProcessDefinitionKey(String processDefinitionName) {
+ return (String) getObjectProperty(processDefinitionName, KEY_PROCESS_DEFINITION_KEY);
+ }
+
+ public void setProcessDefinitionVersion(String processDefinitionName, Long processDefinitionVersion) {
+ setObjectProperty(processDefinitionName, KEY_PROCESS_DEFINITION_VERSION, processDefinitionVersion);
+ }
+
+ public Long getProcessDefinitionVersion(String processDefinitionName) {
+ return (Long) getObjectProperty(processDefinitionName, KEY_PROCESS_DEFINITION_VERSION);
+ }
+
+ public void setObjectProperty(String objectName, String key, Object value) {
if (objectProperties==null) {
objectProperties = new HashSet<DeploymentProperty>();
}
@@ -187,6 +222,19 @@
return null;
}
+ public Set<String> getProcessDefinitionIds() {
+ Set<String> processDefinitionIds = new HashSet<String>();
+ if (objectProperties!=null) {
+ for (DeploymentProperty deploymentProperty: objectProperties) {
+ if (KEY_PROCESS_DEFINITION_ID.equals(deploymentProperty.getKey())) {
+ String processDefinitionId = deploymentProperty.getStringValue();
+ processDefinitionIds.add(processDefinitionId);
+ }
+ }
+ }
+ return processDefinitionIds;
+ }
+
public boolean hasObjectProperties(String objectName) {
if (objectProperties!=null) {
for (DeploymentProperty deploymentProperty: objectProperties) {
@@ -197,7 +245,33 @@
}
return false;
}
+
+ public void suspend() {
+ if (isSuspended()) {
+ throw new JbpmException("deployment is already suspended");
+ }
+ RepositorySessionImpl repositorySession = Environment.getFromCurrent(RepositorySessionImpl.class, false);
+ if (repositorySession!=null) {
+ repositorySession.cascadeDeploymentSuspend(this);
+ }
+ state = STATE_SUSPENDED;
+ }
+ public void resume() {
+ if (!isSuspended()) {
+ throw new JbpmException("deployment is not suspended");
+ }
+ RepositorySessionImpl repositorySession = Environment.getFromCurrent(RepositorySessionImpl.class, false);
+ if (repositorySession!=null) {
+ repositorySession.cascadeDeploymentResume(this);
+ }
+ state = STATE_ACTIVE;
+ }
+
+ public boolean isSuspended() {
+ return STATE_SUSPENDED.equals(state);
+ }
+
protected Object writeReplace() throws ObjectStreamException {
commandService = null;
return this;
@@ -226,9 +300,4 @@
this.timestamp = timestamp;
return this;
}
-
-
- public Deployment addProcessDefinition(ClientProcessDefinition processDefinition) {
- throw new UnsupportedOperationException("implement me");
- }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCache.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -31,5 +31,6 @@
void set(long deploymentdbid, Map<String, Object> deployedObjects);
Object get(long deploymentDbid, String objectName);
+ void remove(long deploymentDbid);
void clear();
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryCacheImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -56,6 +56,12 @@
}
}
+ public void remove(long deploymentDbid) {
+ if (deployments!=null) {
+ deployments.remove(deploymentDbid);
+ }
+ }
+
public void clear() {
deployments = new HashMap<Long, Map<String,Object>>();
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -31,6 +31,8 @@
import org.jbpm.pvm.internal.cmd.DeleteDeploymentCmd;
import org.jbpm.pvm.internal.cmd.GetActivityCoordinates;
import org.jbpm.pvm.internal.cmd.GetResourceAsStreamCmd;
+import org.jbpm.pvm.internal.cmd.ResumeDeploymentCmd;
+import org.jbpm.pvm.internal.cmd.SuspendDeploymentCmd;
import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
/**
@@ -44,6 +46,14 @@
return new DeploymentImpl(commandService);
}
+ public void suspendDeployment(long deploymentDbid) {
+ commandService.execute(new SuspendDeploymentCmd(deploymentDbid));
+ }
+
+ public void resumeDeployment(long deploymentDbid) {
+ commandService.execute(new ResumeDeploymentCmd(deploymentDbid));
+ }
+
public void deleteDeployment(long deploymentDbid) {
commandService.execute(new DeleteDeploymentCmd(deploymentDbid));
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -23,7 +23,10 @@
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import org.hibernate.Query;
import org.hibernate.Session;
import org.jbpm.api.Deployment;
import org.jbpm.api.JbpmException;
@@ -33,6 +36,7 @@
import org.jbpm.api.client.ClientProcessDefinition;
import org.jbpm.api.session.RepositorySession;
import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
/**
@@ -59,13 +63,58 @@
log.info("errors during deployment of "+deployment+": "+jbpmException.getMessage());
throw jbpmException;
} else {
-
repositoryCache.set(deploymentImpl.getDbid(), deploymentImpl.getObjects());
}
return deploymentImpl.getDbid();
}
+
+ public void cascadeDeploymentSuspend(DeploymentImpl deployment) {
+ // cascade to all executions in this deployment
+ Set<String> processDefinitionIds = deployment.getProcessDefinitionIds();
+ if (!processDefinitionIds.isEmpty()) {
+ Query query = session.createQuery(
+ "select execution " +
+ "from "+ExecutionImpl.class.getName()+" as execution " +
+ "where execution.processDefinitionId in (:processDefinitionIds) " +
+ " and execution.state != '"+ExecutionImpl.STATE_SUSPENDED+"'"
+ );
+ query.setParameterList("processDefinitionIds", processDefinitionIds);
+ List<ExecutionImpl> executions = query.list();
+ for (ExecutionImpl execution: executions) {
+ execution.suspend();
+ }
+ }
+
+ // TODO cleaning this cache should actually be done as a synchronization
+ // after the transaction. If a concurrent transaction for an execution
+ // starts between clearing the cache and committing the transaction, then
+ // that transaction could potentially re-initialize the process definition
+ // in the cache.
+ repositoryCache.remove(deployment.getDbid());
+ }
+
+ public void cascadeDeploymentResume(DeploymentImpl deployment) {
+ // cascade to all executions in this deployment
+ Set<String> processDefinitionIds = deployment.getProcessDefinitionIds();
+ if (!processDefinitionIds.isEmpty()) {
+ Query query = session.createQuery(
+ "select execution " +
+ "from "+ExecutionImpl.class.getName()+" as execution " +
+ "where execution.processDefinitionId in (:processDefinitionIds) " +
+ " and execution.state = '"+ExecutionImpl.STATE_SUSPENDED+"'"
+ );
+ query.setParameterList("processDefinitionIds", processDefinitionIds);
+ List<ExecutionImpl> executions = query.list();
+ for (ExecutionImpl execution: executions) {
+ execution.resume();
+ }
+ }
+
+ deploy(deployment);
+ }
+
public DeploymentImpl getDeployment(long deploymentDbid) {
return (DeploymentImpl) session.get(DeploymentImpl.class, deploymentDbid);
}
@@ -78,10 +127,11 @@
} else {
log.trace("loading deployment "+deploymentDbid+" from db");
DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, deploymentDbid);
+ if (deployment.isSuspended()) {
+ throw new JbpmException("deployment "+deploymentDbid+" is suspended");
+ }
deploy(deployment);
-
object = repositoryCache.get(deploymentDbid, objectName);
-
if (object==null) {
throw new JbpmException("deployment "+deploymentDbid+" doesn't contain object "+objectName);
}
@@ -121,7 +171,7 @@
DeploymentProperty deploymentProperty = (DeploymentProperty) session.createQuery(
"select deploymentProperty " +
"from "+DeploymentProperty.class.getName()+" as deploymentProperty " +
- "where deploymentProperty.key = 'id' " +
+ "where deploymentProperty.key = '"+DeploymentImpl.KEY_PROCESS_DEFINITION_ID+"' " +
" and deploymentProperty.stringValue = '"+processDefinitionId+"' "
).setMaxResults(1).uniqueResult();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -83,7 +83,7 @@
Activity activity = lifeCycleProcess.getActivity(state);
lifeCycleExecution.setActivity((ActivityImpl) activity);
lifeCycleExecution.signal(eventName);
- task.state = lifeCycleExecution.getActivity().getName();
+ task.setState(lifeCycleExecution.getActivity().getName());
}
public IdGenerator getIdGenerator() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -62,7 +62,10 @@
// private static Log log = Log.getLog(TaskImpl.class.getName());
- private static final TaskHandler DEFAULT_TASK_HANDLER = new TaskHandler();
+ private static final TaskHandler DEFAULT_TASK_HANDLER = new TaskHandler();
+
+ public static final String STATE_SUSPENDED = "suspended";
+ public static final String STATE_ACTIVE = "active";
protected String id;
protected String name;
@@ -82,7 +85,7 @@
protected int priority = Priority.NORMAL;
- protected String state;
+ protected String state = STATE_ACTIVE;
protected String taskDefinitionName;
protected TaskDefinitionImpl taskDefinition;
@@ -493,4 +496,9 @@
public void setForm(String form) {
this.form = form;
}
+
+ public void suspend() {
+ }
+ public void resume() {
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -144,6 +144,8 @@
}
}
+ appendWhereClause("task.state != '"+TaskImpl.STATE_SUSPENDED+"' ", hql);
+
if (assignee == UNASSIGNED) {
appendWhereClause("task.assignee is null ", hql);
} else if (assignee != null) {
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-13 15:15:51 UTC (rev 4807)
@@ -217,7 +217,7 @@
<version name="dbversion" column="DBVERSION_" />
<property name="dueDate" column="DUEDATE_" type="timestamp" index="IDX_JOBDUEDATE" />
- <property name="isSuspended" column="ISSUSPENDED_" />
+ <property name="state" column="STATE_" />
<property name="isExclusive" column="ISEXCLUSIVE_" />
<property name="lockOwner" column="LOCKOWNER_" />
<property name="lockExpirationTime" column="LOCKEXPTIME_" index="IDX_JOBLOCKEXP" />
@@ -307,6 +307,8 @@
)
and
( job.retries > 0 )
+ and
+ ( job.state != 'suspended' )
)
order by job.dueDate asc
]]>
@@ -320,6 +322,7 @@
and job.processInstance = :processInstance
and job.isExclusive = true
and job.retries > 0
+ and job.state != 'suspended'
and ( (job.dueDate is null)
or (job.dueDate <= :now)
)
@@ -333,6 +336,7 @@
from org.jbpm.pvm.internal.job.JobImpl as job
where job.lockOwner is null
and job.retries > 0
+ and job.state != 'suspended'
order by job.dueDate asc
]]>
</query>
@@ -343,6 +347,7 @@
select execution
from org.jbpm.pvm.internal.model.ExecutionImpl as execution
where execution.id = :id
+ and execution.state != 'suspended'
]]>
</query>
@@ -352,6 +357,7 @@
from org.jbpm.pvm.internal.model.ExecutionImpl as processInstance
where processInstance.id = :processInstanceId
and processInstance.parent is null
+ and processInstance.state != 'suspended'
]]>
</query>
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.repository.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.repository.hbm.xml 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.repository.hbm.xml 2009-05-13 15:15:51 UTC (rev 4807)
@@ -14,6 +14,7 @@
<property name="name" type="text" column="NAME_" />
<property name="timestamp" column="TIMESTAMP_" />
+ <property name="state" column="STATE_" />
<map name="resources" cascade="all-delete-orphan">
<key foreign-key="FK_LOB_DEPLOYMENT">
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml 2009-05-13 09:44:37 UTC (rev 4806)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.task.hbm.xml 2009-05-13 15:15:51 UTC (rev 4807)
@@ -76,6 +76,7 @@
<property name="id" column="ID_" unique="true" />
<property name="name" column="NAME_"/>
<property name="description" column="DESCR_"/>
+ <property name="state" column="STATE_"/>
<property name="assignee" column="ASSIGNEE_"/>
<property name="form" column="FORM_"/>
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java 2009-05-13 15:15:51 UTC (rev 4807)
@@ -0,0 +1,152 @@
+/*
+ * 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.deploy;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SuspendDeploymentTest extends JbpmTestCase {
+
+ public void testSuspendDeployment() {
+ deployJpdlXmlString(
+ "<process name='claim'>" +
+ " <start>" +
+ " <transition to='c' />" +
+ " </start>" +
+ " <state name='c' />" +
+ "</process>"
+ );
+
+ long deploymentHireDbid = deployJpdlXmlString(
+ "<process name='hire'>" +
+ " <start>" +
+ " <transition to='h' />" +
+ " </start>" +
+ " <state name='h' />" +
+ "</process>"
+ );
+
+ deployJpdlXmlString(
+ "<process name='fire'>" +
+ " <start>" +
+ " <transition to='f' />" +
+ " </start>" +
+ " <state name='f' />" +
+ "</process>"
+ );
+
+ Set<String> expectedProcessNames = new HashSet<String>();
+ expectedProcessNames.add("claim");
+ expectedProcessNames.add("hire");
+ expectedProcessNames.add("fire");
+
+ List<ProcessDefinition> processDefinitions = repositoryService
+ .createProcessDefinitionQuery()
+ .list();
+
+ assertEquals(expectedProcessNames, getProcessDefinitionNames(processDefinitions));
+
+ executionService.startProcessInstanceByKey("claim");
+ executionService.startProcessInstanceByKey("claim");
+
+ executionService.startProcessInstanceByKey("hire");
+ executionService.startProcessInstanceByKey("hire");
+
+ executionService.startProcessInstanceByKey("fire");
+ executionService.startProcessInstanceByKey("fire");
+
+ List<Execution> processInstances = executionService
+ .createProcessInstanceQuery()
+ .list();
+
+ assertEquals(2, countProcessInstancesFor(processInstances, "claim"));
+ assertEquals(2, countProcessInstancesFor(processInstances, "hire"));
+ assertEquals(2, countProcessInstancesFor(processInstances, "fire"));
+ assertEquals(6, processInstances.size());
+
+
+ repositoryService.suspendDeployment(deploymentHireDbid);
+
+
+ expectedProcessNames.remove("hire");
+
+ processDefinitions = repositoryService
+ .createProcessDefinitionQuery()
+ .list();
+
+ assertEquals(expectedProcessNames, getProcessDefinitionNames(processDefinitions));
+
+ processInstances = executionService
+ .createProcessInstanceQuery()
+ .list();
+
+ assertEquals(2, countProcessInstancesFor(processInstances, "claim"));
+ assertEquals(2, countProcessInstancesFor(processInstances, "fire"));
+ assertEquals(4, processInstances.size());
+
+ repositoryService.resumeDeployment(deploymentHireDbid);
+
+ expectedProcessNames.add("hire");
+
+ processDefinitions = repositoryService
+ .createProcessDefinitionQuery()
+ .list();
+
+ assertEquals(expectedProcessNames, getProcessDefinitionNames(processDefinitions));
+
+ processInstances = executionService
+ .createProcessInstanceQuery()
+ .list();
+
+ assertEquals(2, countProcessInstancesFor(processInstances, "claim"));
+ assertEquals(2, countProcessInstancesFor(processInstances, "hire"));
+ assertEquals(2, countProcessInstancesFor(processInstances, "fire"));
+ assertEquals(6, processInstances.size());
+ }
+
+ int countProcessInstancesFor(List<Execution> processInstances, String processDefinitionKey) {
+ int count = 0;
+ for (Execution processInstance: processInstances) {
+ if (processInstance.getProcessDefinitionId().startsWith(processDefinitionKey)) {
+ count++;
+ }
+ }
+ return count;
+ }
+
+ Object getProcessDefinitionNames(List<ProcessDefinition> processDefinitions) {
+ Set<String> processNames = new HashSet<String>();
+ for (ProcessDefinition processDefinition: processDefinitions) {
+ processNames.add(processDefinition.getName());
+ }
+ return processNames;
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
JBoss JBPM SVN: r4806 - jbpm4/trunk/modules/devguide/src/main/docbook/en.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-13 05:44:37 -0400 (Wed, 13 May 2009)
New Revision: 4806
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
Log:
added note in the dev guide that we might switch from hibernate to jpa in the future
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml 2009-05-13 07:36:19 UTC (rev 4805)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml 2009-05-13 09:44:37 UTC (rev 4806)
@@ -8,6 +8,7 @@
<!ENTITY ch05-ImplementingBasicActivities SYSTEM "modules/ch05-ImplementingBasicActivities.xml">
<!ENTITY ch06-ProcessAnatomy SYSTEM "modules/ch06-ProcessAnatomy.xml">
<!ENTITY ch07-ImplementingAdvancedActivities SYSTEM "modules/ch07-ImplementingAdvancedActivities.xml">
+ <!ENTITY ch08-Persistence SYSTEM "modules/ch08-Persistence.xml">
<!ENTITY ch10-SoftwareLogging SYSTEM "modules/ch10-SoftwareLogging.xml">
<!ENTITY ch11-History SYSTEM "modules/ch11-History.xml">
]>
@@ -27,6 +28,7 @@
&ch05-ImplementingBasicActivities;
&ch06-ProcessAnatomy;
&ch07-ImplementingAdvancedActivities;
+ &ch08-Persistence;
&ch10-SoftwareLogging;
&ch11-History;
15 years, 4 months