[jbpm-commits] JBoss JBPM SVN: r3182 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm and 9 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Dec 3 08:48:29 EST 2008
Author: tom.baeyens at jboss.com
Date: 2008-12-03 08:48:29 -0500 (Wed, 03 Dec 2008)
New Revision: 3182
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByNameCmd.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/ExecutionServiceTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/ProcessServiceTest.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionCmd.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ConfigurationTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ProcessTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/
Modified:
jbpm4/trunk/modules/api/pom.xml
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ProcessServiceTest.java
jbpm4/trunk/modules/userguide/src/main/diagrams/diagrams.mdzip
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/loan.executions.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Services.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
Log:
service api and docs updates
Modified: jbpm4/trunk/modules/api/pom.xml
===================================================================
--- jbpm4/trunk/modules/api/pom.xml 2008-12-03 13:19:19 UTC (rev 3181)
+++ jbpm4/trunk/modules/api/pom.xml 2008-12-03 13:48:29 UTC (rev 3182)
@@ -59,6 +59,9 @@
<profiles>
<profile>
<id>distro</id>
+ <properties>
+ <xsddocs>true</xsddocs>
+ </properties>
<build>
<plugins>
<plugin>
@@ -75,6 +78,21 @@
<show>public</show>
</configuration>
</plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>xsddocs</id>
+ <activation>
+ <os>
+ <family>Windows</family>
+ </os>
+ <property>
+ <name>xsddocs</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java 2008-12-03 13:19:19 UTC (rev 3181)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessService.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -43,8 +43,11 @@
List<ProcessDefinition> findProcessDefinitions(String processDefinitionName);
/** latest version of the processDefinition with the given name. */
- ProcessDefinition findLatestProcessDefinition(String processDefinitionName);
+ ProcessDefinition findLatestProcessDefinitionByName(String processDefinitionName);
+ /** latest version of the processDefinition with the given key. */
+ ProcessDefinition findLatestProcessDefinitionByKey(String processDefinitionKey);
+
/** specific version of a named processDefinition. */
ProcessDefinition findProcessDefinition(String processDefinitionName, int processDefinitionVersion);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java 2008-12-03 13:19:19 UTC (rev 3181)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -21,10 +21,7 @@
*/
package org.jbpm.pvm.internal.cmd;
-import java.util.List;
-
import org.jbpm.JbpmException;
-import org.jbpm.ProcessDefinition;
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
import org.jbpm.session.PvmDbSession;
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -0,0 +1,47 @@
+/*
+ * 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.jbpm.ProcessDefinition;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.model.OpenProcessDefinition;
+import org.jbpm.session.PvmDbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindLatestProcessDefinitionByKeyCmd implements Command<ProcessDefinition> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String processDefinitionKey;
+
+ public FindLatestProcessDefinitionByKeyCmd(String processDefinitionKey) {
+ this.processDefinitionKey = processDefinitionKey;
+ }
+
+ public OpenProcessDefinition execute(Environment environment) throws Exception {
+ return environment.get(PvmDbSession.class).findLatestProcessDefinitionByKey(processDefinitionKey);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByNameCmd.java (from rev 3143, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionCmd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByNameCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByNameCmd.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -0,0 +1,46 @@
+/*
+ * 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.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.model.OpenProcessDefinition;
+import org.jbpm.session.PvmDbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FindLatestProcessDefinitionByNameCmd implements Command<OpenProcessDefinition> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String processDefinitionName;
+
+ public FindLatestProcessDefinitionByNameCmd(String processDefinitionName) {
+ this.processDefinitionName = processDefinitionName;
+ }
+
+ public OpenProcessDefinition execute(Environment environment) throws Exception {
+ return environment.get(PvmDbSession.class).findLatestProcessDefinitionByName(processDefinitionName);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByNameCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionCmd.java 2008-12-03 13:19:19 UTC (rev 3181)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionCmd.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cmd;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.session.PvmDbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FindLatestProcessDefinitionCmd implements Command<OpenProcessDefinition> {
-
- private static final long serialVersionUID = 1L;
-
- protected String processDefinitionName;
-
- public FindLatestProcessDefinitionCmd(String processDefinitionName) {
- this.processDefinitionName = processDefinitionName;
- }
-
- public OpenProcessDefinition execute(Environment environment) throws Exception {
- return environment.get(PvmDbSession.class).findLatestProcessDefinitionByName(processDefinitionName);
- }
-
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java 2008-12-03 13:19:19 UTC (rev 3181)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionCmd.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -25,7 +25,6 @@
import org.jbpm.cmd.Command;
import org.jbpm.env.Environment;
import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.session.PvmDbSession;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java 2008-12-03 13:19:19 UTC (rev 3181)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -29,6 +29,8 @@
*/
public abstract class VariablesCmd<T> extends AbstractCommand<T> {
+ private static final long serialVersionUID = 1L;
+
Map<String, Object> variables;
public void addVariable(String key, Object variable) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java 2008-12-03 13:19:19 UTC (rev 3181)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ProcessServiceImpl.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -30,7 +30,8 @@
import org.jbpm.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.cmd.DeleteProcessDefinitionCmd;
import org.jbpm.pvm.internal.cmd.DeployCmd;
-import org.jbpm.pvm.internal.cmd.FindLatestProcessDefinitionCmd;
+import org.jbpm.pvm.internal.cmd.FindLatestProcessDefinitionByKeyCmd;
+import org.jbpm.pvm.internal.cmd.FindLatestProcessDefinitionByNameCmd;
import org.jbpm.pvm.internal.cmd.FindProcessDefinitionCmd;
import org.jbpm.pvm.internal.cmd.FindProcessDefinitionNamesCmd;
import org.jbpm.pvm.internal.cmd.FindProcessDefinitionsCmd;
@@ -57,10 +58,14 @@
return commandService.execute(new DeployCmd((DeploymentImpl)deployment));
}
- public ProcessDefinition findLatestProcessDefinition(String processDefinitionName) {
- return commandService.execute(new FindLatestProcessDefinitionCmd(processDefinitionName));
+ public ProcessDefinition findLatestProcessDefinitionByName(String processDefinitionName) {
+ return commandService.execute(new FindLatestProcessDefinitionByNameCmd(processDefinitionName));
}
+ public ProcessDefinition findLatestProcessDefinitionByKey(String processDefinitionKey) {
+ return commandService.execute(new FindLatestProcessDefinitionByKeyCmd(processDefinitionKey));
+ }
+
public ProcessDefinition findProcessDefinition(String processDefinitionName, int version) {
return commandService.execute(new FindProcessDefinitionCmd(processDefinitionName, version));
}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ProcessServiceTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ProcessServiceTest.java 2008-12-03 13:19:19 UTC (rev 3181)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/db/svc/ProcessServiceTest.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -266,7 +266,7 @@
ProcessService processService = getEnvironmentFactory().get(ProcessService.class);
- ProcessDefinition retrieved = processService.findLatestProcessDefinition("nuclear fusion");
+ ProcessDefinition retrieved = processService.findLatestProcessDefinitionByName("nuclear fusion");
assertNotNull(retrieved);
assertEquals("nuclear fusion", retrieved.getName());
@@ -279,7 +279,7 @@
ProcessService processService = getEnvironmentFactory().get(ProcessService.class);
- ProcessDefinition retrieved = processService.findLatestProcessDefinition("nuclear fusion");
+ ProcessDefinition retrieved = processService.findLatestProcessDefinitionByName("nuclear fusion");
assertNotNull(retrieved);
assertEquals("nuclear fusion", retrieved.getName());
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities (from rev 3143, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures)
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ConfigurationTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ConfigurationTest.java 2008-11-28 11:05:29 UTC (rev 3143)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ConfigurationTest.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.basicfeatures;
-
-import org.jbpm.Configuration;
-import org.jbpm.ProcessEngine;
-import org.jbpm.test.JbpmTestCase;
-
-/**
- * @author Tom Baeyens
- */
-public class ConfigurationTest extends JbpmTestCase {
-
- public void testDefaultConfiguration() {
- ProcessEngine processEngine = new Configuration()
- .buildProcessEngine();
- assertNotNull(processEngine);
- }
-
- /*
- public void testResourceConfiguration() {
- ProcessEngine processEngine = new Configuration()
- .setResource("my-jbpm-configuration.xml")
- .buildProcessEngine();
- assertNotNull(processEngine);
- }
- */
-
- public void testMinimalConfiguration() {
- ProcessEngine processEngine = new Configuration()
- .setXmlString("<jbpm-configuration />")
- .buildProcessEngine();
- assertNotNull(processEngine);
- }
-
- public void testConfigurationServices() {
- ProcessEngine processEngine = new Configuration()
- .setXmlString(
- "<jbpm-configuration>" +
- " <process-engine>" +
- " <process-service />" +
- " <execution-service />" +
- " <management-service />" +
- " </process-engine>" +
- "</jbpm-configuration>"
- )
- .buildProcessEngine();
- assertNotNull(processEngine);
- assertNotNull(processEngine.getProcessService());
- assertNotNull(processEngine.getExecutionService());
- assertNotNull(processEngine.getManagementService());
- }
-}
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ProcessTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ProcessTest.java 2008-11-28 11:05:29 UTC (rev 3143)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ProcessTest.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.basicfeatures;
-
-import org.jbpm.Execution;
-import org.jbpm.ProcessDefinition;
-import org.jbpm.test.DbTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessTest extends DbTestCase {
-
- public void testMinimalProcess() {
- deployJpdlXmlString(
- "<process name='minimal'>" +
- " <start>" +
- " <flow to='end' />" +
- " </start>" +
- " <end name='end' />" +
- "</process>"
- );
-
- Execution execution = executionService.startExecutionInLatest("minimal");
-
- assertEquals("end", execution.getNodeName());
- assertTrue(execution.isEnded());
- assertTrue(execution.isFinished());
- assertFalse(execution.isActive());
- }
-
- public void testMostMinimalProcess() {
- deployJpdlXmlString(
- "<process name='minimal'>" +
- " <start />" +
- "</process>"
- );
-
- Execution execution = executionService.startExecutionInLatest("minimal");
-
- assertTrue(execution.isEnded());
- assertTrue(execution.isFinished());
- assertFalse(execution.isActive());
- }
-
- public void testGivenKey() {
- deployJpdlXmlString(
- "<process name='minimal' key='M'>" +
- " <start />" +
- "</process>"
- );
-
- ProcessDefinition processDefinition = processService.findLatestProcessDefinition("minimal");
-
- assertEquals("M", processDefinition.getKey());
- assertEquals("M:1", processDefinition.getId());
- assertEquals(1, processDefinition.getVersion());
- }
-
- public void testGivenVersion() {
- deployJpdlXmlString(
- "<process name='minimal' version='23'>" +
- " <start />" +
- "</process>"
- );
-
- ProcessDefinition processDefinition = processService.findLatestProcessDefinition("minimal");
-
-
- assertEquals(23, processDefinition.getVersion());
- assertEquals("minimal:23", processDefinition.getId());
- }
-}
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java 2008-11-28 11:05:29 UTC (rev 3143)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -1,155 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.basicfeatures;
-
-import org.jbpm.Execution;
-import org.jbpm.JbpmException;
-import org.jbpm.test.DbTestCase;
-
-/**
- * @author Tom Baeyens
- */
-public class StateTest extends DbTestCase {
-
- public void testWaitStatesSequence() {
- deployJpdlXmlString(
- "<process name='ThreeStates'>" +
- " <start name='a'>" +
- " <flow to='b' />" +
- " </start>" +
- " <state name='b'>" +
- " <flow to='c' />" +
- " </state>" +
- " <state name='c'>" +
- " <flow to='d' />" +
- " </state>" +
- " <end name='d' />" +
- "</process>"
- );
-
- Execution execution = executionService.startExecution("ThreeStates:1");
- assertEquals("b", execution.getNodeName());
-
- String executionId = execution.getId();
- execution = executionService.signalExecution(executionId);
- assertEquals("c", execution.getNodeName());
-
- execution = executionService.signalExecution(executionId);
- assertEquals("d", execution.getNodeName());
- assertTrue(execution.isEnded());
- }
-
- public void testExternalDecision() {
- deployJpdlXmlString(
- "<process name='p'>" +
- " <start>" +
- " <flow to='ed' />" +
- " </start>" +
- " <state name='ed'>" +
- " <flow name='left' to='b' />" +
- " <flow name='middle' to='c' />" +
- " <flow name='right' to='d' />" +
- " </state>" +
- " <state name='b' />" +
- " <state name='c' />" +
- " <state name='d' />" +
- "</process>"
- );
-
- Execution execution = executionService.startExecution("p:1", "one");
- assertEquals("ed", execution.getNodeName());
- execution = executionService.signalExecution("p:1/one", "left");
- assertEquals("b", execution.getNodeName());
-
- executionService.startExecution("p:1", "two");
- execution = executionService.signalExecution("p:1/two", "middle");
- assertEquals("c", execution.getNodeName());
-
- executionService.startExecution("p:1", "three");
- execution = executionService.signalExecution("p:1/three", "right");
- assertEquals("d", execution.getNodeName());
- }
-
- public void testDefaultSignalWithNamedTransitions() {
- deployJpdlXmlString(
- "<process name='p'>" +
- " <start>" +
- " <flow to='a' />" +
- " </start>" +
- " <state name='a'>" +
- " <flow name='left' to='b' />" +
- " <flow name='middle' to='c' />" +
- " <flow name='right' to='d' />" +
- " </state>" +
- " <state name='b' />" +
- " <state name='c' />" +
- " <state name='d' />" +
- "</process>"
- );
-
- executionService.startExecution("p:1", "one");
- try {
- executionService.signalExecution("p:1/one", "left");
- } catch (JbpmException e) {
- assertTextPresent("no matching transition or event for default signal in state(a)", e.getMessage());
- }
- }
-
- /*
- public void testNamedSignalWithoutMatchingTransition() {
- ClientProcessDefinition processDefinition = parseJpdl(
- "<process initial='a' name='p'>" +
- " <state name='a'>" +
- " <transition name='left' to='b' />" +
- " <transition name='middle' to='c' />" +
- " <transition name='right' to='d' />" +
- " </state>" +
- " <state name='b' />" +
- " <state name='c' />" +
- " <state name='d' />" +
- "</process>"
- );
-
- ClientExecution execution = processDefinition.startProcessInstance();
- try {
- execution.signal("up");
- } catch (PvmException e) {
- assertTextPresent("no matching transition or event for signal 'up' in state(a)", e.getMessage());
- }
- }
-
- public void testDefaultSignalWithoutTransitions() {
- ClientProcessDefinition processDefinition = parseJpdl(
- "<process initial='a' name='p'>" +
- " <state name='a' />" +
- "</process>"
- );
-
- ClientExecution execution = processDefinition.startProcessInstance();
- try {
- execution.signal();
- } catch (PvmException e) {
- assertTextPresent("no matching transition or event for default signal in state(a)", e.getMessage());
- }
- }
- */
-}
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java (from rev 3179, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/StateTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/StateTest.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -0,0 +1,153 @@
+/*
+ * 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.activities;
+
+import org.jbpm.Execution;
+import org.jbpm.JbpmException;
+import org.jbpm.test.DbTestCase;
+
+/**
+ * @author Tom Baeyens
+ */
+public class StateTest extends DbTestCase {
+
+ public void testWaitStatesSequence() {
+ deployJpdlXmlString(
+ "<process name='ThreeStates'>" +
+ " <start name='a'>" +
+ " <flow to='b' />" +
+ " </start>" +
+ " <state name='b'>" +
+ " <flow to='c' />" +
+ " </state>" +
+ " <state name='c'>" +
+ " <flow to='d' />" +
+ " </state>" +
+ " <end name='d' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startExecutionById("ThreeStates:1");
+ assertEquals("b", execution.getNodeName());
+
+ String executionId = execution.getId();
+ execution = executionService.signalExecution(executionId);
+ assertEquals("c", execution.getNodeName());
+
+ execution = executionService.signalExecution(executionId);
+ assertEquals("d", execution.getNodeName());
+ assertTrue(execution.isEnded());
+ }
+
+ public void testExternalDecision() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <flow to='ed' />" +
+ " </start>" +
+ " <state name='ed'>" +
+ " <flow name='left' to='b' />" +
+ " <flow name='middle' to='c' />" +
+ " <flow name='right' to='d' />" +
+ " </state>" +
+ " <state name='b' />" +
+ " <state name='c' />" +
+ " <state name='d' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startExecutionByName("p", "one");
+ assertEquals("ed", execution.getNodeName());
+ execution = executionService.signalExecution("p/one", "left");
+ assertEquals("b", execution.getNodeName());
+
+ executionService.startExecutionById("p:1", "two");
+ execution = executionService.signalExecution("p/two", "middle");
+ assertEquals("c", execution.getNodeName());
+
+ executionService.startExecutionById("p:1", "three");
+ execution = executionService.signalExecution("p/three", "right");
+ assertEquals("d", execution.getNodeName());
+ }
+
+ public void testDefaultSignalWithNamedTransitions() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <flow to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <flow name='left' to='b' />" +
+ " <flow name='middle' to='c' />" +
+ " <flow name='right' to='d' />" +
+ " </state>" +
+ " <state name='b' />" +
+ " <state name='c' />" +
+ " <state name='d' />" +
+ "</process>"
+ );
+
+ executionService.startExecutionByName("p", "one");
+ try {
+ executionService.signalExecution("p/one", "left");
+ } catch (JbpmException e) {
+ assertTextPresent("no matching transition or event for default signal in state(a)", e.getMessage());
+ }
+ }
+
+ public void testNamedSignalWithoutMatchingTransition() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <flow to='a' />" +
+ " </start>" +
+ " <state name='a'>" +
+ " <flow name='left' to='b' />" +
+ " <flow name='middle' to='c' />" +
+ " <flow name='right' to='d' />" +
+ " </state>" +
+ " <state name='b' />" +
+ " <state name='c' />" +
+ " <state name='d' />" +
+ "</process>"
+ );
+
+ executionService.startExecutionByName("p", "one");
+ Execution execution = executionService.signalExecution("p/one", "up");
+ assertEquals("a", execution.getNodeName());
+ }
+
+ public void testDefaultSignalWithoutTransitions() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <flow to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ executionService.startExecutionByName("p", "one");
+ Execution execution = executionService.signalExecution("p/one");
+ assertEquals("a", execution.getNodeName());
+ }
+}
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/ExecutionServiceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/ExecutionServiceTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/ExecutionServiceTest.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -0,0 +1,47 @@
+/*
+ * 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.svc;
+
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExecutionServiceTest extends DbTestCase {
+
+ public void testDefaultSignalWithoutTransitions() {
+ deployJpdlXmlString(
+ "<process name='p'>" +
+ " <start>" +
+ " <flow to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+
+ executionService.startExecutionByName("p", "one");
+ Execution execution = executionService.signalExecution("p/one");
+ assertEquals("a", execution.getNodeName());
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/ExecutionServiceTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/ProcessServiceTest.java (from rev 3179, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ProcessTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/ProcessServiceTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/ProcessServiceTest.java 2008-12-03 13:48:29 UTC (rev 3182)
@@ -0,0 +1,139 @@
+/*
+ * 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.svc;
+
+import org.jbpm.Execution;
+import org.jbpm.ProcessDefinition;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessServiceTest extends DbTestCase {
+
+ public void testMinimalProcess() {
+ deployJpdlXmlString(
+ "<process name='minimal'>" +
+ " <start>" +
+ " <flow to='end' />" +
+ " </start>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startExecutionByName("minimal");
+
+ assertEquals("end", execution.getNodeName());
+ assertTrue(execution.isEnded());
+ assertTrue(execution.isFinished());
+ assertFalse(execution.isActive());
+ }
+
+ public void testMostMinimalProcess() {
+ deployJpdlXmlString(
+ "<process name='minimal'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ Execution execution = executionService.startExecutionByName("minimal");
+
+ assertTrue(execution.isEnded());
+ assertTrue(execution.isFinished());
+ assertFalse(execution.isActive());
+ }
+
+ // user guide tests /////////////////////////////////////////////////////////
+
+ public void testProcessWithNameOnly() {
+ ProcessDefinition processDefinition = deployJpdlXmlString(
+ "<process name='Insurance claim'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ assertNotNull(processDefinition);
+ assertEquals("Insurance claim", processDefinition.getName());
+ assertEquals("Insurance_claim", processDefinition.getKey());
+ assertEquals(1, processDefinition.getVersion());
+ assertEquals("Insurance_claim:1", processDefinition.getId());
+ }
+
+ public void testProcessWithNameAndKey() {
+ ProcessDefinition processDefinition = deployJpdlXmlString(
+ "<process name='Insurance claim' key='ICL'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ assertNotNull(processDefinition);
+ assertEquals("Insurance claim", processDefinition.getName());
+ assertEquals("ICL", processDefinition.getKey());
+ assertEquals(1, processDefinition.getVersion());
+ assertEquals("ICL:1", processDefinition.getId());
+ }
+
+
+ public void testFindProcessByKey() {
+ deployJpdlXmlString(
+ "<process name='Name with spaces'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ ProcessDefinition processDefinition = processService.findLatestProcessDefinitionByKey("Name_with_spaces");
+ assertNotNull(processDefinition);
+ assertEquals("Name with spaces", processDefinition.getName());
+ assertEquals("Name_with_spaces", processDefinition.getKey());
+ assertEquals(1, processDefinition.getVersion());
+ assertEquals("Name_with_spaces:1", processDefinition.getId());
+ }
+
+ public void testGivenKey() {
+ deployJpdlXmlString(
+ "<process name='minimal' key='M'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ ProcessDefinition processDefinition = processService.findLatestProcessDefinitionByName("minimal");
+
+
+ assertEquals("M", processDefinition.getKey());
+ assertEquals("M:1", processDefinition.getId());
+ assertEquals(1, processDefinition.getVersion());
+ }
+
+ public void testGivenVersion() {
+ deployJpdlXmlString(
+ "<process name='minimal' version='23'>" +
+ " <start />" +
+ "</process>"
+ );
+
+ ProcessDefinition processDefinition = processService.findLatestProcessDefinitionByName("minimal");
+
+ assertEquals(23, processDefinition.getVersion());
+ assertEquals("minimal:23", processDefinition.getId());
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/svc/ProcessServiceTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/trunk/modules/userguide/src/main/diagrams/diagrams.mdzip
===================================================================
(Binary files differ)
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/loan.executions.png
===================================================================
(Binary files differ)
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Services.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Services.xml 2008-12-03 13:19:19 UTC (rev 3181)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Services.xml 2008-12-03 13:48:29 UTC (rev 3182)
@@ -225,20 +225,33 @@
variables.put("customer", "John Doe");
variables.put("type", "Accident");
variables.put("amount", new Float(763.74));
-executionService.startExecution("insurance_claim:1", variables);</programlisting>
+
+executionService.startExecutionByKey("ICL", variables);</programlisting>
</section>
</section>
- <section id="retrievinganexecution">
- <title>Retrieving an execution</title>
- <para>
- </para>
- </section>
-
<section id="singallingawaitingexecution">
<title>Signalling a waiting execution</title>
- <para>
+ <para>When an execution is in a wait state, it can be given an external trigger
+ with one of the signal methods. The recommended way to reference an execution
+ is by using the process definition and execution key. In the next code snippet,
+ <literal>ICL</literal> refers to the process definition key and <literal>82436</literal>
+ refers to the execution key.
</para>
+ <programlisting>executionService.signalExecutionByKey("ICL", "82436");</programlisting>
+ <para>Alternatively, the execution that must be signaled can be referenced
+ by a unique execution id. In the next snippet, <literal>ICL/82436</literal>
+ refers to the executionId.</para>
+ <programlisting>executionService.signalExecutionById("ICL/82436");</programlisting>
+ <para>Optionally some data can be passed along with a signal: a <literal>signalName</literal>
+ and <literal>parameters</literal>. How the signalName gets used depends on
+ the execution's current activity. The parameters get stored as process variables.
+ </para>
+ <programlisting>Map<String,Object> parameters = new HashMap<String,Object>();
+parameters.put("quality", "a+");
+parameters.put("target", "profit");
+
+executionService.signalExecutionById("ICL/82436", "Accept", parameters);</programlisting>
</section>
<section id="taskservice">
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml 2008-12-03 13:19:19 UTC (rev 3181)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml 2008-12-03 13:48:29 UTC (rev 3182)
@@ -20,4 +20,4 @@
</section>
</section>
-</chapter>
\ No newline at end of file
+</chapter>
More information about the jbpm-commits
mailing list