Author: tom.baeyens(a)jboss.com
Date: 2009-04-01 15:56:19 -0400 (Wed, 01 Apr 2009)
New Revision: 4380
Added:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/Order.jpdl.xml
Removed:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/process.jpdl.xml
Modified:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
Log:
updating the docs for the new repository services
Deleted:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java
===================================================================
---
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java 2009-04-01
16:30:08 UTC (rev 4379)
+++
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java 2009-04-01
19:56:19 UTC (rev 4380)
@@ -1,42 +0,0 @@
-package org.jbpm.examples.services;
-
-import junit.framework.TestCase;
-
-import org.jbpm.Configuration;
-import org.jbpm.ExecutionService;
-import org.jbpm.HistoryService;
-import org.jbpm.ManagementService;
-import org.jbpm.ProcessEngine;
-import org.jbpm.RepositoryService;
-import org.jbpm.TaskService;
-
-/** shows explicitely the part of the API that is
- * provided by JbpmTestCase as a convenience.
- *
- * @author Koen Aers, Tom Baeyens
- */
-public class ProcessEngineTest extends TestCase {
-
- public void testBasicApiUsage() {
-
- // create a configuration
- Configuration configuration = new Configuration();
- // build a process engine from a configuration
- ProcessEngine processEngine = configuration.buildProcessEngine();
-
- // Obtain the services from the process engine
- // ProcessEngine and Services are to be used as singletons. (ie they are
threadsafe)
- RepositoryService repositoryService = processEngine.getRepositoryService();
- ExecutionService executionService = processEngine.getExecutionService();
- TaskService taskService = processEngine.getTaskService();
- HistoryService historyService = processEngine.getHistoryService();
- ManagementService managementService = processEngine.getManagementService();
-
- // Deploying a process
- long deploymentDbid = repositoryService.createDeployment()
-
.addResourceFromClasspath("org/jbpm/examples/services/process.jpdl.xml")
- .deploy();
-
- repositoryService.deleteDeployment(deploymentDbid);
- }
-}
Copied:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java
(from rev 4379,
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ProcessEngineTest.java)
===================================================================
---
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java
(rev 0)
+++
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java 2009-04-01
19:56:19 UTC (rev 4380)
@@ -0,0 +1,42 @@
+package org.jbpm.examples.services;
+
+import junit.framework.TestCase;
+
+import org.jbpm.Configuration;
+import org.jbpm.ExecutionService;
+import org.jbpm.HistoryService;
+import org.jbpm.ManagementService;
+import org.jbpm.ProcessEngine;
+import org.jbpm.RepositoryService;
+import org.jbpm.TaskService;
+
+/** shows explicitely the part of the API that is
+ * provided by JbpmTestCase as a convenience.
+ *
+ * @author Koen Aers, Tom Baeyens
+ */
+public class ServicesTest extends TestCase {
+
+ public void testObtainServicesAndDeployProcess() {
+
+ // create a configuration
+ Configuration configuration = new Configuration();
+ // build a process engine from a configuration
+ ProcessEngine processEngine = configuration.buildProcessEngine();
+
+ // Obtain the services from the process engine
+ // ProcessEngine and Services are to be used as singletons. (ie they are
threadsafe)
+ RepositoryService repositoryService = processEngine.getRepositoryService();
+ ExecutionService executionService = processEngine.getExecutionService();
+ TaskService taskService = processEngine.getTaskService();
+ HistoryService historyService = processEngine.getHistoryService();
+ ManagementService managementService = processEngine.getManagementService();
+
+ // Deploying a process
+ long deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/services/Order.jpdl.xml")
+ .deploy();
+
+ repositoryService.deleteDeployment(deploymentDbid);
+ }
+}
Copied:
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/Order.jpdl.xml
(from rev 4379,
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/process.jpdl.xml)
===================================================================
---
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/Order.jpdl.xml
(rev 0)
+++
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/Order.jpdl.xml 2009-04-01
19:56:19 UTC (rev 4380)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Order"
xmlns="http://jbpm.org/4/jpdl">
+
+ <start g="16,19,48,48">
+ <transition to="receive confirmation" />
+ </start>
+
+ <state name="receive confirmation" g="96,16,75,52">
+ <transition to="end" />
+ </state>
+
+ <end name="end" g="203,19,48,48"/>
+
+</process>
\ No newline at end of file
Deleted:
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/process.jpdl.xml
===================================================================
---
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/process.jpdl.xml 2009-04-01
16:30:08 UTC (rev 4379)
+++
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/services/process.jpdl.xml 2009-04-01
19:56:19 UTC (rev 4380)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="simple"
xmlns="http://jbpm.org/4/jpdl">
-
- <start g="16,19,48,48">
- <transition to="state" />
- </start>
-
- <state name="state" g="96,16,75,52">
- <transition to="end" />
- </state>
-
- <end name="end" g="203,19,48,48"/>
-
-</process>
\ No newline at end of file
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
===================================================================
---
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2009-04-01
16:30:08 UTC (rev 4379)
+++
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2009-04-01
19:56:19 UTC (rev 4380)
@@ -54,20 +54,21 @@
single transaction by using the same JDBC connection.
</para>
<section>
- <title>For test</title>
- <para></para>
+ <title>Creating the DB tables</title>
+ <para>In directory <literal>db</literal> the sql scripts to
create
+ the DB schema can be found for the supported databases.
+ </para>
</section>
- <para>This section guides you through the steps that you should
- do to get
+ </section>
+
+ <section id="configurationfiles">
+ <title>Configuration files</title>
+ <para>TODO
</para>
- <section>
- <title>Install DB</title>
- <para></para>
- </section>
- <section>
- <title>Set up a connection</title>
- <para></para>
- </section>
+ <para>In the meantime, see in the examples for a set of example
+ configuration files. Central file is jbpm.cfg.xml. All other files
+ are referenced from that file.
+ </para>
</section>
<section id="graphicalprocessdesigner">
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml 2009-04-01
16:30:08 UTC (rev 4379)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml 2009-04-01
19:56:19 UTC (rev 4380)
@@ -15,6 +15,11 @@
threads in an application. Here's how you can obtain a
<literal>ProcessEngine</literal>
</para>
+ <para>The code snippets in this section and the next section about process
+ deployments are taken from example
+ <literal>org.jbpm.examples.services.ServicesTest</literal>
+ </para>
+
<programlisting>ProcessEngine processEngine = new Configuration()
.buildProcessEngine();</programlisting>
@@ -53,28 +58,24 @@
<section id="deployingaprocess">
<title>Deploying a process</title>
<para>The <literal>RepositoryService</literal> groups all methods
to manage
- the repository of deployments. Each deployment is composed of a set of named
- resources. The content of each resource is a byte array. One type of resources
- is a jPDL process file. Potentially multiple process files can be deployed
- together with resources like forms and other resources.
+ the repository of deployments. In this first example, we'll deploy one process
+ resource from the classpath with the
<literal>RepositoryService</literal>:
</para>
- <para>jPDL process files are recognized by their extension
<literal>.jpdl.xml</literal>.
- In this first example, we'll deploy a process resource from the classpath
- with the <literal>RepositoryService</literal> like this:
- </para>
- <programlisting>repositoryService.createDeployment()
- .addResource("order.jpdl.xml")
+ <programlisting>long deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/services/Order.jpdl.xml")
.deploy();</programlisting>
- <para>Analogue to the <literal>addResource</literal> method above,
the source of
- the processes definitions XML can be picked up from a file, url, string,
- input stream, zip or jar archive and a directory.
+ <para>Analogue to the <literal>addResourceFromClasspath</literal>
method above,
+ the source of the processes definitions XML can be picked up from a file, url,
string,
+ input stream or zip input stream.
</para>
+ <para>Each deployment is composed of a set of named resources. The content
+ of each resource is a byte array. jPDL process files are recognized by their
extension
+ <literal>.jpdl.xml</literal>. Other resource types are task forms and
java classes.
+ </para>
<para>A deployment works with a set of named resources and can potentially
contain
multiple process descriptions and multiple other artifact types. The jPDL deployer
will recognise process files based on the <literal>.jpdl.xml</literal>
- extension automatically. For files not adhering to that naming
- convention, the type can be set programmatically to
<literal>jpdl</literal>
- with method
<literal>setFileType("my-jpdl-process.someotherextension",
"jpdl")</literal>
+ extension automatically.
</para>
<para>During deployment, an <literal>id</literal> is assigned to
the process
definitions. The <literal>id</literal> will have format
@@ -176,6 +177,24 @@
</table>
</section>
+ <section id="undeployingdeployments">
+ <title>Undeploying deployments</title>
+ <para>TODO</para>
+ </section>
+
+ <section id="deletingadeployment">
+ <title>Deleting a deployment</title>
+ <para>Deleting a deployment will remove it from the DB.</para>
+
<programlisting>repositoryService.deleteDeployment(deploymentDbid);</programlisting>
+ <para>That method will throw an exception when there are still active
+ process executions for process definitions in that deployment.
+ </para>
+ <para>If you want to cascade deletion of a deployment to all
+ the process instances of all the process definitions, use
+ <literal>deleteDeploymentCascade</literal>.
+ </para>
+ </section>
+
<section id="startinganewprocessinstance">
<title>Starting a new process instance</title>