JBoss JBPM SVN: r6219 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin.
by do-not-reply@jboss.org
Author: kukeltje
Date: 2010-03-10 14:31:36 -0500 (Wed, 10 Mar 2010)
New Revision: 6219
Removed:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/fullynested.jpdl.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/weirdForkAndJoin.jpdl.xml
Modified:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/JBPM2581ForkAndJoinTest.java
Log:
xml of tests embedded JBPM-2581
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/JBPM2581ForkAndJoinTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/JBPM2581ForkAndJoinTest.java 2010-03-09 20:22:30 UTC (rev 6218)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/JBPM2581ForkAndJoinTest.java 2010-03-10 19:31:36 UTC (rev 6219)
@@ -1,26 +1,75 @@
package org.jbpm.test.activity.forkjoin;
+import java.util.Collection;
import java.util.List;
import org.jbpm.api.Execution;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.ProcessDefinitionQuery;
+import org.jbpm.api.model.Activity;
+import org.jbpm.api.model.OpenExecution;
import org.jbpm.api.task.Task;
+import org.jbpm.pvm.internal.model.OpenProcessDefinition;
import org.jbpm.test.JbpmTestCase;
public class JBPM2581ForkAndJoinTest extends JbpmTestCase {
- String deploymentId;
+ String deploymentId;
- public void testFullyNested() {
+ public void testFullyNested() {
- deploymentId = repositoryService
- .createDeployment()
- .addResourceFromClasspath(
- "org/jbpm/test/activity/forkjoin/fullynested.jpdl.xml")
- .deploy();
-
+ deployJpdlXmlString(" <process name='FullyNested' xmlns='http://jbpm.org/4.3/jpdl'>" +
+ " <start name='start1'>" +
+ " <transition to='fork2'/>" +
+ " </start>" +
+ " <end name='end1'/>" +
+ " " +
+ " <task assignee='otto' name='task2'>" +
+ " <transition to='join1'/>" +
+ " </task>" +
+ " <task assignee='otto' name='task3'>" +
+ " <transition to='join2'/>" +
+ " </task>" +
+ " <task assignee='otto' name='task8'>" +
+ " <transition to='end1'/>" +
+ " </task>" +
+ " <task assignee='otto' name='task9'>" +
+ " <transition to='join2'/>" +
+ " </task>" +
+ " <task assignee='otto' name='task1'>" +
+ " <transition to='join1'/>" +
+ " </task>" +
+ " <fork name='fork1'>" +
+ " <transition to='task1'/>" +
+ " <transition to='task2'/>" +
+ " </fork>" +
+ " <join name='join1'>" +
+ " <transition to='task9'/>" +
+ " </join>" +
+ " <join name='join2'>" +
+ " <transition to='task8'/>" +
+ " </join>" +
+ " <fork name='fork2'>" +
+ " <transition to='task3'/>" +
+ " <transition to='fork1'/>" +
+ " </fork>" +
+ "</process> ");
+
Execution execution = executionService
.startProcessInstanceByKey("FullyNested");
+ OpenExecution oe = (OpenExecution) execution;
+ Collection< ? > ec = oe.getExecutions();
+ for (Object object : ec) {
+ System.out.println(((OpenExecution) object).getActivity().getName());
+ }
+
+ ProcessDefinitionQuery pdq = repositoryService.createProcessDefinitionQuery().processDefinitionId(oe.getProcessDefinitionId());
+
+ ProcessDefinition pd = pdq.uniqueResult();
+ System.out.println(((OpenProcessDefinition) pd).getActivities());
+
+
assertActivitiesActive(execution.getId(), "task3", "task1", "task2");
List<Task> taskList = taskService.findPersonalTasks("otto");
@@ -51,44 +100,65 @@
taskService.completeTask(task.getId());
assertProcessInstanceEnded(execution.getId());
-
- repositoryService.deleteDeploymentCascade(deploymentId);
+
}
-
- public void testWeirdNested() {
-
- deploymentId = repositoryService
- .createDeployment()
- .addResourceFromClasspath(
- "org/jbpm/test/activity/forkjoin/weirdForkAndJoin.jpdl.xml")
- .deploy();
+ public void testWeirdNested() {
- Execution execution = executionService
- .startProcessInstanceByKey("WeirdNested");
+ deployJpdlXmlString("<process name=\"WeirdNested\" xmlns=\"http://jbpm.org/4.3/jpdl\">" +
+ " <start name=\"start1\">" +
+ " <transition name=\"to fork2\" to=\"fork2\"/>" +
+ " </start>" +
+ "" +
+ " <fork name=\"fork2\">" +
+ " <transition name=\"to task1\" to=\"task1\"/>" +
+ " <transition name=\"to task2\" to=\"task2\"/>" +
+ " </fork>" +
+ "" +
+ " <task assignee=\"otto\" name=\"task1\">" +
+ " <transition name=\"to fork1\" to=\"fork1\"/>" +
+ " </task>" +
+ " <task assignee=\"otto\" name=\"task2\">" +
+ " <transition name=\"to join1-via2\" to=\"join1\"/>" +
+ " </task>" +
+ " " +
+ " <fork name=\"fork1\">" +
+ " <transition name=\"to task3\" to=\"task3\"/>" +
+ " <transition name=\"to join1-via1\" to=\"join1\"/>" +
+ " </fork>" +
+ "" +
+ " <join name=\"join1\">" +
+ " <transition name=\"to task4\" to=\"task4\"/>" +
+ " </join>" +
+ "" +
+ " <task assignee=\"otto\" name=\"task3\"/>" +
+ " <task assignee=\"otto\" name=\"task4\"/>" +
+ "" +
+ "</process>");
- List<Task> taskList = taskService.findPersonalTasks("otto");
- assertEquals(2, taskList.size());
- assertActivitiesActive(execution.getId(), "task1", "task2");
-
- Task task1 = getTask(taskList, "task1");
- taskService.completeTask(task1.getId());
-
- taskList = taskService.findPersonalTasks("otto");
-
- assertEquals(2, taskList.size());
- assertActivitiesActive(execution.getId(), "task3", "task2");
-
- Task task2 = getTask(taskList, "task2");
- taskService.completeTask(task2.getId());
-
- taskList = taskService.findPersonalTasks("otto");
-
- assertEquals(2, taskList.size());
- assertActivitiesActive(execution.getId(), "task3", "task4");
-
- assertProcessInstanceActive(execution.getId());
-
- repositoryService.deleteDeploymentCascade(deploymentId);
- }
+ Execution execution = executionService.startProcessInstanceByKey("WeirdNested");
+ List<Task> taskList = taskService.findPersonalTasks("otto");
+ assertEquals(2, taskList.size());
+ assertActivitiesActive(execution.getId(), "task1", "task2");
+
+ Task task1 = getTask(taskList, "task1");
+ taskService.completeTask(task1.getId());
+
+ taskList = taskService.findPersonalTasks("otto");
+
+ assertEquals(2, taskList.size());
+ assertActivitiesActive(execution.getId(), "task3", "task2");
+
+ Task task2 = getTask(taskList, "task2");
+ taskService.completeTask(task2.getId());
+
+ taskList = taskService.findPersonalTasks("otto");
+
+ assertEquals(2, taskList.size());
+ assertActivitiesActive(execution.getId(), "task3", "task4");
+
+ assertProcessInstanceActive(execution.getId());
+
+ }
+
}
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/fullynested.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/fullynested.jpdl.xml 2010-03-09 20:22:30 UTC (rev 6218)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/fullynested.jpdl.xml 2010-03-10 19:31:36 UTC (rev 6219)
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="FullyNested" xmlns="http://jbpm.org/4.3/jpdl">
-
- <start g="24,132,48,48" name="start1">
- <transition to="fork2"/>
- </start>
- <end g="768,132,48,48" name="end1"/>
-
- <task assignee="otto" g="264,192,97,49" name="task2">
- <transition g="409,217:" to="join1"/>
- </task>
- <task assignee="otto" g="72,264,97,49" name="task3">
- <transition g="610,287:" to="join2"/>
- </task>
- <task assignee="otto" g="660,132,85,49" name="task8">
- <transition to="end1"/>
- </task>
- <task assignee="otto" g="456,132,92,52" name="task9">
- <transition to="join2"/>
- </task>
- <task assignee="otto" g="264,48,97,51" name="task1">
- <transition g="408,70:" to="join1"/>
- </task>
- <fork g="204,132,48,48" name="fork1">
- <transition g="228,73:" to="task1"/>
- <transition g="230,219:" to="task2"/>
- </fork>
- <join g="384,132,48,48" name="join1">
- <transition to="task9"/>
- </join>
- <join g="588,132,48,48" name="join2">
- <transition to="task8"/>
- </join>
- <fork g="96,132,48,48" name="fork2">
- <transition to="task3"/>
- <transition to="fork1"/>
- </fork>
-</process>
\ No newline at end of file
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/weirdForkAndJoin.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/weirdForkAndJoin.jpdl.xml 2010-03-09 20:22:30 UTC (rev 6218)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/forkjoin/weirdForkAndJoin.jpdl.xml 2010-03-10 19:31:36 UTC (rev 6219)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="WeirdNested" xmlns="http://jbpm.org/4.3/jpdl">
- <start g="264,64,48,48" name="start1">
- <transition g="-43,-18" name="to fork2" to="fork2"/>
- </start>
-
- <fork g="263,140,48,48" name="fork2">
- <transition g="-44,-18" name="to task1" to="task1"/>
- <transition g="-44,-18" name="to task2" to="task2"/>
- </fork>
-
- <task assignee="otto" g="102,169,92,52" name="task1">
- <transition g="-43,-18" name="to fork1" to="fork1"/>
- </task>
- <task assignee="otto" g="402,174,92,52" name="task2">
- <transition g="-41,-18" name="to join1-via2" to="join1"/>
- </task>
-
- <fork g="119,280,48,48" name="fork1">
- <transition g="-44,-18" name="to task3" to="task3"/>
- <transition g="-41,-18" name="to join1-via1" to="join1"/>
- </fork>
-
- <join g="271,380,48,48" name="join1">
- <transition g="-44,-18" name="to task4" to="task4"/>
- </join>
-
- <task assignee="otto" g="26,465,92,52" name="task3"/>
- <task assignee="otto" g="248,466,92,52" name="task4"/>
-
-</process>
\ No newline at end of file
14 years, 2 months
JBoss JBPM SVN: r6218 - projects/parent/tags.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-03-09 15:22:30 -0500 (Tue, 09 Mar 2010)
New Revision: 6218
Added:
projects/parent/tags/jbpm-parent-1.0.2/
Log:
tag jbpm-parent-1.0.2
Copied: projects/parent/tags/jbpm-parent-1.0.2 (from rev 6217, projects/parent/trunk)
14 years, 2 months
JBoss JBPM SVN: r6217 - in jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm: job and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-03-09 06:42:06 -0500 (Tue, 09 Mar 2010)
New Revision: 6217
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java
Log:
JBPM-2812: call Token.signal(Transition) in Timer.execute to prevent redundant lookup;
consider superstate transitions in Node.hasLeavingTransition
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2010-03-09 11:24:05 UTC (rev 6216)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2010-03-09 11:42:06 UTC (rev 6217)
@@ -195,7 +195,7 @@
}
/**
- * removes the bidirection relation between this node and the given leaving
+ * removes the bidirectional relation between this node and the given leaving
* transition.
*
* @throws IllegalArgumentException if leavingTransition is null.
@@ -211,41 +211,36 @@
}
/**
- * checks for the presence of a leaving transition with the given name.
+ * checks for the presence of a leaving transition with the given name. the
+ * leaving transitions of the supernode are taken into account as well.
*
* @return true if this node has a leaving transition with the given name,
* false otherwise.
*/
public boolean hasLeavingTransition(String transitionName) {
- if (leavingTransitions != null) {
- for (Iterator i = leavingTransitions.iterator(); i.hasNext();) {
- Transition transition = (Transition) i.next();
- if (transitionName.equals(transition.getName())) return true;
- }
- }
- return false;
+ return getLeavingTransition(transitionName) != null;
}
/**
- * retrieves a leaving transition by name. note that also the leaving
- * transitions of the supernode are taken into account.
+ * retrieves a leaving transition by name. the leaving transitions of the
+ * supernode are taken into account as well.
*/
public Transition getLeavingTransition(String transitionName) {
- Transition transition = null;
if (leavingTransitions != null) {
- transition = (Transition) getLeavingTransitionsMap().get(transitionName);
+ for (Iterator i = leavingTransitions.iterator(); i.hasNext();) {
+ Transition transition = (Transition) i.next();
+ if (transitionName != null ? transitionName.equals(transition.getName())
+ : transition.getName() == null) return transition;
+ }
}
- if (transition == null && superState != null) {
- transition = superState.getLeavingTransition(transitionName);
- }
- return transition;
+ return superState != null ? superState.getLeavingTransition(transitionName) : null;
}
/**
- * true if this transition has leaving transitions.
+ * tells whether this node lacks leaving transitions.
*/
public boolean hasNoLeavingTransitions() {
- return (leavingTransitions == null || leavingTransitions.size() == 0)
+ return (leavingTransitions == null || leavingTransitions.isEmpty())
&& (superState == null || superState.hasNoLeavingTransitions());
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java 2010-03-09 11:24:05 UTC (rev 6216)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java 2010-03-09 11:42:06 UTC (rev 6217)
@@ -12,6 +12,7 @@
import org.jbpm.graph.def.Event;
import org.jbpm.graph.def.GraphElement;
import org.jbpm.graph.def.Node;
+import org.jbpm.graph.def.Transition;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.Token;
@@ -85,11 +86,12 @@
// and if no unhandled exception occurred during the action
if (transitionName != null && exception == null) {
Node node = token.getNode();
- if (node.getLeavingTransition(transitionName)!=null) {
- token.signal(transitionName);
+ Transition transition = node.getLeavingTransition(transitionName);
+ if (transition != null) {
+ token.signal(transition);
}
else {
- log.warn(node + " has no leaving transition with name: " + transitionName);
+ log.warn(node + " has no leaving transition named " + transitionName);
}
}
@@ -106,7 +108,7 @@
repeatDate = businessCalendar.add(repeatDate, interval);
} while (repeatDate.getTime() <= currentTime);
- log.debug("scheduling " + this + " for repeat on: " + dueDate);
+ log.debug("scheduling " + this + " for repeat on " + dueDate);
dueDate = repeatDate;
// unlock timer so that:
14 years, 2 months
JBoss JBPM SVN: r6216 - projects/jsf-console/branches/jsf-console-3.2-soa and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-03-09 06:24:05 -0500 (Tue, 09 Mar 2010)
New Revision: 6216
Modified:
jbpm3/branches/jbpm-3.2-soa/pom.xml
jbpm3/branches/jbpm-3.2-soa/profiles.example.xml
projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml
Log:
upgrade to jbpm-parent 1.0.2
Modified: jbpm3/branches/jbpm-3.2-soa/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-03-09 09:09:01 UTC (rev 6215)
+++ jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-03-09 11:24:05 UTC (rev 6216)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-parent</artifactId>
- <version>1.0.2-SNAPSHOT</version>
+ <version>1.0.2</version>
</parent>
<!-- Modules -->
Modified: jbpm3/branches/jbpm-3.2-soa/profiles.example.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/profiles.example.xml 2010-03-09 09:09:01 UTC (rev 6215)
+++ jbpm3/branches/jbpm-3.2-soa/profiles.example.xml 2010-03-09 11:24:05 UTC (rev 6216)
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
-<profilesXml
- xmlns="http://maven.apache.org/PROFILES/1.0.0"
+<profilesXml xmlns="http://maven.apache.org/PROFILES/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
<profiles>
@@ -8,12 +7,6 @@
<profile>
<id>dev-local</id>
- <activation>
- <property>
- <name>user.name</name>
- </property>
- </activation>
-
<properties>
<jboss405.home>${USER_HOME}${FILE_SEPARATOR}jboss-4.0.5.GA</jboss405.home>
<jboss423.home>${USER_HOME}${FILE_SEPARATOR}jboss-4.2.3.GA</jboss423.home>
@@ -68,9 +61,26 @@
<jdbc.sybase.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.sybase.driver>
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
- <altDeploymentRepository>repository.jboss.org::default::file:${user.home}/jbpm/repository</altDeploymentRepository>
<updateReleaseInfo>true</updateReleaseInfo>
</properties>
</profile>
</profiles>
+
+ <servers>
+ <server>
+ <id>snapshots.jboss.org</id>
+ <username>jboss.org-username</username>
+ <password>password</password>
+ </server>
+
+ <server>
+ <id>repository.jboss.org</id>
+ <username>jboss.org-username</username>
+ <password>password</password>
+ </server>
+ </servers>
+
+ <activeProfiles>
+ <activeProfile>dev-local</activeProfile>
+ </activeProfiles>
</profilesXml>
Modified: projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml
===================================================================
--- projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml 2010-03-09 09:09:01 UTC (rev 6215)
+++ projects/jsf-console/branches/jsf-console-3.2-soa/pom.xml 2010-03-09 11:24:05 UTC (rev 6216)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-parent</artifactId>
- <version>1.0.1.GA</version>
+ <version>1.0.2</version>
</parent>
<!-- Modules -->
14 years, 2 months
JBoss JBPM SVN: r6215 - projects/parent/trunk.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-03-09 04:09:01 -0500 (Tue, 09 Mar 2010)
New Revision: 6215
Modified:
projects/parent/trunk/pom.xml
Log:
release jbpm-parent-1.0.2
Modified: projects/parent/trunk/pom.xml
===================================================================
--- projects/parent/trunk/pom.xml 2010-03-09 07:05:28 UTC (rev 6214)
+++ projects/parent/trunk/pom.xml 2010-03-09 09:09:01 UTC (rev 6215)
@@ -3,11 +3,13 @@
<modelVersion>4.0.0</modelVersion>
<name>JBoss jBPM - Parent</name>
+ <url>http://jboss.org/jbpm</url>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-parent</artifactId>
<packaging>pom</packaging>
- <version>1.0.2-SNAPSHOT</version>
+ <version>1.0.2</version>
+ <!-- Organization -->
<organization>
<name>JBoss Community</name>
<url>http://jboss.org</url>
@@ -22,7 +24,6 @@
</scm>
<!-- Issue Management -->
- <url>http://jboss.org/jbpm</url>
<issueManagement>
<system>jira</system>
<url>http://jira.jboss.org/jira/browse/JBPM</url>
@@ -34,7 +35,7 @@
<url>http://hudson.qa.jboss.com/hudson</url>
</ciManagement>
- <!-- licenses -->
+ <!-- Licenses -->
<licenses>
<license>
<name>lgpl</name>
@@ -42,8 +43,13 @@
</license>
</licenses>
- <!-- Plugins -->
+ <!-- Properties -->
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
<build>
+ <!-- Plugins -->
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
@@ -69,7 +75,7 @@
</plugin>
</plugins>
- <!-- PluginManagement -->
+ <!-- Plugin Management -->
<pluginManagement>
<plugins>
<plugin>
@@ -109,6 +115,26 @@
</plugin>
</plugins>
</pluginManagement>
+
+ <extensions>
+ <!-- Allow to deploy releases in SVN -->
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-scm</artifactId>
+ <version>1.0-beta-6</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-manager-plexus</artifactId>
+ <version>1.0</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-svnexe</artifactId>
+ <version>1.0</version>
+ </extension>
+ </extensions>
+
</build>
<!-- Reporting -->
@@ -164,7 +190,7 @@
</repository>
</repositories>
- <!-- PluginRepositories -->
+ <!-- Plugin Repositories -->
<pluginRepositories>
<pluginRepository>
<id>maven2.java.net</id>
@@ -193,12 +219,12 @@
</pluginRepository>
</pluginRepositories>
- <!-- DistributionManagement -->
+ <!-- Distribution Management -->
<distributionManagement>
<repository>
<id>repository.jboss.org</id>
- <name>JBoss Maven Repository</name>
- <url>file://${jboss.maven.repository}</url>
+ <name>JBoss Release Repository</name>
+ <url>scm:svn:https://svn.jboss.org/repos/repository.jboss.org/maven2</url>
</repository>
<snapshotRepository>
14 years, 2 months
JBoss JBPM SVN: r6214 - jbpm3/branches/jbpm-3.2-soa/modules/identity/src/main/java/org/jbpm/identity/mail.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-03-09 02:05:28 -0500 (Tue, 09 Mar 2010)
New Revision: 6214
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/identity/src/main/java/org/jbpm/identity/mail/IdentityAddressResolver.java
Log:
deprecate useless methods in IdentityAddressResolver
Modified: jbpm3/branches/jbpm-3.2-soa/modules/identity/src/main/java/org/jbpm/identity/mail/IdentityAddressResolver.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/identity/src/main/java/org/jbpm/identity/mail/IdentityAddressResolver.java 2010-03-09 00:51:01 UTC (rev 6213)
+++ jbpm3/branches/jbpm-3.2-soa/modules/identity/src/main/java/org/jbpm/identity/mail/IdentityAddressResolver.java 2010-03-09 07:05:28 UTC (rev 6214)
@@ -1,33 +1,41 @@
package org.jbpm.identity.mail;
-import org.jbpm.JbpmContext;
import org.jbpm.identity.User;
import org.jbpm.identity.hibernate.IdentitySession;
import org.jbpm.mail.AddressResolver;
import org.jbpm.svc.Service;
-import org.jbpm.svc.ServiceFactory;
/**
- * translates actorIds into email addresses with the jBPM identity module.
- * Only user actorIds are resolved to their email addresses. Group actorIds return null.
+ * translates actorIds into email addresses with the jBPM identity module. Only
+ * user actorIds are resolved to their email addresses. Group actorIds return
+ * null.
*/
-public class IdentityAddressResolver implements AddressResolver, ServiceFactory, Service {
+public class IdentityAddressResolver implements AddressResolver {
private static final long serialVersionUID = 1L;
public Object resolveAddress(String actorId) {
String emailAddress = null;
- IdentitySession identitySession = new IdentitySession(JbpmContext.getCurrentJbpmContext().getSession());
+ IdentitySession identitySession = new IdentitySession();
User user = identitySession.getUserByName(actorId);
- if (user!=null) {
+ if (user != null) {
emailAddress = user.getEmail();
}
return emailAddress;
}
+ /**
+ * @deprecated this address resolver does not fit the {@linkplain Service
+ * service} model.
+ */
public Service openService() {
- return this;
+ return null;
}
+
+ /**
+ * @deprecated this address resolver does not fit the {@linkplain Service
+ * service} model.
+ */
public void close() {
}
}
14 years, 2 months
JBoss JBPM SVN: r6213 - projects/jsf-console/branches/jsf-console-3.2-soa/gpd-deployer/src/main/java/org/jbpm/web.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-03-08 19:51:01 -0500 (Mon, 08 Mar 2010)
New Revision: 6213
Modified:
projects/jsf-console/branches/jsf-console-3.2-soa/gpd-deployer/src/main/java/org/jbpm/web/ProcessUploadServlet.java
Log:
JBPM-2678: merge r6092:6117 from branch jsf-console-3.3.1.SP
Modified: projects/jsf-console/branches/jsf-console-3.2-soa/gpd-deployer/src/main/java/org/jbpm/web/ProcessUploadServlet.java
===================================================================
--- projects/jsf-console/branches/jsf-console-3.2-soa/gpd-deployer/src/main/java/org/jbpm/web/ProcessUploadServlet.java 2010-03-08 11:35:50 UTC (rev 6212)
+++ projects/jsf-console/branches/jsf-console-3.2-soa/gpd-deployer/src/main/java/org/jbpm/web/ProcessUploadServlet.java 2010-03-09 00:51:01 UTC (rev 6213)
@@ -24,7 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
-import java.net.MalformedURLException;
+import java.util.List;
import java.util.zip.ZipInputStream;
import javax.servlet.ServletException;
@@ -41,7 +41,31 @@
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.jpdl.JpdlException;
+import org.jbpm.jpdl.xml.Problem;
+import org.jbpm.util.IoUtil;
+/**
+ * <p>
+ * Deploys process definitions zipped and posted as multipart requests.
+ * </p>
+ * <h3>Configuration</h3> Servlet context initialization parameters
+ * <table border="1">
+ * <tr>
+ * <th>Name</th>
+ * <th>Description</th>
+ * <th>Default value</th>
+ * </tr>
+ * <tr>
+ * <td>jbpm.configuration.resource</td>
+ * <td>name of classpath resource containing the configuration</td>
+ * <td>jbpm.cfg.xml</td>
+ * </tr>
+ * </table>
+ *
+ * @author Koen Aers
+ * @author Alejandro Guizar
+ */
public class ProcessUploadServlet extends javax.servlet.http.HttpServlet {
private static final long serialVersionUID = 1L;
@@ -54,9 +78,7 @@
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- if (log.isTraceEnabled()) log.trace("handling status request");
-
+ throws ServletException, IOException {
PrintWriter out = response.getWriter();
writeHeader(out);
out.println("<p>GPD deployer is operational</p>");
@@ -64,9 +86,7 @@
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- if (log.isTraceEnabled()) log.trace("handling upload request");
-
+ throws ServletException, IOException {
try {
InputStream processStream = parseRequest(request, response);
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
@@ -74,6 +94,15 @@
ProcessDefinition processDefinition = parseProcessArchive(processStream);
deployProcessDefinition(processDefinition, response);
}
+ catch (JpdlException e) {
+ List problems = e.getProblems();
+ StringBuffer message = new StringBuffer();
+ for (int i = 0, n = problems.size(); i < n; i++) {
+ Problem problem = (Problem) problems.get(i);
+ message.append(problem).append(IoUtil.lineSeparator);
+ }
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST, message.toString());
+ }
finally {
jbpmContext.close();
}
@@ -83,7 +112,7 @@
}
}
- private void writeHeader(PrintWriter out) throws MalformedURLException {
+ private void writeHeader(PrintWriter out) {
out.println("<html>");
out.println("<head>");
out.println("<title>Process Deployment</title>");
@@ -99,35 +128,31 @@
out.println("</html>");
}
- private InputStream parseRequest(HttpServletRequest request,
- HttpServletResponse response) throws IOException, FileUploadException {
+ private InputStream parseRequest(HttpServletRequest request, HttpServletResponse response)
+ throws IOException, FileUploadException {
// check if request is multipart content
- if (!ServletFileUpload.isMultipartContent(request))
+ if (!ServletFileUpload.isMultipartContent(request)) {
throw new FileUploadException("request does not carry multipart content");
-
+ }
// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload();
// Parse the request
for (FileItemIterator i = upload.getItemIterator(request); i.hasNext();) {
FileItemStream part = i.next();
if (!part.isFormField()) {
- if (log.isTraceEnabled())
- log.trace("retrieved file " + part.getName());
+ if (log.isTraceEnabled()) log.trace("retrieved file " + part.getName());
return part.openStream();
}
}
-
- // no file found, bang
+ // file not found
throw new FileUploadException("request contains no file");
}
- private ProcessDefinition parseProcessArchive(InputStream processStream)
- throws IOException {
+ private ProcessDefinition parseProcessArchive(InputStream processStream) throws IOException {
ZipInputStream processArchiveStream = new ZipInputStream(processStream);
try {
ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(processArchiveStream);
- if (log.isTraceEnabled())
- log.trace("parsed process definition " + processDefinition.getName());
+ if (log.isTraceEnabled()) log.trace("parsed " + processDefinition);
return processDefinition;
}
finally {
@@ -136,21 +161,20 @@
}
private void deployProcessDefinition(ProcessDefinition processDefinition,
- HttpServletResponse response) throws IOException {
- String processName = processDefinition.getName();
+ HttpServletResponse response) throws IOException {
JbpmContext jbpmContext = jbpmConfiguration.getCurrentJbpmContext();
try {
jbpmContext.deployProcessDefinition(processDefinition);
+ if (log.isTraceEnabled()) log.trace("deployed " + processDefinition);
- if (log.isTraceEnabled())
- log.trace("deployed process definition " + processName);
-
PrintWriter out = response.getWriter();
writeHeader(out);
out.println("<h3>Deployment report</h3>");
out.print("<p>Process <em>");
- out.print(processName);
- out.println("</em> was deployed successfully</p>");
+ out.print(processDefinition.getName());
+ out.print("</em> v");
+ out.print(processDefinition.getVersion());
+ out.println(" deployed successfully</p>");
out.print("<p><a href='");
out.print(getServletContext().getContextPath());
out.println("/index.html'>Deploy another process</a></p>");
@@ -159,8 +183,9 @@
catch (RuntimeException e) {
jbpmContext.setRollbackOnly();
- log.error("failed to deploy process definition " + processName, e);
- response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to deploy process");
+ log.error("failed to deploy " + processDefinition, e);
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
+ "Failed to deploy process");
}
}
14 years, 2 months
JBoss JBPM SVN: r6212 - in jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en: modules and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-03-08 06:35:50 -0500 (Mon, 08 Mar 2010)
New Revision: 6212
Added:
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/create_connection.png
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/execute_script.png
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/load_script.png
Removed:
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/create_connection.jpg
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/execute_script.jpg
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/install_driver.jpg
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/load_script.jpg
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/database.xml
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/persistence.xml
Log:
JBPM-2164: Document JbpmSchema API and Ant task
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/create_connection.jpg
===================================================================
(Binary files differ)
Added: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/create_connection.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/create_connection.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/execute_script.jpg
===================================================================
(Binary files differ)
Added: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/execute_script.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/execute_script.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/install_driver.jpg
===================================================================
(Binary files differ)
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/load_script.jpg
===================================================================
(Binary files differ)
Added: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/load_script.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/images/load_script.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/database.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/database.xml 2010-03-05 08:17:30 UTC (rev 6211)
+++ jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/database.xml 2010-03-08 11:35:50 UTC (rev 6212)
@@ -22,7 +22,7 @@
location on your machine named ${jbpm-jpdl-home}. You will find the DB
subproject of jBPM in the ${jbpm-jpdl-home}/db.</para>
- <para>After installing the of your choice database, you will have to run
+ <para>After installing the database of your choice, you will have to run
the database creation scripts to create the jBPM tables. Note that in the
hsqldb inside jboss this is done automatically during installation.
</para>
@@ -30,7 +30,7 @@
<title>Isolation level</title>
<para>Whatever database that you use, make sure that the isolation level
of the configured JDBC connection is at least READ_COMMITTED, as explained
- in <xref linkend="isolationlevelofthejdbcconnection"/>
+ in <xref linkend="isolationlevelofthejdbcconnection"/>.
</para>
</section>
@@ -57,29 +57,14 @@
</mediaobject>
</figure>
- <para>After the installation of the database, we can use a database
- viewer tool like DBVisualizer to look at the contents of the database.
- Before you can define a database connection with DBVisualizer, you might
- have to add the PostgreSQL JDBC driver to the driver manager. Select
- 'Tools->Driver Manager...' to open the driver manager window. Look at
- the figure below for an example of how to add the PostgreSQL JDBC
- driver.</para>
+ <para>After the installation of the database, we can use the pgAdmin III
+ Query tool to look at the contents of the database.</para>
- <figure>
- <title>Adding the JDBC driver to the driver manager</title>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/install_driver.jpg" />
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Now everything is set to define a database connection in
- DBVisualizer to our newly created database. We will use this tool
+ <para>Before we do, we have to define a database connection in
+ pgAdmin to our newly created database. We will use this tool
further in this document to make sure the creation scripts and process
deployment are working as expected. For an example of creating the
- connection in DBVisualizer we refer to the following figure. As you can
+ connection in pgAdmin we refer to the following figure. As you will
see, there are no tables present yet in this database. We will create
them in the following section.</para>
@@ -88,7 +73,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/create_connection.jpg" />
+ <imagedata fileref="images/create_connection.png" />
</imageobject>
</mediaobject>
</figure>
@@ -120,7 +105,7 @@
</section>
<section>
- <title>Creating the JBoss jBPM Database with your new PostGreSQL or
+ <title>Creating the JBoss jBPM Database with your new PostgreSQL or
MySQL</title>
<para>In order to get the proper database scripts for your
@@ -128,19 +113,19 @@
Using your
database admin console, navigate to the database and then open and
execute the create script we just referenced. Below are screen shots
- doing this for PostGreSQL and MySQL under their respective admin
+ doing this for PostgreSQL and MySQL under their respective admin
consoles</para>
<section>
- <title>Creating the JBoss jBPM Database with PostGreSQL</title>
+ <title>Creating the jBPM Database with PostgreSQL</title>
<para>As already mentioned you will find the database scripts for a
lot of the supported databases in the DB subproject. The database
scripts for PostgreSQL are found in the folder
'${jbpm-jpdl-home}/db. The creation script is
- called 'postgresql.create.sql'. Using DBVisualizer, you can load this
- script by switching to the 'SQL Commander' tab and then selecting
- 'File->Load...'. In the following dialog, navigate to the creation
+ called 'postgresql.create.sql'. Using pgAdmin, you can load this
+ script by selecting 'Tools->Query tool' and then
+ 'File->Open...'. In the following dialog, navigate to the creation
script file. The result of doing so is shown in the figure
below.</para>
@@ -149,13 +134,13 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/load_script.jpg" />
+ <imagedata fileref="images/load_script.png" />
</imageobject>
</mediaobject>
</figure>
- <para>To execution this script with DBVisualizer, you select
- 'Database->Execute'. After this step all JBoss jBPM tables are
+ <para>To execute this script with the pgAdmin Query tool, select
+ 'Query->Execute'. After this step all JBoss jBPM tables are
created. The situation is illustrated in the figure below.</para>
<figure>
@@ -163,7 +148,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/execute_script.jpg" />
+ <imagedata fileref="images/execute_script.png" />
</imageobject>
</mediaobject>
</figure>
@@ -191,14 +176,14 @@
scripts. Open a DOS box or terminal window and type the following
command:</para>
- <programlisting> mysql -u root -p </programlisting>
+ <screen>$ mysql -u root -p </screen>
<para>You will be prompted for your MySQL password for the root
account or whatever account you are using to modify this database.
After logging in, type the following command to use the newly created
jbpmdb:</para>
- <programlisting>use jbpmdb </programlisting>
+ <screen>use jbpmdb </screen>
<figure>
<title>Loading the database create scripts for MySQL</title>
@@ -213,9 +198,9 @@
<para>Now you can load the database script for jBPM by executing the
following command:</para>
- <programlisting>source mysql.drop.create.sql </programlisting>
+ <screen>source mysql.drop.create.sql </screen>
- <para>Once the script executes, you should have the folling output in
+ <para>Once the script executes, you should have the following output in
the MySQL command window:</para>
<figure>
@@ -234,7 +219,7 @@
<title>Last Steps</title>
<para>After these steps, there is not yet any data present in the
- tables. For the jBPM webapp to work, you should at least create some
+ tables. For the jBPM web app to work, you should at least create some
records in the jbpm_id_user table. In order to have exactly the same
entries in this table as the default distribution of the starter's kit
running on HSQLDB, we suggest to run the script below.</para>
@@ -253,7 +238,7 @@
<title>Update the JBoss jBPM Server Configuration</title>
<para>Before we can really use our newly created database with the JBoss
- jBPM default webapp we will have to do some updates to the JBoss jBPM
+ jBPM default web app we will have to do some updates to the JBoss jBPM
configuration. The location of the jbpm server configuration is
<literal>${jboss-home}/server/default/deploy/jbpm</literal>.
</para>
@@ -282,9 +267,7 @@
<para>For MySQL, the datasource definition would look as follows:</para>
- <programlisting><?xml version="1.0" encoding="UTF-8"?>
-
-<datasources>
+ <programlisting language="xml"><datasources>
<local-tx-datasource>
<jndi-name>JbpmDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/jbpmdb</connection-url>
@@ -304,10 +287,9 @@
you just created a new DataSource for your JBoss jBPM server. Well,
almost... To make things really work you will have to copy the correct
JDBC driver to the <literal>${jboss.home}/server/default/lib</literal> folder.
- We already used this JDBC driver above when we were installing it in
- DBVisualizer to be able to browse our newly created database. The file
+ The file
is named <literal>postgresql-8.1-*.jdbc3.jar</literal> and it can be found in the jdbc
- subfolder of your PostgreSQL installation folder.</para>
+ subdirectory of your PostgreSQL installation folder.</para>
<para>For MySQL, copy the jdbc driver installed from the MySQL
ConnectorJ package. The version you need to use is currently the MySQL
@@ -331,13 +313,7 @@
using. You can get a list of supported database Dialect types from here
http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...</para>
- <programlisting><?xml version='1.0' encoding='utf-8'?>
-
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
+ <programlisting language="xml"><hibernate-configuration>
<session-factory>
<!-- jdbc connection properties -->
@@ -360,7 +336,7 @@
</session-factory>
</hibernate-configuration></programlisting>
- <para>Now we are ready to fire up the server, and look if the webapp
+ <para>Now we are ready to fire up the server, and look if the web app
works. You will not be able to start any processes yet, as there are no
processes deployed yet. To do this we refer to the document on process
definition deployment.</para>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/persistence.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/persistence.xml 2010-03-05 08:17:30 UTC (rev 6211)
+++ jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/persistence.xml 2010-03-08 11:35:50 UTC (rev 6212)
@@ -501,7 +501,7 @@
store it on disk.
</para>
- <section id="isolationlevelofthejdbcconnection">
+ <section id="jdbcconnectionisolation">
<title>Isolation level of the JDBC connection</title>
<para>Make sure that the database isolation level that you configure for your
JDBC connection is at least READ_COMMITTED.
@@ -527,27 +527,114 @@
</itemizedlist>
</section>
- <section id="thejbpmdbschema">
- <title>The jBPM DB schema</title>
- <para>The jbpm.db subproject, contains a number of drivers, instructions and
- scripts to help you getting started on your database of choice. Please,
- refer to the readme.html in the root of the jbpm.db project for more
- information.
+ <section id="jbpmdbschema">
+ <title>The jBPM database schema</title>
+ <para>The <literal>database</literal> and <literal>config</literal> directories
+ in the distribution contain scripts and Hibernate configuration files
+ to help you get started on your choice database.
</para>
- <para>While jBPM is capable of generating DDL scripts for all database, these
- schemas are not always optimized. So you might want to have your DBA review
+ <para>While jBPM is capable of generating DDL scripts for any database
+ supported by Hibernate, the resulting
+ schemas are not always optimized. You might want to have your DBA review
the DDL that is generated to optimize the column types and use of indexes.
</para>
<para>In development you might be interested in the following hibernate configuration:
- If you set hibernate configuration property 'hibernate.hbm2ddl.auto' to 'create-drop'
- (e.g. in the hibernate.cfg.xml), the schema will be automatically created in the
- database the first time it is used in an application. When the application closes
+ If you set hibernate configuration property <literal>hibernate.hbm2ddl.auto</literal>
+ to <literal>create-drop</literal> in the Hibernate configuration file,
+ the database schema will be automatically created
+ the first time the application accesses the database. When the application closes
down, the schema will be dropped.
</para>
- <para>The schema generation can also be invoked programmatically with
- <literal>jbpmConfiguration.createSchema()</literal> and
- <literal>jbpmConfiguration.dropSchema()</literal>.
- </para>
+ <section id="programmaticdbschema">
+ <title>Programmatic database schema operations</title>
+ <para>jBPM provides an API for creating and droping the database schema
+ through the <ulink
+ url="http://docs.jboss.com/jbpm/v3.2/javadoc-jpdl/org/jbpm/JbpmConfiguration.html">
+ <classname>org.jbpm.JbpmConfiguration</classname></ulink> methods
+ <methodname>createSchema</methodname> and <methodname>dropSchema</methodname>.
+ Be aware that there is no constraint on invoking these methods other than
+ the privileges of the configured database user.
+ </para>
+ <para>The aforementioned APIs constitute a facade to the broader functionality
+ offered by class <ulink
+ url="http://docs.jboss.com/jbpm/v3.2/javadoc-jpdl/org/jbpm/db/JbpmSchema.html">
+ <classname>org.jbpm.db.JbpmSchema</classname></ulink>:
+ </para>
+ <itemizedlist>
+ <listitem>Create, drop, update and clean (drop-create) the database schema</listitem>
+ <listitem>Generate SQL scripts for the above operations</listitem>
+ <listitem>List the mapped tables and query the existing tables in the database</listitem>
+ </itemizedlist>
+ </section>
+ <section id="jbpmschematask">
+ <title>The jBPM schema Ant task</title>
+ <para>As an alternative to programmatic schema manipulation, jBPM provides an Ant task
+ for generating scripts that create, drop and update the database schema.
+ The listing below illustrates the task being used to generate the schema
+ creation script and save it to file <literal>create.sql</literal>. The Hibernate
+ configuration is read from the resource <literal>hibernate.cfg.xml</literal>.</para>
+ <programlisting><![CDATA[<taskdef name="jbpmschema" classname="org.jbpm.ant.JbpmSchemaTask">
+ <classpath>
+ <pathelement location="jbpm-jpdl.jar" />
+ <pathelement location="hibernate.jar" />
+ <pathelement location="dom4j.jar" />
+ <pathelement location="commons-logging.jar"/>
+ <pathelement location="commons-collections.jar"/>
+ </classpath>
+</taskdef>
+
+<jbpmschema config="hibernate.cfg.xml" action="create" output="create.sql" />]]></programlisting>
+ <para>The task parameters are documented below.</para>
+ <table><title>jBPM schema task parameters</title><tgroup cols='3'>
+ <colspec colname='attr' colwidth="*" />
+ <colspec colname='desc' colwidth="3*" />
+ <colspec colname='req' colwidth="*" />
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Description</entry>
+ <entry>Required</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>config</entry>
+ <entry>Hibernate configuration resource</entry>
+ <entry>No, default <literal>hibernate.cfg.xml</literal></entry>
+ </row>
+ <row>
+ <entry>properties</entry>
+ <entry>Hibernate properties resource. These properties override
+ property values from the <literal>config</literal> resource.</entry>
+ <entry>No</entry>
+ </row>
+ <row>
+ <entry>action</entry>
+ <entry>Database schema operation to script. Can be <literal>create</literal>,
+ <literal>drop</literal>, <literal>update</literal> or
+ <literal>clean</literal>.</entry>
+ <entry>No, default <literal>create</literal></entry>
+ </row>
+ <row>
+ <entry>output</entry>
+ <entry>The output file. The generated script is written to this file.</entry>
+ <entry>Yes</entry>
+ </row>
+ <row>
+ <entry>delimiter</entry>
+ <entry>String that separates SQL statements</entry>
+ <entry>No, default <literal>;</literal></entry>
+ </row>
+ <row>
+ <entry>delimiterType</entry>
+ <entry>Control whether the delimiter should be placed on a line by itself.
+ Can be <literal>normal</literal>, at the end of line, or <literal>row</literal>,
+ on a line by itself.</entry>
+ <entry>No, default <literal>normal</literal></entry>
+ </row>
+ </tbody>
+ </tgroup></table>
+ </section>
</section>
</section>
14 years, 2 months
JBoss JBPM SVN: r6211 - in jbpm3/branches/jbpm-3.2-soa/modules/core/src: test/java/org/jbpm and 1 other directories.
by do-not-reply@jboss.org
Author: mputz
Date: 2010-03-05 03:17:30 -0500 (Fri, 05 Mar 2010)
New Revision: 6211
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2812/
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2812/JBPM2812Test.java
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java
Log:
Fix for JBPM-2812: Timer does not take leaving transition defined at super-state
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java 2010-03-05 04:26:40 UTC (rev 6210)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java 2010-03-05 08:17:30 UTC (rev 6211)
@@ -85,7 +85,7 @@
// and if no unhandled exception occurred during the action
if (transitionName != null && exception == null) {
Node node = token.getNode();
- if (node.hasLeavingTransition(transitionName)) {
+ if (node.getLeavingTransition(transitionName)!=null) {
token.signal(transitionName);
}
else {
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2812/JBPM2812Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2812/JBPM2812Test.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2812/JBPM2812Test.java 2010-03-05 08:17:30 UTC (rev 6211)
@@ -0,0 +1,78 @@
+/*
+ * 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.jbpm2812;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Test to verify timer execution inside a super-state
+ *
+ * @see <a href="https://jira.jboss.org/jira/browse/JBPM-2812">JBPM-2812</a>
+ * @author Martin Putz
+ */
+public class JBPM2812Test extends AbstractDbTestCase {
+
+ public void testTimerWithSuperState() {
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
+ "<process-definition name='jbpm2812'>" +
+ " <start-state name='start'>" +
+ " <transition to='super-state/state1'/>" +
+ " </start-state>" +
+ " <super-state name='super-state'>" +
+ " <state name='state1'>" +
+ " <timer duedate='3 seconds' name='timeout-timer' transition='timeout'/>" +
+ " <transition to='state2' name='go'/>" +
+ " </state>" +
+ " <state name='state2'>" +
+ " <transition to='end' name='go'/>" +
+ " </state>" +
+ " <transition to='timed-out-end' name='timeout'/>" +
+ " </super-state>" +
+ " <end-state name='timed-out-end'/>" +
+ " <end-state name='end'/>" +
+ "</process-definition>"
+ );
+
+ processDefinition = saveAndReload(processDefinition);
+ try
+ {
+ ProcessInstance processInstance = new ProcessInstance(processDefinition);
+ // long before = System.currentTimeMillis();
+ processInstance.signal();
+ assertEquals("state1", processInstance.getRootToken().getNode().getName());
+
+ processJobs(60 * 1000);
+
+ processInstance = jbpmContext.loadProcessInstance(processInstance.getId());
+ assertTrue("expected " + processInstance + " to have ended", processInstance.hasEnded());
+ assertEquals("timed-out-end", processInstance.getRootToken().getNode().getName());
+ }
+ finally
+ {
+ jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
+ }
+
+ }
+
+}
14 years, 2 months
JBoss JBPM SVN: r6210 - in jbpm3/branches/jbpm-3.2-soa: modules/core and 9 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-03-04 23:26:40 -0500 (Thu, 04 Mar 2010)
New Revision: 6210
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2787/
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2787/JBPM2787Test.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/gpd.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/processdefinition.xml
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/Join.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/msg/db/DbMessageService.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java
jbpm3/branches/jbpm-3.2-soa/pom.xml
Log:
JBPM-2787: end concurrent tokens on enter, check for active children of the parent token on execute
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml 2010-03-04 13:17:09 UTC (rev 6209)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml 2010-03-05 04:26:40 UTC (rev 6210)
@@ -168,19 +168,6 @@
</execution>
</executions>
</plugin>
-
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>${surefire.jvm.args}</argLine>
- <systemProperties>
- <property>
- <name>log4j.output.dir</name>
- <value>${project.build.directory}</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
</plugins>
</build>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/Join.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/Join.java 2010-03-04 13:17:09 UTC (rev 6209)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/Join.java 2010-03-05 04:26:40 UTC (rev 6210)
@@ -22,7 +22,6 @@
package org.jbpm.graph.node;
import java.util.Collection;
-import java.util.Date;
import java.util.Iterator;
import org.apache.commons.logging.Log;
@@ -97,137 +96,118 @@
public void enter(ExecutionContext executionContext) {
Token token = executionContext.getToken();
token.end(false);
+ token.setAbleToReactivateParent(true);
super.enter(executionContext);
}
public void execute(ExecutionContext executionContext) {
Token arrivingToken = executionContext.getToken();
- Token parentToken = arrivingToken.getParent();
- if (parentToken != null) {
- JbpmContext jbpmContext = executionContext.getJbpmContext();
- Session session;
- if (jbpmContext != null && (session = jbpmContext.getSession()) != null) {
- // obtain update lock by default (LockMode.UPGRADE)
- LockMode lockMode = parentLockMode != null ? LockMode.parse(parentLockMode)
- : LockMode.UPGRADE;
- // load() hits the database as required, no need to flush() here
- parentToken = (Token) session.load(Token.class,
- new Long(parentToken.getId()), lockMode);
- log.debug("acquired " + lockMode + " lock on " + parentToken);
- }
- boolean reactivateParent;
+ // if this token is not able to reactivate the parent,
+ // there is no need to check anything
+ if (!arrivingToken.isAbleToReactivateParent()) return;
+ arrivingToken.setAbleToReactivateParent(false);
- // if this is a discriminator
- if (isDiscriminator) {
- // reactivate the parent when the first token arrives in the join
- reactivateParent = true;
+ Token parentToken = arrivingToken.getParent();
+ JbpmContext jbpmContext = executionContext.getJbpmContext();
+ Session session;
+ if (jbpmContext != null && (session = jbpmContext.getSession()) != null) {
+ // obtain update lock by default (LockMode.UPGRADE)
+ LockMode lockMode = parentLockMode != null ? LockMode.parse(parentLockMode)
+ : LockMode.UPGRADE;
+ // load() hits the database as required, no need to flush() here
+ parentToken = (Token) session.load(Token.class, new Long(parentToken.getId()), lockMode);
+ log.debug(this + " acquires " + lockMode + " lock on " + parentToken);
+ }
+
+ boolean reactivateParent;
+ // if this is a discriminator
+ if (isDiscriminator) {
+ // reactivate the parent when the first token arrives in the join
+ reactivateParent = true;
+ }
+ // if a fixed set of tokenNames is specified at design time...
+ else if (tokenNames != null) {
+ // check reactivation on the basis of those tokenNames
+ reactivateParent = !parentToken.hasActiveChildren()
+ && mustParentBeReactivated(parentToken, tokenNames);
+ }
+ // if a script is specified
+ else if (script != null) {
+ // check if the script returns a collection or a boolean
+ Object result = null;
+ try {
+ result = script.eval(arrivingToken);
}
- // if a fixed set of tokenNames is specified at design time...
- else if (tokenNames != null) {
- // check reactivation on the basis of those tokenNames
- reactivateParent = mustParentBeReactivated(parentToken, tokenNames)
- && isLastToArrive(arrivingToken, tokenNames);
+ catch (Exception e) {
+ raiseException(e, executionContext);
}
- // if a script is specified
- else if (script != null) {
- // check if the script returns a collection or a boolean
- Object result = null;
- try {
- result = script.eval(arrivingToken);
- }
- catch (Exception e) {
- raiseException(e, executionContext);
- }
- // if the result is a collection
- if (result instanceof Collection) {
- // interpret as a collection of token names
- Collection tokenNames = (Collection) result;
- reactivateParent = mustParentBeReactivated(parentToken, tokenNames)
- && isLastToArrive(arrivingToken, tokenNames);
- }
- // if it is a boolean...
- else if (result instanceof Boolean) {
- // the boolean specifies if the parent needs to be reactivated
- reactivateParent = ((Boolean) result).booleanValue();
- }
- // any other object
- else {
- // non-null result means the parent needs to be reactivated
- reactivateParent = result != null;
- }
+ // if the result is a collection
+ if (result instanceof Collection) {
+ // interpret as a collection of token names
+ Collection tokenNames = (Collection) result;
+ reactivateParent = !parentToken.hasActiveChildren()
+ && mustParentBeReactivated(parentToken, tokenNames);
}
- // if a nOutOfM is specified
- else if (nOutOfM != -1) {
- int n = 0;
- // check how many tokens already arrived in the join
- for (Iterator iter = parentToken.getChildren().values().iterator(); iter.hasNext();) {
- Token concurrentToken = (Token) iter.next();
- if (equals(concurrentToken.getNode())) n++;
- }
- reactivateParent = n >= nOutOfM;
+ // if it is a boolean...
+ else if (result instanceof Boolean) {
+ // the boolean specifies if the parent needs to be reactivated
+ reactivateParent = ((Boolean) result).booleanValue();
}
- // if no configuration is specified
+ // any other object
else {
- // check all concurrent tokens and reactivate the parent
- // when the last token arrives in the join
- Collection tokenNames = parentToken.getChildren().keySet();
- reactivateParent = mustParentBeReactivated(parentToken, tokenNames)
- && isLastToArrive(arrivingToken, tokenNames);
+ // non-null result means the parent needs to be reactivated
+ reactivateParent = result != null;
}
+ }
+ // if a nOutOfM is specified
+ else if (nOutOfM != -1) {
+ int n = 0;
+ // check how many tokens already arrived in the join
+ for (Iterator iter = parentToken.getChildren().values().iterator(); iter.hasNext();) {
+ Token concurrentToken = (Token) iter.next();
+ if (equals(concurrentToken.getNode())) n++;
+ }
+ reactivateParent = n >= nOutOfM;
+ }
+ // if no configuration is specified
+ else {
+ // check all concurrent tokens and reactivate the parent
+ // when the last token arrives in the join
+ Collection tokenNames = parentToken.getChildren().keySet();
+ reactivateParent = !parentToken.hasActiveChildren()
+ && mustParentBeReactivated(parentToken, tokenNames);
+ }
- // if the parent token needs to be reactivated from this join node
- if (reactivateParent) {
- // write to all child tokens that the parent is already reactivated
- for (Iterator iter = parentToken.getChildren().values().iterator(); iter.hasNext();) {
- Token concurrentToken = (Token) iter.next();
- concurrentToken.setAbleToReactivateParent(false);
- }
- // leave the join node
- leave(new ExecutionContext(parentToken));
+ // if the parent token is to leave this node
+ if (reactivateParent) {
+ // ensure concurrent tokens are unable to reactivate the parent
+ for (Iterator iter = parentToken.getChildren().values().iterator(); iter.hasNext();) {
+ Token concurrentToken = (Token) iter.next();
+ concurrentToken.setAbleToReactivateParent(false);
}
+ // leave the join node
+ leave(new ExecutionContext(parentToken));
}
}
- private boolean mustParentBeReactivated(Token parentToken,
- Collection childTokenNames) {
+ private boolean mustParentBeReactivated(Token parentToken, Collection childTokenNames) {
return mustParentBeReactivated(parentToken, childTokenNames.iterator());
}
- public boolean mustParentBeReactivated(Token parentToken,
- Iterator childTokenNames) {
+ public boolean mustParentBeReactivated(Token parentToken, Iterator childTokenNames) {
while (childTokenNames.hasNext()) {
String childTokenName = (String) childTokenNames.next();
Token childToken = parentToken.getChild(childTokenName);
if (childToken.isAbleToReactivateParent()) {
- log.debug(parentToken + " will not leave " + this + ", " + childToken
- + " can still reactivate parent");
+ log.debug(parentToken + " does not leave " + this + " as " + childToken
+ + " can still reactivate it");
return false;
}
}
return true;
}
- private boolean isLastToArrive(Token arrivingToken,
- Collection concurrentTokenNames) {
- Date enterDate = arrivingToken.getNodeEnter();
- Token parentToken = arrivingToken.getParent();
- for (Iterator i = concurrentTokenNames.iterator(); i.hasNext();) {
- String concurrentTokenName = (String) i.next();
- Token concurrentToken = (Token) parentToken.getChild(concurrentTokenName);
- if (arrivingToken.equals(concurrentToken)
- || !equals(concurrentToken.getNode())) continue;
-
- Date concurrentEnterDate = concurrentToken.getNodeEnter();
- if (enterDate.before(concurrentEnterDate)) {
- log.debug(parentToken + " will not leave " + this + ", "
- + arrivingToken + " was not the last to arrive");
- return false;
- }
- }
- return true;
- }
-
public String getParentLockMode() {
return parentLockMode;
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java 2010-03-04 13:17:09 UTC (rev 6209)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java 2010-03-05 04:26:40 UTC (rev 6210)
@@ -9,7 +9,7 @@
private static final long serialVersionUID = 1L;
- Node node;
+ private Node node;
public ExecuteNodeJob() {
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2010-03-04 13:17:09 UTC (rev 6209)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2010-03-05 04:26:40 UTC (rev 6210)
@@ -128,7 +128,7 @@
URL schemaURL = classLoader.getResource(schemaResource);
if (schemaURL != null) {
String schemaLocation = schemaURL.toString();
- log.debug("schema resource found: " + schemaResource);
+ log.debug("found schema resource " + schemaResource);
schemaLocations.add(schemaLocation);
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/msg/db/DbMessageService.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/msg/db/DbMessageService.java 2010-03-04 13:17:09 UTC (rev 6209)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/msg/db/DbMessageService.java 2010-03-05 04:26:40 UTC (rev 6210)
@@ -21,8 +21,6 @@
*/
package org.jbpm.msg.db;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.db.JobSession;
@@ -52,13 +50,12 @@
}
public void close() {
+ // if messages were produced
if (hasProducedJobs && jobExecutor != null) {
- log.debug("messages were produced, job executor will be notified");
+ // notify job executor
synchronized (jobExecutor) {
jobExecutor.notify();
}
}
}
-
- private static Log log = LogFactory.getLog(DbMessageService.class);
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java 2010-03-04 13:17:09 UTC (rev 6209)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java 2010-03-05 04:26:40 UTC (rev 6210)
@@ -26,6 +26,7 @@
import org.dom4j.Element;
+import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.calendar.BusinessCalendar;
import org.jbpm.calendar.Duration;
@@ -42,13 +43,13 @@
public class CreateTimerAction extends Action {
private static final long serialVersionUID = 1L;
- static final BusinessCalendar businessCalendar = new BusinessCalendar();
+ private static final BusinessCalendar businessCalendar = new BusinessCalendar();
- String timerName;
- String dueDate;
- String repeat;
- String transitionName;
- Action timerAction;
+ private String timerName;
+ private String dueDate;
+ private String repeat;
+ private String transitionName;
+ private Action timerAction;
public void read(Element actionElement, JpdlXmlReader jpdlReader) {
timerName = actionElement.attributeValue("name");
@@ -73,9 +74,20 @@
}
public void execute(ExecutionContext executionContext) throws Exception {
+ // grab jbpm context
+ JbpmContext jbpmContext = executionContext.getJbpmContext();
+ if (jbpmContext == null) {
+ throw new JbpmException("jbpm context unavailable");
+ }
+ // retrieve scheduler service
+ SchedulerService schedulerService = jbpmContext
+ .getServices()
+ .getSchedulerService();
+ if (schedulerService == null) {
+ throw new JbpmException("scheduler service unavailable");
+ }
+ // schedule timer
Timer timer = createTimer(executionContext);
- SchedulerService schedulerService =
- executionContext.getJbpmContext().getServices().getSchedulerService();
schedulerService.createTimer(timer);
}
@@ -93,13 +105,11 @@
if (dueDate.startsWith("#{")) {
int braceIndex = dueDate.indexOf("}");
if (braceIndex == -1) {
- throw new JbpmException("invalid due date, closing brace missing: "
- + dueDate);
+ throw new JbpmException("invalid due date, closing brace missing: " + dueDate);
}
String baseDateEL = dueDate.substring(0, braceIndex + 1);
- Object result =
- JbpmExpressionEvaluator.evaluate(baseDateEL, executionContext);
+ Object result = JbpmExpressionEvaluator.evaluate(baseDateEL, executionContext);
Date baseDate;
if (result instanceof Date) {
@@ -109,28 +119,24 @@
baseDate = ((Calendar) result).getTime();
}
else {
- throw new JbpmException("invalid base date type: "
- + result.getClass().getName());
+ throw new JbpmException("invalid base date type: " + result.getClass().getName());
}
String durationString = dueDate.substring(braceIndex + 1).trim();
if (durationString.length() > 0) {
char durationSeparator = durationString.charAt(0);
if (durationSeparator != '+' && durationSeparator != '-') {
- throw new JbpmException("invalid due date, + or - missing: "
- + dueDate);
+ throw new JbpmException("invalid due date, + or - missing: " + dueDate);
}
durationString = dueDate.substring(braceIndex + 1).trim();
- dueDateDate =
- businessCalendar.add(baseDate, new Duration(durationString));
+ dueDateDate = businessCalendar.add(baseDate, new Duration(durationString));
}
else {
dueDateDate = baseDate;
}
}
else {
- dueDateDate =
- businessCalendar.add(Clock.getCurrentTime(), new Duration(dueDate));
+ dueDateDate = businessCalendar.add(Clock.getCurrentTime(), new Duration(dueDate));
}
timer.setDueDate(dueDateDate);
}
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2787/JBPM2787Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2787/JBPM2787Test.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2787/JBPM2787Test.java 2010-03-05 04:26:40 UTC (rev 6210)
@@ -0,0 +1,82 @@
+/*
+ * 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.jbpm2787;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Process instances get stuck in a fork.
+ *
+ * @author Alejandro Guizar
+ * @see <a href="https://jira.jboss.org/jira/browse/JBPM-2787">JBPM-2787</a>
+ */
+public class JBPM2787Test extends AbstractDbTestCase {
+
+ private long processDefinitionId;
+
+ private static final int TIMEOUT = 60 * 1000;
+ private static final int INSTANCE_COUNT = 10;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ String dialect = getHibernateDialect();
+ if (dialect.indexOf("DB2") == -1 // [JBPM-2115] multiple threads not supported on DB2 < 9.7
+ && dialect.indexOf("HSQL") == -1) { // multiple threads will not be supported on HSQL
+ jbpmConfiguration.getJobExecutor().setNbrOfThreads(4);
+ }
+
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("org/jbpm/jbpm2787/processdefinition.xml");
+ jbpmContext.deployProcessDefinition(processDefinition);
+ processDefinitionId = processDefinition.getId();
+ newTransaction();
+ }
+
+ protected void tearDown() throws Exception {
+ graphSession.deleteProcessDefinition(processDefinitionId);
+
+ jbpmConfiguration.getJobExecutor().setNbrOfThreads(1);
+ super.tearDown();
+ }
+
+ public void testJobExecutorDeadlock() {
+ long[] processInstanceIds = new long[INSTANCE_COUNT];
+ for (int i = 0; i < INSTANCE_COUNT; i++) {
+ ProcessInstance processInstance = jbpmContext.newProcessInstance("prequalification");
+ processInstance.signal();
+ jbpmContext.save(processInstance);
+
+ newTransaction();
+ processInstanceIds[i] = processInstance.getId();
+ }
+
+ processJobs(TIMEOUT);
+
+ for (int i = 0; i < INSTANCE_COUNT; i++) {
+ ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceIds[i]);
+ assertTrue("expected " + processInstance + " to have ended", processInstance.hasEnded());
+ }
+ }
+
+}
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2787/JBPM2787Test.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/gpd.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/gpd.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/gpd.xml 2010-03-05 04:26:40 UTC (rev 6210)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container name="prequalification" width="883" height="1236">
+ <node name="StartPrequalification" x="379" y="46" width="165" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="fork1" x="360" y="279" width="205" height="24">
+ <edge>
+ <label x="-167" y="-14"/>
+ </edge>
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="fork2" x="224" y="524" width="136" height="24">
+ <edge>
+ <label x="-51" y="-9"/>
+ </edge>
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="join1" x="211" y="712" width="161" height="24">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="join2" x="526" y="792" width="158" height="24">
+ <edge>
+ <label x="-80" y="-9"/>
+ </edge>
+ </node>
+ <node name="ChooseLocalLoopType" x="527" y="864" width="157" height="36">
+ <edge>
+ <label x="12" y="-10"/>
+ </edge>
+ </node>
+ <node name="ChooseCentralType" x="221" y="785" width="142" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="Reply" x="540" y="1112" width="132" height="36">
+ <edge>
+ <label x="-50" y="-9"/>
+ </edge>
+ </node>
+ <node name="CheckCache" x="395" y="191" width="132" height="36">
+ <edge>
+ <label x="-120" y="-12"/>
+ </edge>
+ <edge>
+ <label x="5" y="-10"/>
+ <bendpoint w1="321" h1="0" w2="176" h2="-921"/>
+ <bendpoint w1="321" h1="921" w2="176" h2="0"/>
+ </edge>
+ </node>
+ <node name="LookupCentralOffice" x="218" y="364" width="147" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="LookupConnection" x="536" y="511" width="139" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="LocateBSACentral" x="62" y="623" width="134" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="FindCentralRequestMapper" x="201" y="438" width="181" height="36">
+ <edge>
+ <label x="-4" y="-196"/>
+ <bendpoint w1="-246" h1="0" w2="-247" h2="-346"/>
+ <bendpoint w1="-246" h1="347" w2="-247" h2="1"/>
+ </edge>
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="LocateColocCentral" x="220" y="622" width="143" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="StoreResult" x="389" y="1044" width="132" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="StoreResultRequestMapper" x="503" y="959" width="204" height="36">
+ <edge>
+ <label x="-62" y="-4"/>
+ </edge>
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="LocateEBSACentral" x="392" y="621" width="132" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="InitializeVariables" x="383" y="118" width="158" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="EndPrequalification" x="516" y="1199" width="181" height="36"/>
+</root-container>
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/gpd.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/processdefinition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/processdefinition.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/processdefinition.xml 2010-03-05 04:26:40 UTC (rev 6210)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition xmlns="" name="prequalification">
+
+ <start-state name="StartPrequalification">
+ <transition to="InitializeVariables" />
+ </start-state>
+
+ <fork name="fork1">
+ <transition to="LookupCentralOffice" name="to LookupCentralOffice" />
+ <transition to="LookupConnection" name="to LookupConnection" />
+ </fork>
+
+ <fork name="fork2">
+ <transition to="LocateBSACentral" name="to FindBSA" />
+ <transition to="LocateColocCentral" name="to FindColoc" />
+ <transition to="LocateEBSACentral" name="to FindEBSA" />
+ </fork>
+
+ <join name="join1" async="true">
+ <transition to="ChooseCentralType" />
+ </join>
+
+ <join name="join2" async="true">
+ <transition to="ChooseLocalLoopType" />
+ </join>
+
+ <node name="ChooseLocalLoopType">
+ <transition to="StoreResultRequestMapper" />
+ </node>
+
+ <node name="ChooseCentralType">
+ <transition to="join2" />
+ </node>
+
+ <node name="Reply">
+ <transition to="EndPrequalification" />
+ </node>
+
+ <decision name="CheckCache" expression="PerformPrequalification">
+ <transition to="fork1" name="PerformPrequalification" />
+ <transition to="Reply" name="to Reply" />
+ </decision>
+
+ <node name="LookupCentralOffice" async="true">
+ <action class="org.jbpm.mock.EsbActionHandler">
+ <esbServiceName>LookupCentralOffice</esbServiceName>
+ <esbCategoryName>dk.telenor.esb.harlequin.tdc.columbine</esbCategoryName>
+ <bpmToEsbVars>
+ <mapping bpm="contactInfoXML" esb="body.'dk.telenor.esb.harlequin.tdc.columbine.InputPayload'" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping bpm="lookupCentralXML" esb="body.'dk.telenor.esb.harlequin.tdc.columbine.OutputPayload'" />
+ </esbToBpmVars>
+ </action>
+ <transition to="FindCentralRequestMapper" />
+ </node>
+
+ <node name="LookupConnection" async="true">
+ <action class="org.jbpm.mock.EsbActionHandler">
+ <esbServiceName>LookupConnection</esbServiceName>
+ <esbCategoryName>dk.telenor.esb.harlequin.tdc.columbine</esbCategoryName>
+ <bpmToEsbVars>
+ <mapping bpm="contactInfoXML" esb="body.'dk.telenor.esb.harlequin.tdc.columbine.InputPayload'" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping bpm="connectionXML" esb="body.'dk.telenor.esb.harlequin.tdc.columbine.OutputPayload'" />
+ </esbToBpmVars>
+ </action>
+ <transition to="join2" />
+ </node>
+
+ <node name="LocateBSACentral" async="true">
+ <action class="org.jbpm.mock.EsbActionHandler">
+ <esbServiceName>LocateCentralOffice</esbServiceName>
+ <esbCategoryName>dk.telenor.esb.ods.geodata</esbCategoryName>
+ <bpmToEsbVars>
+ <mapping bpm="bsaCentralXML" esb="body.'dk.telenor.esb.ods.geodata.InputPayload'" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping bpm="bsaCentralXML" esb="body.'dk.telenor.esb.ods.geodata.OutputPayload'" />
+ </esbToBpmVars>
+ </action>
+ <transition to="join1" />
+ </node>
+
+ <decision name="FindCentralRequestMapper" expression="to FindCentrals">
+ <transition to="ChooseCentralType" name="to ChooseCentralType" />
+ <transition to="fork2" name="to FindCentrals" />
+ </decision>
+
+ <node name="LocateColocCentral" async="true">
+ <action class="org.jbpm.mock.EsbActionHandler">
+ <esbServiceName>LocateCentralOffice</esbServiceName>
+ <esbCategoryName>dk.telenor.esb.ods.geodata</esbCategoryName>
+ <bpmToEsbVars>
+ <mapping bpm="colocCentralXML" esb="body.'dk.telenor.esb.ods.geodata.InputPayload'" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping bpm="colocCentralXML" esb="body.'dk.telenor.esb.ods.geodata.OutputPayload'" />
+ </esbToBpmVars>
+ </action>
+ <transition to="join1" />
+ </node>
+
+ <node name="StoreResult">
+ <event type="node-leave">
+ <action name="StoreResult" class="org.jbpm.mock.EsbActionHandler">
+ <esbServiceName>StoreResourceOrder</esbServiceName>
+ <esbCategoryName>dk.telenor.esb.harlequin.resourceorder</esbCategoryName>
+ <bpmToEsbVars>
+ <mapping bpm="prequalificationXML" esb="body.'dk.telenor.esb.harlequin.resourceorder.InputPayload'" />
+ <mapping bpm="storeStatus"
+ esb="body.'dk.telenor.esb.harlequin.resourceorder.InternalPayloadStatus'" />
+ <mapping bpm="transactionId"
+ esb="body.'dk.telenor.esb.harlequin.resourceorder.InternalPayloadTransactionId'" />
+ </bpmToEsbVars>
+ </action>
+ </event>
+ <transition to="Reply" />
+ </node>
+
+ <decision name="StoreResultRequestMapper" expression="to Reply">
+ <transition to="StoreResult" name="to StoreResult" />
+ <transition to="Reply" name="to Reply" />
+ </decision>
+
+ <node name="LocateEBSACentral" async="true">
+ <action class="org.jbpm.mock.EsbActionHandler">
+ <esbServiceName>LocateCentralOffice</esbServiceName>
+ <esbCategoryName>dk.telenor.esb.ods.geodata</esbCategoryName>
+ <bpmToEsbVars>
+ <mapping bpm="ebsaCentralXML" esb="body.'dk.telenor.esb.ods.geodata.InputPayload'" />
+ </bpmToEsbVars>
+ <esbToBpmVars>
+ <mapping bpm="ebsaCentralXML" esb="body.'dk.telenor.esb.ods.geodata.OutputPayload'" />
+ </esbToBpmVars>
+ </action>
+ <transition to="join1" />
+ </node>
+
+ <node name="InitializeVariables">
+ <transition to="CheckCache" />
+ </node>
+
+ <end-state name="EndPrequalification" />
+
+</process-definition>
\ No newline at end of file
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2787/processdefinition.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Modified: jbpm3/branches/jbpm-3.2-soa/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-03-04 13:17:09 UTC (rev 6209)
+++ jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-03-05 04:26:40 UTC (rev 6210)
@@ -337,6 +337,19 @@
<target>1.4</target>
</configuration>
</plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${surefire.jvm.args}</argLine>
+ <systemProperties>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
</plugins>
</build>
14 years, 2 months