[jbpm-commits] JBoss JBPM SVN: r3557 - in jbpm4/trunk/modules/userguide/src/main/docbook/en: images and 1 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Sat Dec 27 06:30:11 EST 2008
Author: tom.baeyens at jboss.com
Date: 2008-12-27 06:30:11 -0500 (Sat, 27 Dec 2008)
New Revision: 3557
Added:
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.gpd.site.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.libraries.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.xml.catalog.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.new.process.file.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.new.process.wizard.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.open.in.xml.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.concurrency.graphbased.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.end.multiple.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.end.processinstance.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.end.state.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.esb.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.exclusive.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.hql.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.java.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.script.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.state.choice.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.state.sequence.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.task.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Gpd.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Variables.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch07-Scripting.xml
Removed:
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/concurrency.graphbased.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.multiple.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.processinstance.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.state.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/esb.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/exclusive.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/hql.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/java.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/script.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/sql.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/state.choice.png
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/state.sequence.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
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Gpd.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Scripting.xml
Modified:
jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
Log:
docs completion
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/concurrency.graphbased.png
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.multiple.png
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.processinstance.png
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.state.png
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/esb.png
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/exclusive.png
===================================================================
(Binary files differ)
Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.gpd.site.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.gpd.site.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.libraries.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.libraries.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.xml.catalog.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.install.xml.catalog.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.new.process.file.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.new.process.file.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.new.process.wizard.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.new.process.wizard.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.open.in.xml.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.open.in.xml.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/gpd.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/hql.png
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/java.png
===================================================================
(Binary files differ)
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.concurrency.graphbased.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/concurrency.graphbased.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.concurrency.graphbased.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.end.multiple.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.multiple.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.end.multiple.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.end.processinstance.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.processinstance.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.end.processinstance.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.end.state.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.state.png)
===================================================================
(Binary files differ)
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.esb.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/esb.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.esb.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.exclusive.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/exclusive.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.exclusive.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.hql.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/hql.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.hql.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.java.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/java.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.java.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.script.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/script.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.script.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.state.choice.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/state.choice.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.state.choice.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.state.sequence.png (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/state.sequence.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.state.sequence.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.task.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.task.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/script.png
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/sql.png
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/state.choice.png
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/state.sequence.png
===================================================================
(Binary files differ)
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml 2008-12-26 15:23:55 UTC (rev 3556)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -3,10 +3,11 @@
<!DOCTYPE book [
<!ENTITY ch01-Introduction SYSTEM "modules/ch01-Introduction.xml">
<!ENTITY ch02-Installation SYSTEM "modules/ch02-Installation.xml">
- <!ENTITY ch03-Services SYSTEM "modules/ch03-Services.xml">
- <!ENTITY ch04-Jpdl SYSTEM "modules/ch04-Jpdl.xml">
- <!ENTITY ch05-Gpd SYSTEM "modules/ch05-Gpd.xml">
- <!ENTITY ch06-Scripting SYSTEM "modules/ch06-Scripting.xml">
+ <!ENTITY ch03-Gpd SYSTEM "modules/ch03-Gpd.xml">
+ <!ENTITY ch04-Services SYSTEM "modules/ch04-Services.xml">
+ <!ENTITY ch05-Jpdl SYSTEM "modules/ch05-Jpdl.xml">
+ <!ENTITY ch06-Variables SYSTEM "modules/ch06-Variables.xml">
+ <!ENTITY ch07-Scripting SYSTEM "modules/ch07-Scripting.xml">
]>
<book lang="en">
@@ -19,9 +20,10 @@
&ch01-Introduction;
&ch02-Installation;
- &ch03-Services;
- &ch04-Jpdl;
- &ch05-Gpd;
- &ch06-Scripting;
+ &ch03-Gpd;
+ &ch04-Services;
+ &ch05-Jpdl;
+ &ch06-Variables;
+ &ch07-Scripting;
</book>
\ 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 2008-12-26 15:23:55 UTC (rev 3556)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -96,6 +96,10 @@
<listitem>Select <literal>Accept</literal> and click <literal>Finish</literal></listitem>
<listitem>Restart eclipse</listitem>
</itemizedlist>
+ <figure id="gpd.install.gpd.site">
+ <title>Adding the GPD local archive site</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/gpd.install.gpd.site.png"/></imageobject></mediaobject>
+ </figure>
</section>
<section>
<title>Define the jBPM User Library</title>
@@ -123,8 +127,35 @@
<listitem>Click <literal>Choose</literal> </listitem>
<listitem>Click <literal>OK</literal> twice to close all the open dialogs</listitem>
</itemizedlist>
+ <figure id="gpd.install.libraries">
+ <title>Defining jBPM Libraries</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/gpd.install.libraries.png"/></imageobject></mediaobject>
+ </figure>
</section>
+
<section>
+ <title>Adding jPDL 4 schema to the catalog</title>
+ <para>In case you want to edit the process XML sources directly, it is best to specify
+ your schema in the XML catalog. This will give you better code completion while
+ editing the process sources.
+ </para>
+ <itemizedlist>
+ <listitem>Click <literal>Window</literal> --> <literal>Preferences</literal> </listitem>
+ <listitem>Select <literal>XML</literal> --> <literal>XML Catalog</literal></listitem>
+ <listitem>Click 'Add...'</listitem>
+ <listitem>The 'Add XML Catalog Entry' dialog opens</listitem>
+ <listitem>Click the button with the map-icon next to location and select 'File System...'</listitem>
+ <listitem>In the dialog that opens, select file <literal>jpdl.xsd</literal>
+ in the src directory of the jBPM installation root.</listitem>
+ <listitem>Click 'Open' and close all the dialogs</listitem>
+ </itemizedlist>
+ <figure id="gpd.install.xml.catalog">
+ <title>Adding jPDL 4 schema to the Catalog</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/gpd.install.xml.catalog.png"/></imageobject></mediaobject>
+ </figure>
+ </section>
+
+ <section>
<title>Importing the Examples</title>
<para>In this section we will import the examples project in the
installation in Eclipse
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Gpd.xml (from rev 3540, jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Gpd.xml)
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Gpd.xml (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Gpd.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -0,0 +1,50 @@
+<chapter id="gpd">
+ <title>GPD</title>
+
+ <para>This chapter will explain how to work with the Graphical Process Designer.
+ After installing the GPD and setting up the examples, you'll see that the
+ jPDL process files will get a special icon. Double clicking such a file
+ in the package view will open up the jPDL process in the GPD.
+ </para>
+ <figure id="gpd">
+ <title>The GPD</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/gpd.png"/></imageobject></mediaobject>
+ </figure>
+
+ <section id="creatingnewprocessfile">
+ <title>Creating a new process file</title>
+ <para>CRTL+N will open up the wizard selector.
+ </para>
+ <figure id="gpd.new.process.wizard">
+ <title>Select wizard dialog</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/gpd.new.process.wizard.png"/></imageobject></mediaobject>
+ </figure>
+ <para>Select jBPM --> jPDL 4 File. Click 'Next >'. Then the
+ 'New jPDL 4 File' wizard opens.
+ </para>
+ <figure id="gpd.new.process.file">
+ <title>Create a new process dialog</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/gpd.new.process.file.png"/></imageobject></mediaobject>
+ </figure>
+ <para>Select the parent directory, enter a file name and click 'Finish'. Voila,
+ you've created your first jPDL process file.
+ </para>
+ </section>
+
+ <section id="editingtheprocesssource">
+ <title>Editing the process source</title>
+ <para>To edit the process XML sources directly, select the process file, right click
+ and select 'Open with...' --> 'XML editor'
+ </para>
+ <figure id="gpd.open.in.xml">
+ <title>Open a process file in XML editor</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/gpd.open.in.xml.png"/></imageobject></mediaobject>
+ </figure>
+ <para>After you've done this, eclipse will remember that and the next time
+ you double click it, eclipse will open your process file in the XML Editor
+ automatically. To open up the process file in the GPD, perform the
+ same Open-with-action, but select 'jPDL 4 Editor'
+ </para>
+ </section>
+
+</chapter>
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Gpd.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: 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-26 15:23:55 UTC (rev 3556)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Services.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -1,292 +0,0 @@
-<chapter id="services">
- <title>Services</title>
-
- <para>Interacting with jBPM occurs through services.
- The service interfaces can be obtained from the <literal>ProcessEngine</literal>
- which is build from a <literal>Configuration</literal>.
- </para>
-
- <section id="processengine">
- <title>ProcessEngine</title>
-
- <para>A <literal>ProcessEngine</literal> is thread safe and can be stored in a
- static member field or even better in JNDI or some other central location.
- One <literal>ProcessEngine</literal> object can be used by all requests and
- threads in an application. Here's how you can obtain a <literal>ProcessEngine</literal>
- </para>
-
- <programlisting>ProcessEngine processEngine = new Configuration()
- .buildProcessEngine();</programlisting>
-
- <para>The previous code snippet shows how to build a <literal>ProcessEngine</literal>
- from the default configuration file <literal>jbpm.cfg.xml</literal> which is
- expected in the root of the classpath. If you want to specify another
- resource location, use the <literal>setResource</literal> method like this:
- </para>
-
- <programlisting>ProcessEngine processEngine = new Configuration()
- .setResource("my-own-configuration-file.xml")
- .buildProcessEngine();</programlisting>
-
- <para>There are other <literal>setXxxx</literal> methods that allow to specify
- the configuration content as an <literal>InputStream</literal>, an
- <literal>xmlString</literal>, <literal>InputSource</literal>,
- <literal>URL</literal> or <literal>File</literal>.
- </para>
-
- <para>From a <literal>ProcessEngine</literal> the following services
- can be obtained:
- </para>
-
- <programlisting><emphasis role="bold">ProcessService</emphasis> processService = processEngine.getProcessService();
-<emphasis role="bold">ExecutionService</emphasis> executionService = processEngine.getExecutionService();
-<emphasis role="bold">ManagementService</emphasis> managementService = processEngine.getManagementService();
-<emphasis role="bold">TaskService</emphasis> taskService = processEngine.getTaskService();</programlisting>
-
- <para>Process engine objects defined in the configuration can also be retrieved by
- type (<literal>processEngine.get(Class<T>)</literal>)
- or by name (<literal>processEngine.get(String)</literal>)</para>
-
- </section>
-
- <section id="deployingaprocess">
- <title>Deploying a process</title>
- <para>The <literal>ProcessService</literal> groups all methods that access
- the repository of process definitions.
- </para>
- <para>A jPDL process file like e.g. <literal>order.jpdl.xml</literal> that is
- accessible as a resource on the classpath can be deployed programmatically with the
- <literal>ProcessService</literal> like this:
- </para>
- <programlisting>processService.createDeployment()
- .addResource("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>
- <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>
- </para>
- <para>During deployment, an <literal>id</literal> is assigned to the process
- definitions. The <literal>id</literal> will have format
- <literal>{key}:{version}</literal>
- </para>
- <para>If <literal>key</literal> is not provided, it is generated automatically
- based on the name. All non alpha numeric characters in the name will be replaced
- by underscores to generate the key.
- </para>
- <para>The same <literal>name</literal> can only be associated to one
- <literal>key</literal> and vice verca.
- </para>
- <para>If <literal>version</literal> is not provided, a <literal>version</literal>
- will be automatically be assigned. For version
- assignment, the versions of all deployed process definitions with the same name will
- be taken into account. The assigned <literal>version</literal> will be one higher
- then the highest <literal>version</literal> number of deployed process definitions
- with the same <literal>key</literal>. If no process definitions with a similar
- <literal>key</literal> have been deployed, version number 1 is assigned.
- </para>
- <para>In this first example, we'll supply a name and nothing else.</para>
- <programlisting><process name="Insurance claim">
-...
-</process></programlisting>
- <para>Let's assume that this is the first time that this process gets deployed.
- Then it will get the following properties:
- </para>
- <table><title>Process properties without key</title>
- <tgroup cols="3" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Property</entry>
- <entry>Value</entry>
- <entry>Source</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>name</literal></entry>
- <entry>Insurance claim</entry>
- <entry>process xml</entry>
- </row>
- <row>
- <entry><literal>key</literal></entry>
- <entry>Insurance_claim</entry>
- <entry>generated</entry>
- </row>
- <row>
- <entry><literal>version</literal></entry>
- <entry>1</entry>
- <entry>generated</entry>
- </row>
- <row>
- <entry><literal>id</literal></entry>
- <entry>Insurance_claim:1</entry>
- <entry>generated</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>And as a second example, we'll show how you can get shorter ids by
- specifying a process key:</para>
- <programlisting><process name="Insurance claim" key="ICL">
-...
-</process></programlisting>
- <para>Then the process definition properties look like this:</para>
- <table><title>Process properties with key</title>
- <tgroup cols="2" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Property</entry>
- <entry>Value</entry>
- <entry>Source</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>name</literal></entry>
- <entry>Insurance claim</entry>
- <entry>process xml</entry>
- </row>
- <row>
- <entry><literal>key</literal></entry>
- <entry>ICL</entry>
- <entry>process xml</entry>
- </row>
- <row>
- <entry><literal>version</literal></entry>
- <entry>1</entry>
- <entry>generated</entry>
- </row>
- <row>
- <entry><literal>id</literal></entry>
- <entry>ICL:1</entry>
- <entry>generated</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
-
- <section id="startinganewprocessinstance">
- <title>Starting a new process instance</title>
-
- <section id="inlatest">
- <title>In latest</title>
- <para>Simplest and most common way to start a new process instance for a process
- definition is like this:
- </para>
- <programlisting>executionService.startExecutionByKey("ICL");</programlisting>
- <para>In this case, the service method will first look up the latest version of
- the processes with key <literal>ICL</literal>. Then a new
- process instance is started in that latest process definition.
- </para>
- <para>When a new version of the insurance claim process
- is deployed, all invocations of <literal>startExecutionByKey</literal>
- will automatically switch to the newly deployed version.
- </para>
- </section>
-
- <section id="specificprocessversion">
- <title>Specific process version</title>
- <para>If instead you want to start a new process instance in a very
- specific version, you can use the id of the process definition like this:
- </para>
- <programlisting>executionService.startExecutionById("ICL:1");</programlisting>
- </section>
-
- <section id="withakey">
- <title>With a key</title>
- <para>A new process instance can optionally be given a key. A key is
- a user defined reference to the execution. A key must be unique within the
- scope of all versions of a process definition. Typically it is easy
- to find such a key in the domain of the business process. For example, an
- order id or an insurance claim number.
- </para>
- <programlisting>executionService.startExecutionByKey("ICL", "CL92837");</programlisting>
- <para>The key is used to create the id of the process instance.
- The format used is <literal>{process-key}/{execution-id}</literal>.
- So execution created in the previous code snippet will have id
- <literal>ICL/CL92837</literal>.
- </para>
- <para>If no user defined key is provided, the DB primary key is taken
- as the key. In that case, the id can be retrieved like this:
- <programlisting>Execution execution = executionService.startExecutionByKey("ICL");
-String executionId = execution.getId();</programlisting>
- </para>
- <para>We recommend the use of a user defined keys. Typically in your application
- code, you'll have the key available. By providing a user defined key, you can
- then compose the id of the execution, rather then performing a query based
- on the process variables.
- </para>
- </section>
-
- <section id="withvariables">
- <title>With variables</title>
- <para>A map of named parameter objects can be provided when starting a
- new process instance. These parameters will be set as variables on the process
- instance between creation and start of the process instance.
- </para>
- <programlisting>Map<String,Object> variables = new HashMap<String,Object>();
-variables.put("customer", "John Doe");
-variables.put("type", "Accident");
-variables.put("amount", new Float(763.74));
-
-executionService.startExecutionByKey("ICL", variables);</programlisting>
- </section>
- </section>
-
- <section id="singallingawaitingexecution">
- <title>Signalling a waiting execution</title>
- <para>A process definition describes what must be done in terms of activities.
- Each activity in a process is either to be performed by the process
- system or by an external participant. When an activity is to be performed
- by an external participant, then the execution must wait until the
- external participant notifies the process system that the activity is
- completed. So an execution is either executing or waiting on an external
- participant. Typically, you'll see that the processes are mostly
- waiting for external participants. Especially humans tend to be slow :-)
- The time consumed by the process system between two wait states is
- typically very small.
- </para>
- <para>A <literal>state</literal> is the basic activity that represents
- something has to be done by an external participant and the execution
- must wait until a signal (aka external trigger) is given.
- </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">
- <title>TaskService</title>
- <para></para>
- </section>
-
- <section id="managementservice">
- <title>ManagementService</title>
- <para></para>
- </section>
-
-</chapter>
\ No newline at end of file
Deleted: 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-26 15:23:55 UTC (rev 3556)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -1,824 +0,0 @@
-<chapter id="jpdl">
- <title>jPDL</title>
-
- <para>This chapter will explain the jPDL file format for describing
- process definitions. The schemadocs can also serve as a quick reference for this
- information.
- </para>
- <para>An example jPDL process file looks like this:
- </para>
- <programlisting><?xml version="1.0" encoding="UTF-8"?>
-
-<process name="Purchase order" xmlns="http://jbpm.org/4/jpdl">
-
- <start>
- <flow to="Verify supplier" />
- </start>
-
- <state name="Verify supplier">
- <flow name="Supplier ok" to="Check supplier data" />
- <flow name="Supplier not ok" to="Error" />
- </state>
-
- <exclusive name="Check supplier data">
- <flow name="nok" to="Error" />
- <flow name="ok" to="Completed" />
- </exclusive>
-
- <end name="Completed" />
-
- <end name="Error" />
-
-</process></programlisting>
-
- <section id="process">
- <title><literal>process</literal></title>
- <para>The top level element representing one process definition.
- </para>
- <table><title><literal>process</literal> attributes:</title>
- <tgroup cols="5" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Attribute</entry>
- <entry>Type</entry>
- <entry>Default</entry>
- <entry>Required?</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>name</literal></entry>
- <entry>any text</entry>
- <entry></entry>
- <entry><emphasis role="bold">required</emphasis></entry>
- <entry>name or label of the process used to display to the process
- name in user interactions.
- </entry>
- </row>
- <row>
- <entry><literal>key</literal></entry>
- <entry>alpha numeric characters and underscores</entry>
- <entry>if omitted, the key will be generated based on the name by replacing
- all non-alpha-numeric characters with underscores</entry>
- <entry>optional</entry>
- <entry>identification to distinct different process definitions.
- Multiple versions of a process with the same key can be deployed.
- The key:name combination must remain exactly the same for all
- deployed versions.
- </entry>
- </row>
- <row>
- <entry><literal>version</literal></entry>
- <entry>integer</entry>
- <entry>one higher then highest version number starting with 1 if no other process
- is deployed with the same name/key.
- </entry>
- <entry>optional</entry>
- <entry>version number of this process</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table><title><literal>process</literal> elements:</title>
- <tgroup cols="3" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Element</entry>
- <entry>Multiplicity</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>description</literal></entry>
- <entry>0..1</entry>
- <entry>description text</entry>
- </row>
- <row>
- <entry><link linkend="activities">activities</link></entry>
- <entry>1..*</entry>
- <entry>a list of any activity type can be placed here. At least
- one <literal>start</literal> activity must be present.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
-
- <section id="activities">
- <title>Activities</title>
- <para>(BPMN note: when we mention activities here, we are not only refering to BPMN
- activities, but also to BPMN events and BPMN gateways.)
- </para>
-
- <section id="start">
- <title><literal>start</literal></title>
- <para>Indicates where an execution for this process starts. Typically there is
- exactly one start activity in a process. A process has to have at least one start
- activity. A start activity must have exactly one outgoing flow and that flow
- is taken when a process execution starts.
- </para>
- <table><title><literal>start</literal> attributes:</title>
- <tgroup cols="5" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Attribute</entry>
- <entry>Type</entry>
- <entry>Default</entry>
- <entry>Required?</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>name</literal></entry>
- <entry>any text</entry>
- <entry></entry>
- <entry>optional</entry>
- <entry>name of the activity. Since a start activity
- cannot have incoming flows, the name is optional.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table><title><literal>start</literal> elements:</title>
- <tgroup cols="3" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Element</entry>
- <entry>Multiplicity</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>flow</literal></entry>
- <entry>1</entry>
- <entry>the outgoing flow</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
-
- <section id="state">
- <title><literal>state</literal></title>
- <para>A wait state. Process execution will wait until an external trigger is
- provided through the API. Apart from the <link linkend="commonactivitycontent">
- common activity content</link>, <literal>state</literal> doesn't have any extra
- attributes or elements.
- </para>
- <section id="statesequence">
- <title><literal>state</literal> sequence</title>
- <para>Let's look at an example which shows states connected with flows
- as a sequence</para>
- <figure id="state.sequence">
- <title>A sequence of states</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/state.sequence.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="StateSequence" xmlns="http://jbpm.org/4/jpdl">
-
- <start>
- <flow to="a" />
- </start>
-
- <state name="a">
- <flow to="b" />
- </state>
-
- <state name="b">
- <flow to="c" />
- </state>
-
- <state name="c" />
-
-</process></programlisting>
- <para>After you start an execution like this:</para>
- <programlisting>Execution execution = executionService.startExecutionByKey("StateSequence");</programlisting>
- <para>the created process instance will be positioned in
- state <literal>a</literal>. Providing an external trigger can
- be done with the <literal>signalExecution</literal> methods.</para>
- <programlisting>String executionId = execution.getId();
-execution = executionService.signalExecutionById(executionId);</programlisting>
- </section>
- <section id="statechoice">
- <title><literal>state</literal> choice</title>
- <para>In this second example with states, we'll show how you can use a
- <literal>state</literal> can be used to feed in an external choice of
- the path to take.
- </para>
- <figure id="state.choice">
- <title>A choice between state</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/state.choice.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="StateChoice" xmlns="http://jbpm.org/4/jpdl">
-
- <start>
- <flow to="wait for response" />
- </start>
-
- <state name="wait for response">
- <flow name="accept" to="submit document" />
- <flow name="reject" to="try again" />
- </state>
-
- <state name="submit document" />
-
- <state name="try again" />
-
-</process></programlisting>
- <para>Let's start a new process instance for this process definition:</para>
- <programlisting>Execution execution = executionService.startExecutionByKey("StateSequence");</programlisting>
- <para>Now, the execution is arrived in the <literal>wait for response</literal>.
- The execution will wait there until an external trigger is given. In case
- a <literal>state</literal> has multiple outgoing flows, the signalName given
- in the external trigger will be matched against the name of the outgoing flow
- to take. So when we provide signalName <literal>accept</literal> like this:
- </para>
- <programlisting>executionService.signalExecutionById(executionId, "accept");</programlisting>
- <para>Then the execution will continue over the outgoing flow named
- <literal>accept</literal>. Analogue, when signalName <literal>reject</literal>
- is given in the signalExecutionXxx methods, the execution will continue over
- the outgoing flow named reject.
- </para>
- </section>
- </section>
-
- <section id="java">
- <title><literal>java</literal></title>
- <para>The Java task. A process execution will execute the method of the class that is configured
- in this task.</para>
- <table><title><literal>java</literal> attributes:</title>
- <tgroup cols="5" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Attribute</entry>
- <entry>Type</entry>
- <entry>Default</entry>
- <entry>Required?</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>class</literal></entry>
- <entry></entry>
- <entry></entry>
- <entry></entry>
- <entry></entry>
- </row>
- <row>
- <entry><literal>method</literal></entry>
- <entry></entry>
- <entry></entry>
- <entry></entry>
- <entry></entry>
- </row>
- <row>
- <entry><literal>var</literal></entry>
- <entry></entry>
- <entry></entry>
- <entry></entry>
- <entry></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table><title><literal>java</literal> elements:</title>
- <tgroup cols="3" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Element</entry>
- <entry>Multiplicity</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>field</literal></entry>
- <entry></entry>
- <entry></entry>
- </row>
- <row>
- <entry><literal>arg</literal></entry>
- <entry></entry>
- <entry></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>Consider the following example.</para>
- <figure id="java">
- <title>A java task</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/java.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="Java" xmlns="http://jbpm.org/4/jpdl">
-
- <start>
- <flow to="invoke java method" />
- </start>
-
- <java name="invoke java method"
- class="org.jbpm.examples.java.JohnDoe"
- method="hello"
- var="answer">
-
- <field name="state"><string value="fine"/></field>
- <field name="session"><env type="org.hibernate.Session"/></field>
-
- <arg><string value="Hi, how are you?"/></arg>
-
- <flow to="wait" />
- </java>
-
- <state name="wait">
-
-</process>
- </programlisting>
- <para>The java task specifies that during its execution an instance of the class <literal>org.jbpm.examples.java.JohnDoe</literal>
- will be instantiated and the method <literal>hello</literal> of this class will be invoked on the resulting object. The variable named
- <literal>answer</literal> will contain the result of the invocation. Let's look at the class <literal>JohnDoe</literal> below.
- </para>
- <programlisting>package org.jbpm.examples.java;
-
-import org.hibernate.Session;
-
-public class JohnDoe {
-
- String state;
- Session session;
-
- public String hello(String msg) {
- if ( (msg.indexOf("how are you?")!=-1)
- && (session.isOpen())
- ) {
- return "I'm "+state+", thank you.";
- }
- return null;
- }
-}
- </programlisting>
- <para>The class above reveals that it contains two fields named <literal>state</literal> and <literal>session</literal>
- and that the method <literal>hello</literal> accepts one argument. During the execution the values specified in the
- <literal>field</literal> and <literal>arg</literal> configuration elements will be used. The expected result of creating
- a process instance is that the process variable <literal>answer</literal> contains the string
- <literal>I'm fine, thank you.</literal>.
- </para>
- </section>
-
- <section id="script">
- <title><literal>script</literal></title>
- </section>
-
- <section id="esb">
- <title><literal>esb</literal></title>
- </section>
-
- <section id="sql">
- <title><literal>sql</literal></title>
- </section>
-
- <section id="hql">
- <title><literal>hql</literal></title>
- </section>
-
- <section id="task">
- <title><literal>task</literal></title>
- </section>
-
- <section id="exclusive">
- <title><literal>exclusive</literal></title>
- <para>Takes one path of many alternatives. Also known as a decision. An exclusive
- activity has multiple outgoing flows and when an execution arrives in an exclusive
- activity, an automatic evaluation will decide which outgoing flow is taken.
- </para>
- <para>An exclusive activity should be configured in one of the three following ways:
- </para>
-
- <section id="exclusiveconditions">
- <title>Exclusive conditions</title>
- <para>An exclusive with conditions on the flows evaluates the condition in each flow.
- The first flow for which the nested condition expression resolves to true or which does
- not have a condition is taken.
- </para>
- <table><title><literal>exclusive.flow.condition</literal> attributes:</title>
- <tgroup cols="5" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Attribute</entry>
- <entry>Type</entry>
- <entry>Default</entry>
- <entry>Required?</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>expr</literal></entry>
- <entry>expression</entry>
- <entry></entry>
- <entry><emphasis role="bold">required</emphasis></entry>
- <entry>script that will be evaluated in the specified
- expression language.
- </entry>
- </row>
- <row>
- <entry><literal>lang</literal></entry>
- <entry>expression language</entry>
- <entry>the <literal>default-expression-language</literal> taken from the <link linkend="scripting"><literal>script-manager</literal> configuration</link></entry>
- <entry>optional</entry>
- <entry>the language in which <literal>expr</literal> is
- to be evaluated.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>Example:
- </para>
- <figure id="exclusive">
- <title>The exclusive gateway</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/exclusive.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="ExclusiveConditions" >
-
- <start>
- <flow to="evaluate document" />
- </start>
-
- <exclusive name="evaluate document">
- <flow to="submit document">
- <emphasis role="bold"><condition expr="#{content=="good"}" /></emphasis>
- </flow>
- <flow to="try again">
- <emphasis role="bold"><condition expr="#{content=="not so good"}" /></emphasis>
- </flow>
- <flow to="give up" />
- </exclusive>
-
- <state name="submit document" />
-
- <state name="try again" />
-
- <state name="give up" />
-
-</process></programlisting>
- </section>
-
- <section id="exclusiveexpression">
- <title>Exclusive expression</title>
- <para>An exclusive expression evaluates to a String representing the name of
- an outgoing flow.
- </para>
- <table><title><literal>exclusive</literal> attributes:</title>
- <tgroup cols="5" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Attribute</entry>
- <entry>Type</entry>
- <entry>Default</entry>
- <entry>Required?</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>expr</literal></entry>
- <entry>expression</entry>
- <entry></entry>
- <entry><emphasis role="bold">required</emphasis></entry>
- <entry>script that will be evaluated in the specified
- expression language.
- </entry>
- </row>
- <row>
- <entry><literal>lang</literal></entry>
- <entry>expression language</entry>
- <entry>the <literal>default-expression-language</literal> taken from the <link linkend="scripting"><literal>script-manager</literal> configuration</link></entry>
- <entry>optional</entry>
- <entry>the language in which <literal>expr</literal> is
- to be evaluated.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>Example:
- </para>
- <para>Same picture as <link linkend="exclusive">above</link>.
- </para>
- <programlisting><process name="Poolcar">
- <start>
- <flow to="How far?" />
- </start>
- <exclusive name="How far?" <emphasis role="bold">expr="#{distance}"</emphasis>>
- <flow name="far" to="Big car" />
- <flow name="nearby" to="Small car" />
- </exclusive>
- <state name="Big car" />
- <state name="Small car" />
-</process></programlisting>
- <para>When you start an new process instance like this
- </para>
- <programlisting>Map<String, Object> variables = new HashMap<String, Object>();
-variables.put("distance", "far");
-Execution execution = executionService.startExecutionByKey("Poolcar", variables);</programlisting>
- <para>then the new execution will go to node <literal>Big car</literal>.</para>
- </section>
-
- <section id="exclusivehandler">
- <title>Exclusive handler</title>
- <para>An exclusive handler is a java class that implements the
- <literal>ExclusiveHandler</literal> interface. The exclusive handler
- will be responsible for selecting the name of the outgoing flow.
- </para>
- <programlisting>public interface ExclusiveHandler {
- String select(OpenExecution execution);
-}</programlisting>
- <para>The handler is specified as a sub element of the exclusive</para>
- <table><title><literal>exclusive.handler</literal> attributes:</title>
- <tgroup cols="5" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Attribute</entry>
- <entry>Type</entry>
- <entry>Default</entry>
- <entry>Required?</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>class</literal></entry>
- <entry>classname</entry>
- <entry></entry>
- <entry><emphasis role="bold">required</emphasis></entry>
- <entry>fully qualified classname of the handler implementation class.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>Here's an example process of an exclusive using an ExclusiveHandler:</para>
- <para>Same picture as <link linkend="exclusive">above</link>.
- </para>
- <programlisting><process name="ExclusiveHandler">
-
- <start>
- <flow to="evaluate document" />
- </start>
-
- <exclusive name="evaluate document">
- <handler class="org.jbpm.examples.exclusive.handler.ContentEvaluation" />
- <flow name="good" to="submit document" />
- <flow name="bad" to="try again" />
- <flow name="ugly" to="give up" />
- </exclusive>
-
- <state name="submit document" />
-
- <state name="try again" />
-
- <state name="give up" />
-
-</process></programlisting>
- <para>The ContentEvaluation class looks like this</para>
- <programlisting>public class ContentEvaluation implements ExclusiveHandler {
-
- public String select(OpenExecution execution) {
- String content = (String) execution.getVariable("content");
- if (content.equals("you're great")) {
- return "good";
- }
- if (content.equals("you gotta improve")) {
- return "bad";
- }
- return "ugly";
- }
-}</programlisting>
- <para>Now, when we start a process instance and supply value
- <literal>you're great</literal> for variable content, then the
- ContentEvaluation will return String <literal>good</literal> and
- the process instance will arrive in node <literal>Submit document</literal>.
- </para>
- </section>
-
- </section>
-
- <section id="end">
- <title><literal>end</literal></title>
- <para>Ends the execution.
- </para>
- <section id="endprocessinstance">
- <title><literal>end</literal> process instance</title>
- <para>By default, an end activity will end the complete
- process instance. In case multiple concurrent executions
- are still active within the same process instance, all of
- them will be ended.
- </para>
- <figure id="end.processinstance">
- <title>The end event</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/end.processinstance.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="EndProcessInstance" xmlns="http://jbpm.org/4/jpdl">
-
- <start>
- <flow to="end" />
- </start>
-
- <end name="end" />
-
-</process></programlisting>
- <para>When a new process instance is created, it immediately ends.</para>
- </section>
- <section id="endexecution">
- <title><literal>end</literal> execution</title>
- <para>Only the execution that arrives in the
- end activity will be ended and other concurrent executions
- should be left active. To get this behaviour, set
- attribute <literal>ends="execution"</literal>
- </para>
- <table><title><literal>end</literal> execution attributes:</title>
- <tgroup cols="5" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Attribute</entry>
- <entry>Type</entry>
- <entry>Default</entry>
- <entry>Required?</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>ends</literal></entry>
- <entry>{processinstance|execution}</entry>
- <entry>processinstance</entry>
- <entry>optional</entry>
- <entry>specifies if the whole process instance should be ended or
- just the path of execution that arrives in the end activity.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- <section id="endmultiple">
- <title><literal>end</literal> multiple</title>
- <para>A process can have multiple end events. This can be handy to indicate
- different outcomes of a process instance. For example
- </para>
- <figure id="end.multiple">
- <title>Multiple end events</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/end.multiple.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="EndMultiple" xmlns="http://;jbpm.org/4/jpdl">
-
- <start>
- <flow to="get return code" />
- <start>
-
- <state name="get return code">
- <flow name="200" to="ok"/>
- <flow name="400" to="bad request"/>
- <flow name="500" to="internal server error"/>
- </state>
-
- <end name="ok"/>
- <end name="bad request"/>
- <end name="internal server error"/>
-
-</process>
- </programlisting>
- <para>Now if we would start an execution and signal it to move out of the <literal>get return code</literal> wait state with the
- following code, the execution would end with the <literal>bad request</literal> end event.</para>
- <programlisting>Execution execution = executionService.startExecutionByKey("EndMultiple");
-String executionId = execution.getId();
-execution = executionService.signalExecutionById(executionId, "400");
- </programlisting>
- <para>Likewise, using the value <literal>200</literal> or <literal>500</literal> would cause the execution
- to end with the <literal>ok</literal> or with the <literal>internal server error</literal> end events
- respectively.</para>
- </section>
-
- <section id="endstate">
- <title><literal>end</literal> state</title>
- <para>An execution can also end with different states. It is another way to specify the outcome of a process.
- It is indicated by the <literal>state</literal> attribute of the end event or by the <literal>end-cancel</literal>
- and <literal>end-error</literal> shortcut notations.
- </para>
-
- <table><title><literal>end</literal> execution attributes:</title>
- <tgroup cols="5" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Attribute</entry>
- <entry>Type</entry>
- <entry>Default</entry>
- <entry>Required?</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>state</literal></entry>
- <entry>String</entry>
- <entry></entry>
- <entry>optional</entry>
- <entry>the state assigned to the execution.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <para>Take for example the following process.
- </para>
- <figure id="end.state">
- <title>Different end states</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/end.state.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="EndState" xmlns="http://jbpm.org/4/jpdl">
-
- <start>
- <flow to="get return code"/>
- </start>
-
- <state name="get return code">
- <flow name="200" to="ok"/>
- <flow name="400" to="bad request" />
- <flow name="500" to="internal server error"/>
- </state>
-
- <end name="ok" state="completed"/>
- <end-cancel name="bad request"/>
- <end-error name="internal server error"/>
-
-</process>
- </programlisting>
- <para>This time, if we would start an execution and signal it to move out of the <literal>get return code</literal> wait state with the
- following code, the execution would end with the <literal>cancel</literal> state.</para>
- <programlisting>Execution execution = executionService.startExecutionByKey("EndState");
-String executionId = execution.getId();
-execution = executionService.signalExecutionById(executionId, "400");
- </programlisting>
- <para>Similarly as above, using the value <literal>200</literal> or <literal>500</literal> would cause the execution
- to end with the <literal>completed</literal> or with the <literal>error</literal> states
- respectively.</para>
-
- </section>
- </section>
-
- <section id="commonactivitycontents">
- <title>Common activity contents</title>
- <para>Unless specified otherwise above, all activities also include this
- content model:
- </para>
- <table><title>Common activity attributes:</title>
- <tgroup cols="5" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Attribute</entry>
- <entry>Type</entry>
- <entry>Default</entry>
- <entry>Required?</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>name</literal></entry>
- <entry>any text</entry>
- <entry></entry>
- <entry><emphasis role="bold">required</emphasis></entry>
- <entry>name of the activity</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table><title>Common activity elements:</title>
- <tgroup cols="3" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Element</entry>
- <entry>Multiplicity</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>flow</literal></entry>
- <entry>0..*</entry>
- <entry>the outgoing flows</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- </section>
-
-</chapter>
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml (from rev 3540, jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Services.xml)
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -0,0 +1,292 @@
+<chapter id="services">
+ <title>Services</title>
+
+ <para>Interacting with jBPM occurs through services.
+ The service interfaces can be obtained from the <literal>ProcessEngine</literal>
+ which is build from a <literal>Configuration</literal>.
+ </para>
+
+ <section id="processengine">
+ <title>ProcessEngine</title>
+
+ <para>A <literal>ProcessEngine</literal> is thread safe and can be stored in a
+ static member field or even better in JNDI or some other central location.
+ One <literal>ProcessEngine</literal> object can be used by all requests and
+ threads in an application. Here's how you can obtain a <literal>ProcessEngine</literal>
+ </para>
+
+ <programlisting>ProcessEngine processEngine = new Configuration()
+ .buildProcessEngine();</programlisting>
+
+ <para>The previous code snippet shows how to build a <literal>ProcessEngine</literal>
+ from the default configuration file <literal>jbpm.cfg.xml</literal> which is
+ expected in the root of the classpath. If you want to specify another
+ resource location, use the <literal>setResource</literal> method like this:
+ </para>
+
+ <programlisting>ProcessEngine processEngine = new Configuration()
+ .setResource("my-own-configuration-file.xml")
+ .buildProcessEngine();</programlisting>
+
+ <para>There are other <literal>setXxxx</literal> methods that allow to specify
+ the configuration content as an <literal>InputStream</literal>, an
+ <literal>xmlString</literal>, <literal>InputSource</literal>,
+ <literal>URL</literal> or <literal>File</literal>.
+ </para>
+
+ <para>From a <literal>ProcessEngine</literal> the following services
+ can be obtained:
+ </para>
+
+ <programlisting><emphasis role="bold">ProcessService</emphasis> processService = processEngine.getProcessService();
+<emphasis role="bold">ExecutionService</emphasis> executionService = processEngine.getExecutionService();
+<emphasis role="bold">ManagementService</emphasis> managementService = processEngine.getManagementService();
+<emphasis role="bold">TaskService</emphasis> taskService = processEngine.getTaskService();</programlisting>
+
+ <para>Process engine objects defined in the configuration can also be retrieved by
+ type (<literal>processEngine.get(Class<T>)</literal>)
+ or by name (<literal>processEngine.get(String)</literal>)</para>
+
+ </section>
+
+ <section id="deployingaprocess">
+ <title>Deploying a process</title>
+ <para>The <literal>ProcessService</literal> groups all methods that access
+ the repository of process definitions.
+ </para>
+ <para>A jPDL process file like e.g. <literal>order.jpdl.xml</literal> that is
+ accessible as a resource on the classpath can be deployed programmatically with the
+ <literal>ProcessService</literal> like this:
+ </para>
+ <programlisting>processService.createDeployment()
+ .addResource("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>
+ <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>
+ </para>
+ <para>During deployment, an <literal>id</literal> is assigned to the process
+ definitions. The <literal>id</literal> will have format
+ <literal>{key}:{version}</literal>
+ </para>
+ <para>If <literal>key</literal> is not provided, it is generated automatically
+ based on the name. All non alpha numeric characters in the name will be replaced
+ by underscores to generate the key.
+ </para>
+ <para>The same <literal>name</literal> can only be associated to one
+ <literal>key</literal> and vice verca.
+ </para>
+ <para>If <literal>version</literal> is not provided, a <literal>version</literal>
+ will be automatically be assigned. For version
+ assignment, the versions of all deployed process definitions with the same name will
+ be taken into account. The assigned <literal>version</literal> will be one higher
+ then the highest <literal>version</literal> number of deployed process definitions
+ with the same <literal>key</literal>. If no process definitions with a similar
+ <literal>key</literal> have been deployed, version number 1 is assigned.
+ </para>
+ <para>In this first example, we'll supply a name and nothing else.</para>
+ <programlisting><process name="Insurance claim">
+...
+</process></programlisting>
+ <para>Let's assume that this is the first time that this process gets deployed.
+ Then it will get the following properties:
+ </para>
+ <table><title>Process properties without key</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Property</entry>
+ <entry>Value</entry>
+ <entry>Source</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>name</literal></entry>
+ <entry>Insurance claim</entry>
+ <entry>process xml</entry>
+ </row>
+ <row>
+ <entry><literal>key</literal></entry>
+ <entry>Insurance_claim</entry>
+ <entry>generated</entry>
+ </row>
+ <row>
+ <entry><literal>version</literal></entry>
+ <entry>1</entry>
+ <entry>generated</entry>
+ </row>
+ <row>
+ <entry><literal>id</literal></entry>
+ <entry>Insurance_claim:1</entry>
+ <entry>generated</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>And as a second example, we'll show how you can get shorter ids by
+ specifying a process key:</para>
+ <programlisting><process name="Insurance claim" key="ICL">
+...
+</process></programlisting>
+ <para>Then the process definition properties look like this:</para>
+ <table><title>Process properties with key</title>
+ <tgroup cols="2" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Property</entry>
+ <entry>Value</entry>
+ <entry>Source</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>name</literal></entry>
+ <entry>Insurance claim</entry>
+ <entry>process xml</entry>
+ </row>
+ <row>
+ <entry><literal>key</literal></entry>
+ <entry>ICL</entry>
+ <entry>process xml</entry>
+ </row>
+ <row>
+ <entry><literal>version</literal></entry>
+ <entry>1</entry>
+ <entry>generated</entry>
+ </row>
+ <row>
+ <entry><literal>id</literal></entry>
+ <entry>ICL:1</entry>
+ <entry>generated</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section id="startinganewprocessinstance">
+ <title>Starting a new process instance</title>
+
+ <section id="inlatest">
+ <title>In latest</title>
+ <para>Simplest and most common way to start a new process instance for a process
+ definition is like this:
+ </para>
+ <programlisting>executionService.startExecutionByKey("ICL");</programlisting>
+ <para>In this case, the service method will first look up the latest version of
+ the processes with key <literal>ICL</literal>. Then a new
+ process instance is started in that latest process definition.
+ </para>
+ <para>When a new version of the insurance claim process
+ is deployed, all invocations of <literal>startExecutionByKey</literal>
+ will automatically switch to the newly deployed version.
+ </para>
+ </section>
+
+ <section id="specificprocessversion">
+ <title>Specific process version</title>
+ <para>If instead you want to start a new process instance in a very
+ specific version, you can use the id of the process definition like this:
+ </para>
+ <programlisting>executionService.startExecutionById("ICL:1");</programlisting>
+ </section>
+
+ <section id="withakey">
+ <title>With a key</title>
+ <para>A new process instance can optionally be given a key. A key is
+ a user defined reference to the execution. A key must be unique within the
+ scope of all versions of a process definition. Typically it is easy
+ to find such a key in the domain of the business process. For example, an
+ order id or an insurance claim number.
+ </para>
+ <programlisting>executionService.startExecutionByKey("ICL", "CL92837");</programlisting>
+ <para>The key is used to create the id of the process instance.
+ The format used is <literal>{process-key}/{execution-id}</literal>.
+ So execution created in the previous code snippet will have id
+ <literal>ICL/CL92837</literal>.
+ </para>
+ <para>If no user defined key is provided, the DB primary key is taken
+ as the key. In that case, the id can be retrieved like this:
+ <programlisting>Execution execution = executionService.startExecutionByKey("ICL");
+String executionId = execution.getId();</programlisting>
+ </para>
+ <para>We recommend the use of a user defined keys. Typically in your application
+ code, you'll have the key available. By providing a user defined key, you can
+ then compose the id of the execution, rather then performing a query based
+ on the process variables.
+ </para>
+ </section>
+
+ <section id="withvariables">
+ <title>With variables</title>
+ <para>A map of named parameter objects can be provided when starting a
+ new process instance. These parameters will be set as variables on the process
+ instance between creation and start of the process instance.
+ </para>
+ <programlisting>Map<String,Object> variables = new HashMap<String,Object>();
+variables.put("customer", "John Doe");
+variables.put("type", "Accident");
+variables.put("amount", new Float(763.74));
+
+executionService.startExecutionByKey("ICL", variables);</programlisting>
+ </section>
+ </section>
+
+ <section id="singallingawaitingexecution">
+ <title>Signalling a waiting execution</title>
+ <para>A process definition describes what must be done in terms of activities.
+ Each activity in a process is either to be performed by the process
+ system or by an external participant. When an activity is to be performed
+ by an external participant, then the execution must wait until the
+ external participant notifies the process system that the activity is
+ completed. So an execution is either executing or waiting on an external
+ participant. Typically, you'll see that the processes are mostly
+ waiting for external participants. Especially humans tend to be slow :-)
+ The time consumed by the process system between two wait states is
+ typically very small.
+ </para>
+ <para>A <literal>state</literal> is the basic activity that represents
+ something has to be done by an external participant and the execution
+ must wait until a signal (aka external trigger) is given.
+ </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">
+ <title>TaskService</title>
+ <para></para>
+ </section>
+
+ <section id="managementservice">
+ <title>ManagementService</title>
+ <para></para>
+ </section>
+
+</chapter>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Gpd.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Gpd.xml 2008-12-26 15:23:55 UTC (rev 3556)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Gpd.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -1,7 +0,0 @@
-<chapter id="gpd">
- <title>GPD</title>
-
- <para>This chapter will explain how to work with the Graphical Process Designer.
- </para>
-
-</chapter>
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml (from rev 3549, jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml)
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -0,0 +1,1252 @@
+<chapter id="jpdl">
+ <title>jPDL</title>
+
+ <para>This chapter will explain the jPDL file format for describing
+ process definitions. The schemadocs can also serve as a quick reference for this
+ information.
+ </para>
+ <para>An example jPDL process file looks like this:
+ </para>
+ <programlisting><?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Purchase order" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="Verify supplier" />
+ </start>
+
+ <state name="Verify supplier">
+ <flow name="Supplier ok" to="Check supplier data" />
+ <flow name="Supplier not ok" to="Error" />
+ </state>
+
+ <exclusive name="Check supplier data">
+ <flow name="nok" to="Error" />
+ <flow name="ok" to="Completed" />
+ </exclusive>
+
+ <end name="Completed" />
+
+ <end name="Error" />
+
+</process></programlisting>
+
+ <section id="process">
+ <title><literal>process</literal></title>
+ <para>The top level element representing one process definition.
+ </para>
+ <table><title><literal>process</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>name</literal></entry>
+ <entry>any text</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>name or label of the process used to display to the process
+ name in user interactions.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>key</literal></entry>
+ <entry>alpha numeric characters and underscores</entry>
+ <entry>if omitted, the key will be generated based on the name by replacing
+ all non-alpha-numeric characters with underscores</entry>
+ <entry>optional</entry>
+ <entry>identification to distinct different process definitions.
+ Multiple versions of a process with the same key can be deployed.
+ The key:name combination must remain exactly the same for all
+ deployed versions.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>version</literal></entry>
+ <entry>integer</entry>
+ <entry>one higher then highest version number starting with 1 if no other process
+ is deployed with the same name/key.
+ </entry>
+ <entry>optional</entry>
+ <entry>version number of this process</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table><title><literal>process</literal> elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>description</literal></entry>
+ <entry>0..1</entry>
+ <entry>description text</entry>
+ </row>
+ <row>
+ <entry><link linkend="activities">activities</link></entry>
+ <entry>1..*</entry>
+ <entry>a list of any activity type can be placed here. At least
+ one <literal>start</literal> activity must be present.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section id="activities">
+ <title>Activities</title>
+ <para>(BPMN note: when we mention activities here, we are not only refering to BPMN
+ activities, but also to BPMN events and BPMN gateways.)
+ </para>
+
+ <section id="start">
+ <title><literal>start</literal></title>
+ <para>Indicates where an execution for this process starts. Typically there is
+ exactly one start activity in a process. A process has to have at least one start
+ activity. A start activity must have exactly one outgoing flow and that flow
+ is taken when a process execution starts.
+ </para>
+ <para>Known limitation: for now, a process can not have more then
+ one <literal>start</literal>.
+ </para>
+ <table><title><literal>start</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>name</literal></entry>
+ <entry>any text</entry>
+ <entry></entry>
+ <entry>optional</entry>
+ <entry>name of the activity. Since a start activity
+ cannot have incoming flows, the name is optional.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table><title><literal>start</literal> elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>flow</literal></entry>
+ <entry>1</entry>
+ <entry>the outgoing flow</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section id="state">
+ <title><literal>state</literal></title>
+ <para>A wait state. Process execution will wait until an external trigger is
+ provided through the API. Apart from the <link linkend="commonactivitycontent">
+ common activity content</link>, <literal>state</literal> doesn't have any extra
+ attributes or elements.
+ </para>
+ <section id="statesequence">
+ <title><literal>state</literal> sequence</title>
+ <para>Let's look at an example which shows states connected with flows
+ as a sequence</para>
+ <figure id="process.state.sequence">
+ <title>A sequence of states</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.state.sequence.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="StateSequence" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="a" />
+ </start>
+
+ <state name="a">
+ <flow to="b" />
+ </state>
+
+ <state name="b">
+ <flow to="c" />
+ </state>
+
+ <state name="c" />
+
+</process></programlisting>
+ <para>After you start an execution like this:</para>
+ <programlisting>Execution execution = executionService.startExecutionByKey("StateSequence");</programlisting>
+ <para>the created process instance will be positioned in
+ state <literal>a</literal>. Providing an external trigger can
+ be done with the <literal>signalExecution</literal> methods.</para>
+ <programlisting>String executionId = execution.getId();
+execution = executionService.signalExecutionById(executionId);</programlisting>
+ </section>
+ <section id="statechoice">
+ <title><literal>state</literal> choice</title>
+ <para>In this second example with states, we'll show how you can use a
+ <literal>state</literal> can be used to feed in an external choice of
+ the path to take.
+ </para>
+ <figure id="process.state.choice">
+ <title>A choice between state</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.state.choice.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="StateChoice" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="wait for response" />
+ </start>
+
+ <state name="wait for response">
+ <flow name="accept" to="submit document" />
+ <flow name="reject" to="try again" />
+ </state>
+
+ <state name="submit document" />
+
+ <state name="try again" />
+
+</process></programlisting>
+ <para>Let's start a new process instance for this process definition:</para>
+ <programlisting>Execution execution = executionService.startExecutionByKey("StateSequence");</programlisting>
+ <para>Now, the execution is arrived in the <literal>wait for response</literal>.
+ The execution will wait there until an external trigger is given. In case
+ a <literal>state</literal> has multiple outgoing flows, the signalName given
+ in the external trigger will be matched against the name of the outgoing flow
+ to take. So when we provide signalName <literal>accept</literal> like this:
+ </para>
+ <programlisting>executionService.signalExecutionById(executionId, "accept");</programlisting>
+ <para>Then the execution will continue over the outgoing flow named
+ <literal>accept</literal>. Analogue, when signalName <literal>reject</literal>
+ is given in the signalExecutionXxx methods, the execution will continue over
+ the outgoing flow named reject.
+ </para>
+ </section>
+ </section>
+
+ <section id="exclusive">
+ <title><literal>exclusive</literal></title>
+ <para>Takes one path of many alternatives. Also known as a decision. An exclusive
+ activity has multiple outgoing flows and when an execution arrives in an exclusive
+ activity, an automatic evaluation will decide which outgoing flow is taken.
+ </para>
+ <para>An exclusive activity should be configured in one of the three following ways:
+ </para>
+
+ <section id="exclusiveconditions">
+ <title>Exclusive conditions</title>
+ <para>An exclusive with conditions on the flows evaluates the condition in each flow.
+ The first flow for which the nested condition expression resolves to true or which does
+ not have a condition is taken.
+ </para>
+ <table><title><literal>exclusive.flow.condition</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>expr</literal></entry>
+ <entry>expression</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>script that will be evaluated in the specified
+ expression language.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>lang</literal></entry>
+ <entry>expression language</entry>
+ <entry>the <literal>default-expression-language</literal> taken from the <link linkend="scripting"><literal>script-manager</literal> configuration</link></entry>
+ <entry>optional</entry>
+ <entry>the language in which <literal>expr</literal> is
+ to be evaluated.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>Example:
+ </para>
+ <figure id="process.exclusive.condition">
+ <title>The exclusive conditions example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.exclusive.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="ExclusiveConditions" >
+
+ <start>
+ <flow to="evaluate document" />
+ </start>
+
+ <exclusive name="evaluate document">
+ <flow to="submit document">
+ <emphasis role="bold"><condition expr="#{content=="good"}" /></emphasis>
+ </flow>
+ <flow to="try again">
+ <emphasis role="bold"><condition expr="#{content=="not so good"}" /></emphasis>
+ </flow>
+ <flow to="give up" />
+ </exclusive>
+
+ <state name="submit document" />
+
+ <state name="try again" />
+
+ <state name="give up" />
+
+</process></programlisting>
+ </section>
+
+ <section id="exclusiveexpression">
+ <title>Exclusive expression</title>
+ <para>An exclusive expression evaluates to a String representing the name of
+ an outgoing flow.
+ </para>
+ <table><title><literal>exclusive</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>expr</literal></entry>
+ <entry>expression</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>script that will be evaluated in the specified
+ expression language.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>lang</literal></entry>
+ <entry>expression language</entry>
+ <entry>the <literal>default-expression-language</literal> taken from the <link linkend="scripting"><literal>script-manager</literal> configuration</link></entry>
+ <entry>optional</entry>
+ <entry>the language in which <literal>expr</literal> is
+ to be evaluated.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>Example:
+ </para>
+ <figure id="process.exclusive.expression">
+ <title>The exclusive expression example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.exclusive.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="Poolcar">
+ <start>
+ <flow to="How far?" />
+ </start>
+ <exclusive name="How far?" <emphasis role="bold">expr="#{distance}"</emphasis>>
+ <flow name="far" to="Big car" />
+ <flow name="nearby" to="Small car" />
+ </exclusive>
+ <state name="Big car" />
+ <state name="Small car" />
+</process></programlisting>
+ <para>When you start an new process instance like this
+ </para>
+ <programlisting>Map<String, Object> variables = new HashMap<String, Object>();
+variables.put("distance", "far");
+Execution execution = executionService.startExecutionByKey("Poolcar", variables);</programlisting>
+ <para>then the new execution will go to node <literal>Big car</literal>.</para>
+ </section>
+
+ <section id="exclusivehandler">
+ <title>Exclusive handler</title>
+ <para>An exclusive handler is a java class that implements the
+ <literal>ExclusiveHandler</literal> interface. The exclusive handler
+ will be responsible for selecting the name of the outgoing flow.
+ </para>
+ <programlisting>public interface ExclusiveHandler {
+ String select(OpenExecution execution);
+}</programlisting>
+ <para>The handler is specified as a sub element of the exclusive</para>
+ <table><title><literal>exclusive.handler</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>class</literal></entry>
+ <entry>classname</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>fully qualified classname of the handler implementation class.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>Here's an example process of an exclusive using an ExclusiveHandler:</para>
+ <figure id="process.exclusive.handler">
+ <title>The exclusive handler example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.exclusive.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="ExclusiveHandler">
+
+ <start>
+ <flow to="evaluate document" />
+ </start>
+
+ <exclusive name="evaluate document">
+ <handler class="org.jbpm.examples.exclusive.handler.ContentEvaluation" />
+ <flow name="good" to="submit document" />
+ <flow name="bad" to="try again" />
+ <flow name="ugly" to="give up" />
+ </exclusive>
+
+ <state name="submit document" />
+
+ <state name="try again" />
+
+ <state name="give up" />
+
+</process></programlisting>
+ <para>The ContentEvaluation class looks like this</para>
+ <programlisting>public class ContentEvaluation implements ExclusiveHandler {
+
+ public String select(OpenExecution execution) {
+ String content = (String) execution.getVariable("content");
+ if (content.equals("you're great")) {
+ return "good";
+ }
+ if (content.equals("you gotta improve")) {
+ return "bad";
+ }
+ return "ugly";
+ }
+}</programlisting>
+ <para>Now, when we start a process instance and supply value
+ <literal>you're great</literal> for variable content, then the
+ ContentEvaluation will return String <literal>good</literal> and
+ the process instance will arrive in node <literal>Submit document</literal>.
+ </para>
+ </section>
+
+ </section>
+
+ <section id="end">
+ <title><literal>end</literal></title>
+ <para>Ends the execution.
+ </para>
+ <section id="endprocessinstance">
+ <title><literal>end</literal> process instance</title>
+ <para>By default, an end activity will end the complete
+ process instance. In case multiple concurrent executions
+ are still active within the same process instance, all of
+ them will be ended.
+ </para>
+ <figure id="process.end.processinstance">
+ <title>The end event</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.end.processinstance.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="EndProcessInstance" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="end" />
+ </start>
+
+ <end name="end" />
+
+</process></programlisting>
+ <para>When a new process instance is created, it immediately ends.</para>
+ </section>
+ <section id="endexecution">
+ <title><literal>end</literal> execution</title>
+ <para>Only the execution that arrives in the
+ end activity will be ended and other concurrent executions
+ should be left active. To get this behaviour, set
+ attribute <literal>ends="execution"</literal>
+ </para>
+ <table><title><literal>end</literal> execution attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>ends</literal></entry>
+ <entry>{processinstance|execution}</entry>
+ <entry>processinstance</entry>
+ <entry>optional</entry>
+ <entry>specifies if the whole process instance should be ended or
+ just the path of execution that arrives in the end activity.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section id="endmultiple">
+ <title><literal>end</literal> multiple</title>
+ <para>A process can have multiple end events. This can be handy to indicate
+ different outcomes of a process instance. For example
+ </para>
+ <figure id="process.end.multiple">
+ <title>Multiple end events</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.end.multiple.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="EndMultiple" xmlns="http://;jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="get return code" />
+ <start>
+
+ <state name="get return code">
+ <flow name="200" to="ok"/>
+ <flow name="400" to="bad request"/>
+ <flow name="500" to="internal server error"/>
+ </state>
+
+ <end name="ok"/>
+ <end name="bad request"/>
+ <end name="internal server error"/>
+
+</process>
+ </programlisting>
+ <para>Now if we would start an execution and signal it to move out of the <literal>get return code</literal> wait state with the
+ following code, the execution would end with the <literal>bad request</literal> end event.</para>
+ <programlisting>Execution execution = executionService.startExecutionByKey("EndMultiple");
+String executionId = execution.getId();
+execution = executionService.signalExecutionById(executionId, "400");
+ </programlisting>
+ <para>Likewise, using the value <literal>200</literal> or <literal>500</literal> would cause the execution
+ to end with the <literal>ok</literal> or with the <literal>internal server error</literal> end events
+ respectively.</para>
+ </section>
+
+ <section id="endstate">
+ <title><literal>end</literal> state</title>
+ <para>An execution can also end with different states. It is another way to specify the outcome of a process.
+ It is indicated by the <literal>state</literal> attribute of the end event or by the <literal>end-cancel</literal>
+ and <literal>end-error</literal> shortcut notations.
+ </para>
+
+ <table><title><literal>end</literal> execution attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>state</literal></entry>
+ <entry>String</entry>
+ <entry></entry>
+ <entry>optional</entry>
+ <entry>the state assigned to the execution.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>Take for example the following process.
+ </para>
+ <figure id="process.end.state">
+ <title>Different end states</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.end.state.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="EndState" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="get return code"/>
+ </start>
+
+ <state name="get return code">
+ <flow name="200" to="ok"/>
+ <flow name="400" to="bad request" />
+ <flow name="500" to="internal server error"/>
+ </state>
+
+ <end name="ok" state="completed"/>
+ <end-cancel name="bad request"/>
+ <end-error name="internal server error"/>
+
+</process>
+ </programlisting>
+ <para>This time, if we would start an execution and signal it to move out of the <literal>get return code</literal> wait state with the
+ following code, the execution would end with the <literal>cancel</literal> state.</para>
+ <programlisting>Execution execution = executionService.startExecutionByKey("EndState");
+String executionId = execution.getId();
+execution = executionService.signalExecutionById(executionId, "400");
+ </programlisting>
+ <para>Similarly as above, using the value <literal>200</literal> or <literal>500</literal> would cause the execution
+ to end with the <literal>completed</literal> or with the <literal>error</literal> states
+ respectively.</para>
+ </section>
+ </section>
+
+ <section id="java">
+ <title><literal>java</literal></title>
+ <para>The Java task. A process execution will execute the method of the class that is configured
+ in this activity.</para>
+ <table><title><literal>java</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>class</literal></entry>
+ <entry>classname</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>The fully qualified classname.</entry>
+ </row>
+ <row>
+ <entry><literal>method</literal></entry>
+ <entry>methodname</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>The name of the method to invoke</entry>
+ </row>
+ <row>
+ <entry><literal>var</literal></entry>
+ <entry>variablename</entry>
+ <entry></entry>
+ <entry>optional</entry>
+ <entry>The name of the variable in which the return value
+ should be stored.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table><title><literal>java</literal> elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>field</literal></entry>
+ <entry>0..*</entry>
+ <entry>describes a configuration value to inject in a memberfield before
+ the method is invoked.</entry>
+ </row>
+ <row>
+ <entry><literal>arg</literal></entry>
+ <entry>0..*</entry>
+ <entry>method parameters</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>Consider the following example.</para>
+ <figure id="process.java">
+ <title>A java task</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.java.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="Java" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="invoke java method" />
+ </start>
+
+ <java name="invoke java method"
+ class="org.jbpm.examples.java.JohnDoe"
+ method="hello"
+ var="answer">
+
+ <field name="state"><string value="fine"/></field>
+ <field name="session"><env type="org.hibernate.Session"/></field>
+
+ <arg><string value="Hi, how are you?"/></arg>
+
+ <flow to="wait" />
+ </java>
+
+ <state name="wait">
+
+</process>
+ </programlisting>
+ <para>The java task specifies that during its execution an instance of the class <literal>org.jbpm.examples.java.JohnDoe</literal>
+ will be instantiated and the method <literal>hello</literal> of this class will be invoked on the resulting object. The variable named
+ <literal>answer</literal> will contain the result of the invocation. Let's look at the class <literal>JohnDoe</literal> below.
+ </para>
+ <programlisting>package org.jbpm.examples.java;
+
+import org.hibernate.Session;
+
+public class JohnDoe {
+
+ String state;
+ Session session;
+
+ public String hello(String msg) {
+ if ( (msg.indexOf("how are you?")!=-1)
+ && (session.isOpen())
+ ) {
+ return "I'm "+state+", thank you.";
+ }
+ return null;
+ }
+}</programlisting>
+ <para>The class above reveals that it contains two fields named <literal>state</literal> and <literal>session</literal>
+ and that the method <literal>hello</literal> accepts one argument. During the execution the values specified in the
+ <literal>field</literal> and <literal>arg</literal> configuration elements will be used. The expected result of creating
+ a process instance is that the process variable <literal>answer</literal> contains the string
+ <literal>I'm fine, thank you.</literal>.
+ </para>
+ </section>
+
+ <section id="task">
+ <title><literal>task</literal></title>
+ <para>Creates a task for a person in the task component. The configuration capabilities
+ of the task activity will be expanded in the next releases.
+ </para>
+ <table><title><literal>task</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>assignee</literal></entry>
+ <entry>text</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>id of the person to which this task must be assigned</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>For example:</para>
+ <figure id="process.task">
+ <title>The task example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.task.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="Task" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="review" />
+ </start>
+
+ <emphasis role="bold"><task name="review"
+ assignee="johndoe"></emphasis>
+
+ <flow to="wait" />
+ <emphasis role="bold"></task></emphasis>
+
+ <state name="wait" />
+
+</process></programlisting>
+ <para>After starting a process like this
+ </para>
+ <programlisting>executionService.startExecutionByKey("Task");</programlisting>
+ <para>The task list for user johndoe can be obtained from the <literal>TaskService</literal>
+ like this</para>
+ <programlisting>taskService.getPersonalTaskList("johndoe", 0, 10);</programlisting>
+ <para>The task list for user 'johndoe' will contain a task named 'review'.</para>
+ </section>
+
+ <section id="script">
+ <title><literal>script</literal></title>
+ <para>A script activity evaluates a script. Scripts can be specified in any language for
+ which there is <ulink url="https://scripting.dev.java.net/">a JSR-223 compliant scripting engine</ulink>.
+ Configuration of scripting engines <link linkend="scripting">is explained below</link>.
+ </para>
+ <para>There are 2 ways of specifying a script:
+ </para>
+ <section id="script.expression">
+ <title><literal>script</literal> expression</title>
+ <para>The script is provided with the <literal>expr</literal> attribute.
+ This is for short expressions that are easier expressed in an attribute
+ then in a text element. If no <literal>lang</literal> is specified,
+ the default-expression-language is used.
+ </para>
+ <table><title><literal>script</literal> expression attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>expr</literal></entry>
+ <entry>text</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>the expression text to evaluate.</entry>
+ </row>
+ <row>
+ <entry><literal>lang</literal></entry>
+ <entry>scripting language name as defined in <xref linkend="scripting"/></entry>
+ <entry>the default <emphasis role="bold">expression</emphasis> language as defined in <xref linkend="scripting"/></entry>
+ <entry>optional</entry>
+ <entry>the language in which the expression is specified.</entry>
+ </row>
+ <row>
+ <entry><literal>var</literal></entry>
+ <entry>variablename</entry>
+ <entry></entry>
+ <entry>optional</entry>
+ <entry>name of the variable in which the return value
+ should be stored.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>In the next example, we'll see how a script activity with an expression and
+ how the result is stored in a variable.
+ </para>
+ <figure id="process.script.expression">
+ <title>The script.expression example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.script.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="ScriptExpression" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="invoke script" />
+ </start>
+
+ <emphasis role="bold"><script name="invoke script"
+ expr="Send packet to #{person.address}"
+ var="text"></emphasis>
+
+ <flow to="wait" />
+ <emphasis role="bold"></script></emphasis>
+
+ <state name="wait"/>
+
+</process></programlisting>
+ <para>This example uses a <literal>Person</literal> class that looks like this.
+ </para>
+ <programlisting>public class Person implements Serializable {
+
+ String address;
+
+ public Person(String address) {
+ this.address = address;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+}</programlisting>
+ <para>When starting a process instance for this process, we supply a person
+ with a given address property as variable <literal>person</literal>.
+ </para>
+ <programlisting>Map<String, Object> variables = new HashMap<String, Object>();
+variables.put("<emphasis role="bold">person</emphasis>", <emphasis role="bold">new Person("Honolulu")</emphasis>);
+
+executionService.startExecutionByKey("ScriptText", variables);</programlisting>
+ <para>After the execution of the script activity, variable <literal>text</literal>
+ will contain 'Send packet to Honolulu'.
+ </para>
+ </section>
+
+ <section id="script.text">
+ <title><literal>script</literal> text</title>
+ <para>The second way of specifying a script is with a <literal>text</literal> element.
+ This is convenient when the script text spans multiple lines.
+ </para>
+ <table><title><literal>script</literal> text attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>lang</literal></entry>
+ <entry>scripting language name as defined in <xref linkend="scripting"/></entry>
+ <entry>the default <emphasis role="bold">scripting</emphasis> language as defined in <xref linkend="scripting"/></entry>
+ <entry>optional</entry>
+ <entry>the language in which the script is specified.</entry>
+ </row>
+ <row>
+ <entry><literal>var</literal></entry>
+ <entry>variablename</entry>
+ <entry></entry>
+ <entry>optional</entry>
+ <entry>name of the variable in which the return value
+ should be stored.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table><title><literal>script</literal> text elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>text</literal></entry>
+ <entry>1</entry>
+ <entry>contains the script text</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>For example</para>
+ <figure id="process.script.text">
+ <title>The script.text example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.script.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="ScriptText" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="invoke script" />
+ </start>
+
+ <emphasis role="bold"><script name="invoke script"
+ var="text">
+ <text>
+ Send packet to #{person.address}
+ </text></emphasis>
+ <flow to="wait" />
+ <emphasis role="bold"></script></emphasis>
+
+ <state name="wait"/>
+
+</process></programlisting>
+ </section>
+ <para>Execution of this process is exactly the same as with the script expression above.
+ </para>
+ </section>
+
+ <section id="esb">
+ <title><literal>esb</literal></title>
+ <para>An <literal>esb</literal> activity sends a message to a service over the ESB.
+ The attributes <literal>category</literal> and <literal>service</literal> identify the
+ service in the esb repository. The message is composed with the
+ <literal>part</literal> elements.
+ </para>
+ <table><title><literal>esb</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>category</literal></entry>
+ <entry>string</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>the esb category where the service is defined.</entry>
+ </row>
+ <row>
+ <entry><literal>service</literal></entry>
+ <entry>string</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>the esb name of the service
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table><title><literal>esb</literal> elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>part</literal></entry>
+ <entry>0..*</entry>
+ <entry>Parts of the message to be sent.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>For example</para>
+ <figure id="process.esb">
+ <title>The esb example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.esb.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="Esb" xmlns="http://jbpm.org/4/jpdl">
+
+ <start >
+ <flow to="invoke esb service" />
+ </start>
+
+ <emphasis role="bold"><esb name="invoke esb service"
+ category="orderProcessing"
+ service="bookSold">
+
+ <part name="bookTitle" expr="#{title}" />
+ <part name="goal">
+ <string value="deliver asap" />
+ </part></emphasis>
+
+ <flow to="wait" />
+ <emphasis role="bold"></esb></emphasis>
+
+ <state name="wait" />
+
+</process></programlisting>
+ <para>When a new process is started, a message will be sent to the esb
+ service <literal>bookSold</literal> in category <literal>orderProcessing</literal>.
+ The message will have 2 parts: one named <literal>bookTitle</literal> containing
+ the title process variable. And one named <literal>goal</literal> which
+ contains the text 'deliver asap'.
+ </para>
+ </section>
+
+ <section id="hql">
+ <title><literal>hql</literal></title>
+ <para>With the<literal>hql</literal> activity, a HQL query can be performed
+ on the database and the result is stored in a process variable.
+ </para>
+ <table><title><literal>hql</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>var</literal></entry>
+ <entry>variablename</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>the name of the variable in which the result is stored.</entry>
+ </row>
+ <row>
+ <entry><literal>unique</literal></entry>
+ <entry>{true, false}</entry>
+ <entry>false</entry>
+ <entry>optional</entry>
+ <entry>a value of true means that the result from the hibernate
+ query should be obtained with method <literal>uniqueResult()</literal>.
+ The default is false and in that case the <literal>list()</literal>
+ method will be used to get the result.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table><title><literal>hql</literal> elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>query</literal></entry>
+ <entry>1</entry>
+ <entry>The HQL query.</entry>
+ </row>
+ <row>
+ <entry><literal>parameter</literal></entry>
+ <entry>0..*</entry>
+ <entry>The query parameters</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>For example:</para>
+ <figure id="process.hql">
+ <title>The hql example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.hql.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="Hql" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="get process names" />
+ </start>
+
+ <emphasis role="bold"><hql name="get process names"
+ var="nodes with o">
+ <query>
+ select node.name
+ from org.jbpm.pvm.internal.model.NodeImpl as node
+ where node.name like :nodeName
+ </query>
+ <parameters>
+ <string name="nodeName" value="%o%" />
+ </parameters></emphasis>
+ <flow to="count nodes" />
+ <emphasis role="bold"></hql>
+
+ <hql name="count nodes"
+ var="nodes"
+ unique="true">
+ <query>
+ select count(*)
+ from org.jbpm.pvm.internal.model.NodeImpl
+ </query></emphasis>
+ <flow to="wait" />
+ <emphasis role="bold"></hql></emphasis>
+
+ <state name="wait"/>
+
+</process></programlisting>
+ </section>
+
+ <section id="sql">
+ <title><literal>sql</literal></title>
+ <para>The <literal>sql</literal> activity is exactly the same as the
+ <link linkend="hql">hql</link> activity, with the only difference that
+ <literal>session.createSQLQuery(...)</literal> is used.
+ </para>
+ </section>
+
+ <section id="commonactivitycontents">
+ <title>Common activity contents</title>
+ <para>Unless specified otherwise above, all activities also include this
+ content model:
+ </para>
+ <table><title>Common activity attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>name</literal></entry>
+ <entry>any text</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>name of the activity</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table><title>Common activity elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>flow</literal></entry>
+ <entry>0..*</entry>
+ <entry>the outgoing flows</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ </section>
+
+</chapter>
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Scripting.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Scripting.xml 2008-12-26 15:23:55 UTC (rev 3556)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Scripting.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -1,18 +0,0 @@
-<chapter id="scripting">
- <title>Scripting</title>
-
- <para>Scripting in jBPM is based on JSR 223: Scripting for the JavaTM Platform.
- Scripting engines can be configured like this:
- </para>
- <programlisting><script-manager default-expression-language="juel"
- default-script-language="juel"
- read-contexts="execution, environment, process-engine"
- write-context="">
- <script-language name="juel" factory="com.sun.script.juel.JuelScriptEngineFactory" />
-</script-manager></programlisting>
- <para>A jPDL process definition can contain scripts and expressions. All
- of the configured scripting engines can be used in each situation. But
- scripts and expressions each have their own default.
- </para>
-
-</chapter>
Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Variables.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Variables.xml (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Variables.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -0,0 +1,7 @@
+<chapter id="variables">
+ <title>Variables</title>
+
+ <para>TODO
+ </para>
+
+</chapter>
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Variables.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch07-Scripting.xml (from rev 3540, jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Scripting.xml)
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch07-Scripting.xml (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch07-Scripting.xml 2008-12-27 11:30:11 UTC (rev 3557)
@@ -0,0 +1,18 @@
+<chapter id="scripting">
+ <title>Scripting</title>
+
+ <para>Scripting in jBPM is based on JSR 223: Scripting for the JavaTM Platform.
+ Scripting engines can be configured like this:
+ </para>
+ <programlisting><script-manager default-expression-language="juel"
+ default-script-language="juel"
+ read-contexts="execution, environment, process-engine"
+ write-context="">
+ <script-language name="juel" factory="com.sun.script.juel.JuelScriptEngineFactory" />
+</script-manager></programlisting>
+ <para>A jPDL process definition can contain scripts and expressions. All
+ of the configured scripting engines can be used in each situation. But
+ scripts and expressions each have their own default.
+ </para>
+
+</chapter>
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch07-Scripting.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
More information about the jbpm-commits
mailing list