JBoss JBPM SVN: r5832 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-28 11:12:50 -0400 (Wed, 28 Oct 2009)
New Revision: 5832
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CheckDbCmd.java
Log:
make jbpm report proper error message in case there is no jbpm schema
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CheckDbCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CheckDbCmd.java 2009-10-28 15:11:38 UTC (rev 5831)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CheckDbCmd.java 2009-10-28 15:12:50 UTC (rev 5832)
@@ -29,6 +29,7 @@
import org.jbpm.pvm.internal.cfg.ProcessEngineImpl;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.id.PropertyImpl;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
/**
* @author Tom Baeyens
@@ -44,8 +45,14 @@
// if table JBPM4_PROPERTIES doesn't exist,
if (!PropertyImpl.propertiesTableExists(session)) {
- // tell users to run upgrade
- throw new JbpmException("jBPM DB schema not in sync with library version: no JBPM4_PROPERTIES table. Run the upgrade tool first.");
+ if (!executionTableExists(session)) {
+ // tell users to run create.schema
+ throw new JbpmException("no jBPM DB schema: no JBPM4_EXECUTION table. Run the create.jbpm.schema target first in the install tool.");
+
+ } else {
+ // tell users to run upgrade
+ throw new JbpmException("jBPM DB schema not in sync with library version: no JBPM4_PROPERTIES table. Run the upgrade target first in the install tool.");
+ }
} else {
Long nextDbid = PropertyImpl.getNextDbid(session);
@@ -70,5 +77,19 @@
return null;
}
+
+ public static boolean executionTableExists(Session session) {
+ try {
+ session.createQuery("from "+ExecutionImpl.class.getName())
+ .setMaxResults(1)
+ .uniqueResult();
+ return true;
+
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+
}
16 years, 6 months
JBoss JBPM SVN: r5831 - in jbpm4/trunk/modules/test-db: src/test/java/org/jbpm/test/activity and 1 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-28 11:11:38 -0400 (Wed, 28 Oct 2009)
New Revision: 5831
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTest.java
Modified:
jbpm4/trunk/modules/test-db/pom.xml
Log:
added extra mail test in test-db module
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2009-10-28 14:47:18 UTC (rev 5830)
+++ jbpm4/trunk/modules/test-db/pom.xml 2009-10-28 15:11:38 UTC (rev 5831)
@@ -48,17 +48,21 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-console-reports</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<scope>test</scope>
</dependency>
-
<dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-console-reports</artifactId>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-wiser</artifactId>
<scope>test</scope>
- </dependency>
-
+ </dependency>
</dependencies>
<build>
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTest.java 2009-10-28 15:11:38 UTC (rev 5831)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.activity.mail;
+
+import java.util.List;
+
+import org.jbpm.test.JbpmTestCase;
+import org.subethamail.wiser.Wiser;
+import org.subethamail.wiser.WiserMessage;
+
+/**
+ * @author Tom Baeyens
+ */
+public class MailTest extends JbpmTestCase {
+
+ Wiser wiser = null;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ // start mail server
+ wiser = new Wiser();
+ wiser.setPort(2525);
+ wiser.start();
+ }
+
+ protected void tearDown() throws Exception {
+ wiser.stop();
+ super.tearDown();
+ }
+
+ public void testMailToPlainAddress() {
+ deployJpdlXmlString(
+ "<process name='MailTest'>" +
+ " <start>" +
+ " <transition to='mailtestmail' />" +
+ " </start>" +
+ " <mail name='mailtestmail'>" +
+ " <to addresses='jos@rubensstraat' />" +
+ " <subject>mail</subject>" +
+ " <text>youhoooo</text>" +
+ " <transition to='end' />" +
+ " </mail>" +
+ " <state name='end'/>" +
+ "</process>"
+ );
+
+ executionService.startProcessInstanceByKey("MailTest");
+
+ List<WiserMessage> messages = wiser.getMessages();
+ assertEquals(1, messages.size());
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activity/mail/MailTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 6 months
JBoss JBPM SVN: r5830 - in jbpm4/trunk/modules: userguide/src/main/docbook/en/modules and 1 other directory.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-10-28 10:47:18 -0400 (Wed, 28 Oct 2009)
New Revision: 5830
Removed:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch11-Emails.xml
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml
Log:
Revised doc: userguide chapter 6 + devguide chapter 1
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml 2009-10-28 12:49:19 UTC (rev 5829)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml 2009-10-28 14:47:18 UTC (rev 5830)
@@ -5,22 +5,23 @@
<title>Target audience</title>
<para>This developers guide is intended for experienced developers that
want to get the full flexibility out of jBPM. The features described in this
- developers guide will not be supported. Use at your own risk.
+ developers guide are currently not supported. Use at your own risk.
</para>
</section>
<section>
<title>Overview</title>
<para><xref linkend="incubation" /> explains the features that are intended to
- move to the userguide eventually and become part of the supported offering. But
- incubation features are not yet considered stable.
+ move to the userguide eventually and become part of the supported offering.
+ Do note that incubation features are not yet considered stable (ie. there
+ could be major syntax or implementation changes in next versions).
</para>
<para><xref linkend="processvirtualmachine" /> through <xref linkend="advancedgraphexecution" />
- explain the process virtual machine and how activity and event listener can be build
- for it.
+ explain the core of jBPM, the process virtual machine (PVM) and how activity
+ and event listener can be build for it.
</para>
<para><xref linkend="configuration" /> through <xref linkend="jbossintegration" />
- explain internal developer topics.
+ explain advanced usage of the jBPM framework.
</para>
</section>
@@ -49,10 +50,13 @@
<section>
<title>Library dependencies</title>
<para>If you want to install/deploy jBPM into your own application, this is still as easy
- as it was before: Just put the right libs in your application classpath. We didn't yet clean
+ as it was before: just put the right libs in your application classpath. We didn't yet clean
up the dependency description in the maven pom files. So we can't yet give the exact
minimal set of libraries from the <literal>lib</literal> directory that you need to include
- in your application. The versions of the libraties that are in the <literal>lib</literal>
+ in your application (See Jira issue
+ <ulink url="https://jira.jboss.org/jira/browse/JBPM-2556">JBPM-2556</ulink>
+ and vote for it if you want to let us know that this issue has priority for you).
+ The versions of the libraries that are in the <literal>lib</literal>
directory are the ones that we tested with. So we recommend you to use those very versions
of the libs. To help you on your way, here's the current maven dependency list for jPDL:
</para>
@@ -107,9 +111,6 @@
<literal>org.hibernate:hibernate-entitymanager</literal> </para>
<para>This list should already get you started to select a small subset of libs instead of
including all the libs from the <literal>${jbpm.home}/lib</literal> directory.
- In one of the next releases, we'll clean up those dependency descriptions in the pom and include
- a good description of which are the minimal libs to get jBPM up and running inside
- your own application.
</para>
</section>
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml 2009-10-28 12:49:19 UTC (rev 5829)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml 2009-10-28 14:47:18 UTC (rev 5830)
@@ -2,12 +2,13 @@
<title>jPDL</title>
<para>This chapter will explain the jPDL file format for describing
- process definitions.
+ process definitions. jPDL is the prominent process language of jBPM. The goal
+ of jPDL is to be as concise and developer-friendly as possible, while offering
+ every feature you'd expect from a BPM process language.
</para>
<para>The jPDL schema file contains more attributes and elements then this
- documentation. This documentation explains the stable and supported part of jPDL.
- So use this documentation as a reference to know what attributes and elements
- are stable and supported.
+ documentation. This part of the documentation explains the stable and supported part of jPDL.
+ Experimental/not supported jPDL features can be found in the developers guide.
</para>
<para>An example jPDL process file looks like this:
</para>
@@ -176,7 +177,7 @@
<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">
+ provided through the API. Apart from the <link linkend="commonactivitycontents">
common activity content</link>, <literal>state</literal> doesn't have any extra
attributes or elements.
</para>
@@ -733,9 +734,7 @@
</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>TODO (paste the code snippit)
- </programlisting>
- <para>Similarly as above, using the value <literal>200</literal> or <literal>500</literal> would cause the execution
+ <para>Similarly, 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>
@@ -1563,7 +1562,8 @@
<para>Then we set a variable on the task. This is typically done through a form. But
here we'll show how it is done programmatically.
</para>
- <programlisting>Map<String, Object> variables = new HashMap<String, Object>();
+ <programlisting>
+Map<String, Object> variables = new HashMap<String, Object>();
variables.put("result", "accept");
taskService.setVariables(task.getDbid(), variables);</programlisting>
<para>Completing this task, will cause the sub process instance to end.
@@ -1641,7 +1641,7 @@
the task is completed.
</para>
<programlisting>Map<String, Object> variables = new HashMap<String, Object>();
-variables.put(quot;resultquot;, quot;okquot;);
+variables.put("result", "ok");
taskService.setVariables(task.getId(), variables);
taskService.completeTask(task.getDbid());</programlisting>
<para>In this scenario, the <literal>ok</literal> transition is taken in
@@ -2452,7 +2452,8 @@
<title>Events</title>
<para>Events specify points in a process on which a list of event listeners can be registered.
When an execution passes that point in the process, the event listeners are notified.
- The events and listeners are not shown in the graphical view of the process. An event
+ The events and listeners are not shown in the graphical view of the process, which
+ makes them very interesting for implementing technical details. An event
is fired by an element in the process definition like e.g. the process definition,
an activity or a transition.
</para>
@@ -2599,8 +2600,7 @@
<state name="park"/>
</process></programlisting>
- <para><literal>LogListener</literal> will maintain a list of logs in a static member
- field:</para>
+ <para><literal>LogListener</literal> will maintain a list of logs as a process variable:</para>
<programlisting>public class <emphasis role="bold">LogListener</emphasis> implements EventListener {
// value gets injected from process definition
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch11-Emails.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch11-Emails.xml 2009-10-28 12:49:19 UTC (rev 5829)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch11-Emails.xml 2009-10-28 14:47:18 UTC (rev 5830)
@@ -1,196 +0,0 @@
-<chapter id="mailsupport">
- <title>Mail Support</title>
- <para>jBPM 4 takes advantage of the JavaMail API to make high-level email
- services available to business process authors.</para>
-
- <section id="mailproducers">
- <title>Producers</title>
- <para>Producers are responsible for creating email messages within jBPM. All mail producers
- implement the <literal>org.jbpm.pvm.internal.email.spi.MailProducer</literal> interface.
- A default mail producer is available out of the box to address typical email needs.</para>
-
- <section id="defaultmailproducer">
- <title>Default Producer</title>
- <para>The default mail producer is capable of creating email messages with text,
- HTML and attachments from a template. Templates can be provided inline or
- in the process-engine-context section of the jBPM configuration. Templates
- may contain expressions which are evaluated through the script manager. Refer to
- <link linkend="scripting">Scripting</link> for details.</para>
- <para>The following listing presents a mail activity with an inline template.</para>
- <programlisting><![CDATA[<mail name="rectify" language="juel"> (1)
- <from addresses='winston@minitrue' /> (2)
- <to addresses='julia@minitrue, obrien@miniluv'/> (3)
- <cc users='bigbrother'/>
- <bcc groups='thinkpol, innerparty'/>
- <subject>Part ${part} Chapter ${chapter}</subject> (4)
- <text>times ${date} reporting bb dayorder doubleplusungood (5)
- refs ${unpersons} rewrite fullwise upsub antefiling</text>
- <html><table><tr><td>times</td><td>${date}</td> (6)
- <td>reporting bb dayorder doubleplusungood
- refs ${unpersons} rewrite fullwise upsub antefiling</td>
- </tr></table></html>
- <attachments> (7)
- <attachment url='http://www.george-orwell.org/1984/3.html'/>
- <attachment resource='org/example/pic.jpg'/>
- <attachment file='${user.home}/.face'/>
- </attachments>
-</mail>]]></programlisting>
- <orderedlist>
- <listitem><para>Expressions within the template are written in the scripting language
- indicated here. If not specified, the default expression language will be assumed.
- </para></listitem>
- <listitem><para>List of message senders. Senders are either identified directly by
- their email addresses or appointed by means of the identity model.</para></listitem>
- <listitem><para>Lists of message recipients, categorized as follows: <emphasis>To</emphasis>
- (primary), <emphasis>CC</emphasis> (carbon copy) and <emphasis>BCC</emphasis> (blind
- carbon copy). Like senders, recipients are directly identified by their email addresses
- or appointed by means of the identity model.</para></listitem>
- <listitem><para>Character data contained in element <literal>subject</literal>
- are used as the message subject.</para></listitem>
- <listitem><para>Character data contained in element <literal>text</literal>
- are used as the plain text content of the message.</para></listitem>
- <listitem><para>Nodes contained in element <literal>html</literal>
- are used as the HTML content of the message.</para></listitem>
- <listitem><para>Attachments can be specified as absolute URLs,
- classpath resources or local files.</para></listitem>
- </orderedlist>
- <para>Note that every section of the template is amenable to expression evaluation.</para>
- </section>
- <para>For complex emails or custom generation of attachments, see: <link
- linkend="customemails">Extension Points: Custom Emails</link>.</para>
- </section>
-
- <section id="mailtemplates">
- <title>Templates</title>
- <para>Mail templates are available to externalize commonly used messages from process definitions.
- Templates are placed in the process-engine-context section of your configuration file. All elements
- available to inline templates, as described in the <link linkend="defaultmailproducer">previous
- section</link> are available to external templates. Consider the fragment below.</para>
- <programlisting><![CDATA[<jbpm-configuration>
-<process-engine-context>
- <mail-template name="rectify-template">
- <!-- same elements as inline template -->
- </mail-template>
-</process-engine-context>
-</jbpm-configuration>]]></programlisting>
- <para>Each template must have an unique name. Mail activities may reference the template
- through the <literal>template</literal> attribute, as follows.</para>
- <programlisting><![CDATA[<mail name="rectify" template="rectify-template />]]></programlisting>
- </section>
-
- <section id="mailservers">
- <title>Servers</title>
- <para>Mail servers are declared in the configuration file. The <literal>mail-server</literal>
- element describes an SMTP mail server capable of sending email messages.
- Because jBPM uses JavaMail to send mail, all properties supported by JavaMail are also
- exposed to jBPM. Within the <literal>session-properties</literal> child element,
- the SMTP properties must be provided as shown in the example below.</para>
- <para>See the Sun JavaMail API for more information on supported properties:
- <ulink url="http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-...">
- Sun SMTP Properties</ulink>.</para>
- <programlisting><![CDATA[<jbpm-configuration>
-<transaction-context>
- <mail-session>
- <mail-server>
- <session-properties>
- <property name="mail.smtp.host" value="localhost" />
- <property name="mail.smtp.port" value="2525" />
- <property name="mail.from" value="noreply(a)jbpm.org" />
- </session-properties>
- </mail-server>
- </mail-session>
-</transaction-context>
-</jbpm-configuration>]]></programlisting>
- <para>If the "From" attribute is not present in an outgoing message, the value of the
- <literal>mail.from</literal> property will be used instead.</para>
-
- <section id="multiplemailservers">
- <title>Multiple Servers</title>
- <para>Multiple SMTP server support has been added to jBPM 4 to accommodate a wider
- variety of organizational server structures. For example, this is useful for companies
- that have both internal and external SMTP servers.</para>
- <para>To setup multiple SMTP mail servers, declare multiple mail servers within the
- configuration file, as described below. The tag <literal>address-filter</literal> exists
- to define which domains are serviced by each mail server. The address filter consists
- of regular expressions that determine whether an address will be processed by a given
- server.</para>
- <para>See the Sun Pattern API for more information on supported regular expressions:
- <ulink url="http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html">
- Sun Regex Patterns</ulink>.</para>
- <programlisting><![CDATA[<jbpm-configuration>
-<transaction-context>
- <mail-session>
- <mail-server>
- <address-filter>
- <include>.+(a)jbpm.org</include>
- </address-filter>
- <session-properties>
- <property name="mail.smtp.host" value="int.smtp.jbpm.org" />
- <property name="mail.from" value="noreply(a)jbpm.org" />
- </session-properties>
- </mail-server>
- <mail-server>
- <address-filter>
- <exclude>.+(a)jbpm.org</exclude>
- </address-filter>
- <session-properties>
- <property name="mail.smtp.host" value="ext.smtp.jbpm.org" />
- <property name="mail.from" value="noreply(a)jbpm.org" />
- </session-properties>
- </mail-server>
- </mail-session>
-</transaction-context>
-</jbpm-configuration>]]></programlisting>
- <para>Address filters follow the logic below to accept an address.</para>
- <itemizedlist>
- <listitem><para>Address is accepted if it is <emphasis>included</emphasis> and
- <emphasis>not excluded</emphasis>.</para></listitem>
- <listitem><para>Absence of includes implies the address is
- <emphasis>included</emphasis>.</para></listitem>
- <listitem><para>Absence of excludes implies the address is
- <emphasis>not excluded</emphasis>.</para></listitem>
- </itemizedlist>
- </section>
- </section>
-
- <section id="extensibility">
- <title>Extension Points</title>
-
- <section id="customproducers">
- <title>Custom Producers</title>
- <para>jBPM 4 allows the creation of your own Mail Producers to address an organization's
- specific email needs. To do so, users must implement the
- <literal>org.jbpm.pvm.internal.email.spi.MailProducer</literal> interface. The method
- <literal>produce</literal> will return one or more <literal>Message</literal> objects,
- which will be sent through the <literal>MailSession</literal>.</para>
-
- <section id="custom attachments">
- <title>Example: Custom Attachments</title>
- <para>Generation of custom attachments at runtime can be easily implemented in jBPM 4.
- By extending the default mail producer, or implementing your own with the
- <literal>MailProducer</literal> interface, attachments can be generated and
- added to email messages at runtime.</para>
- <para>The following is an example of how to extend <literal>MailProducerImpl</literal>
- to add an extra attachment to every outgoing mail.</para>
- <programlisting><![CDATA[public class CustomMailProducer extends MailProducerImpl {
-
- protected void addAttachments(Execution execution, Multipart multipart) {
- // have default mail producer create attachments from template
- super.addAttachments(execution, multipart);
-
- // create a body part to carry the content
- BodyPart attachmentPart = new MimeBodyPart();
-
- // set content provided by an arbitrary data handler
- attachmentPart.setDataHandler(...);
-
- // attach content
- multipart.addBodyPart(attachmentPart);
- }
-}]]></programlisting>
- </section>
- </section>
-
- </section>
-
-</chapter>
\ No newline at end of file
16 years, 6 months
JBoss JBPM SVN: r5829 - jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-10-28 08:49:19 -0400 (Wed, 28 Oct 2009)
New Revision: 5829
Modified:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java
Log:
Removing 'field not used' warning by adding assertNotNull for every service. This is easier for first-timers who check the example
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java 2009-10-28 12:48:41 UTC (rev 5828)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/services/ServicesTest.java 2009-10-28 12:49:19 UTC (rev 5829)
@@ -31,6 +31,12 @@
HistoryService historyService = processEngine.getHistoryService();
ManagementService managementService = processEngine.getManagementService();
+ assertNotNull(repositoryService);
+ assertNotNull(executionService);
+ assertNotNull(taskService);
+ assertNotNull(historyService);
+ assertNotNull(managementService);
+
// Deploying a process
String deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/services/Order.jpdl.xml")
16 years, 6 months
JBoss JBPM SVN: r5828 - jbpm4/trunk/modules/userguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-10-28 08:48:41 -0400 (Wed, 28 Oct 2009)
New Revision: 5828
Modified:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-DeployingBusinessArchives.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Services.xml
Log:
revision doc chapter 2/4/5
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2009-10-28 10:54:55 UTC (rev 5827)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2009-10-28 12:48:41 UTC (rev 5828)
@@ -374,7 +374,7 @@
<title>Get Eclipse</title>
<para>You'll need Eclipse 3.5.0.
</para>
- <para>Use the <link linkend="gettingstarted">demo setup</link> or download
+ <para>Use the <link linkend="gettingstartedquickly">demo setup</link> or download
eclipse manually:
<ulink url="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downlo...">Eclipse IDE for Java EE Developers (163 MB)</ulink>.
</para>
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-DeployingBusinessArchives.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-DeployingBusinessArchives.xml 2009-10-28 10:54:55 UTC (rev 5827)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-DeployingBusinessArchives.xml 2009-10-28 12:48:41 UTC (rev 5828)
@@ -16,7 +16,7 @@
</para>
<para>There is a jBPM ant task to deploy business archives
- (<literal>org.jbpm.pvm.internal.ant.JbpmDeployTask</literal>)
+ (<literal>org.jbpm.pvm.internal.ant.JbpmDeployTask</literal>).
The <literal>JbpmDeployTask</literal> can deploy individual
process files and business archives. They are deployed
directly to the database over a JDBC connection. So it is a
@@ -40,7 +40,7 @@
<para>The JDBC driver jar(s) for your database should also be included
in the path. MySQL, PostgreSQL and HSQLDB are in the distribution. But
- the oracle driver you have to download separately from the oracle site since
+ the Oracle driver you have to download separately from the oracle site since
we're not allowed to redistribute that file.
</para>
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Services.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Services.xml 2009-10-28 10:54:55 UTC (rev 5827)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Services.xml 2009-10-28 12:48:41 UTC (rev 5828)
@@ -57,7 +57,7 @@
</para>
<para>The code snippets in this section and the next section about process
- deployments are taken from example
+ deployments are taken from the example
<literal>org.jbpm.examples.services.ServicesTest</literal>
</para>
@@ -217,11 +217,13 @@
</tgroup>
</table>
</section>
-
+
+<!--
<section id="undeployingdeployments">
<title>Undeploying deployments</title>
<para>TODO</para>
</section>
+-->
<section id="deletingadeployment">
<title>Deleting a deployment</title>
@@ -266,10 +268,11 @@
<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
+ <para>A new process instance can optionally be given a key. This key is
+ a user defined reference to the execution and is sometimes referred to as
+ the 'business key'. A business 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>ProcessInstance processInstance =
@@ -286,10 +289,10 @@
executionService.startProcessInstanceByKey("ICL");
String pid = processInstance.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
+ <para>It is a best practice to use a user defined business key. Typically in your application
+ domain, finding such a key is not difficult. 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.
+ on the process variables - which is also more costly performance-wise.
</para>
</section>
@@ -312,8 +315,8 @@
<section id="singallingawaitingexecution">
<title>Signalling a waiting execution</title>
<para>When using a <literal>state</literal> activity, the execution (or process instance)
- will wait when it arrives in the state, waiting for a signal (aka external trigger).
- Methods <literal>signalExecution</literal> can be used for that. Executions are
+ will halt when it arrives in a state, waiting for a signal (aka external trigger).
+ The method <literal>signalExecution</literal> and alike can be used for that. Executions are
referenced by an execution id (String).
</para>
<para>In some cases, the execution that arrives in a state will be the process instance
@@ -333,7 +336,7 @@
<para>In event listener <literal>StartExternalWork</literal> you can kick off what needs to
be done externally. In that event listener you can also obtain the exact execution id
with <literal>execution.getId()</literal>. It's that executionId that you'll need to provide
- the signal later on when the external work is done:
+ with the signal later on when the external work is done:
</para>
<programlisting>executionService.signalExecutionById(executionId);</programlisting>
<para>There is an alternatively (less preferrable) way to obtain the executionId
@@ -352,6 +355,11 @@
Execution execution = processInstance.findActiveExecutionIn("external work");
String executionId = execution.getId();</programlisting>
</section>
+
+ <para>
+ Do note that the above solution couples the application logic (too) closely
+ by using knowledge about the actual process structure.
+ </para>
<section id="taskservice">
<title>TaskService</title>
@@ -419,8 +427,50 @@
<section id="managementservice">
<title>ManagementService</title>
<para>The management service is mostly used to manage the jobs. See javadocs for
- more information. This functionality is also exposed through the console.
+ more information. This functionality is also exposed through the jBPM web console.
</para>
</section>
+ <section id="queryApi">
+ <title>Query API</title>
+ <para>
+ Starting from jBPM 4.0, a new API has been introuced with a query system that
+ covers most of the queries you can think of. Developers who need to write company-specific
+ queries can of course still rely on Hibernate. But for most use cases,
+ the query API will be more then suffice.
+ Queries can be written in a unified way on all major jBPM concepts:
+ Process Instances, Tasks, Deployments, Historical processes, etc.
+ </para>
+ <para>
+ For example:
+ <programlisting>
+List<ProcessInstance> results = executionService.createProcessInstanceQuery()
+ .processDefinitionId("my_process_definition")
+ .notSuspended()
+ .page(0, 50)
+ .list();
+ </programlisting>
+ This example returns all the process instances of the given process definition
+ which are not suspended. The result is also paged, and the first page of 50
+ results is given.
+ </para><para>Querying tasks is done in completely the same way:
+ <programlisting>
+List<Task> myTasks = taskService.createTaskQuery()
+ .processInstanceId(piId)
+ .assignee("John")
+ .page(100, 120)
+ .orderDesc(TaskQuery.PROPERTY_DUEDATE)
+ .list();
+</programlisting>
+This query will give all the tasks for a given process instance assigned to John,
+paged of course, in a descending order based on the duedate.
+ </para>
+ <para>
+ Every service has operations of creating such unified queries (eg. querying
+ jobs through the <literal>ManagementService</literal>, querying completed
+ process instances through the <literal>HistoryService</literal>. Do check
+ the Javadoc of the services to learn everything about the query API.
+ </para>
+ </section>
+
</chapter>
16 years, 6 months
JBoss JBPM SVN: r5825 - jbpm4/trunk/modules/userguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-10-28 06:02:22 -0400 (Wed, 28 Oct 2009)
New Revision: 5825
Modified:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
Log:
Revised documentation of chapter 2
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2009-10-27 23:07:13 UTC (rev 5824)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2009-10-28 10:02:22 UTC (rev 5825)
@@ -59,8 +59,8 @@
<listitem>Start eclipse</listitem>
</itemizedlist>
<para>
- After this is done, JBoss will be running in the background. Once
- eclipse has started, you can continue to follow the instructions of
+ After this is done, JBoss (or Tomcat, depending on which demo.setup script you chose)
+ will be running in the background. Once eclipse has started, you can continue to follow the instructions of
<xref linkend="graphicalprocessdesigner" /> to start coding your jBPM business processes.
</para>
<para>
16 years, 6 months
JBoss JBPM SVN: r5824 - jbpm4/trunk.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-10-27 19:07:13 -0400 (Tue, 27 Oct 2009)
New Revision: 5824
Modified:
jbpm4/trunk/pom.xml
Log:
update gpd dependency to 4.2
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-10-27 22:51:56 UTC (rev 5823)
+++ jbpm4/trunk/pom.xml 2009-10-27 23:07:13 UTC (rev 5824)
@@ -51,7 +51,7 @@
<freemarker.version>2.3.15</freemarker.version>
<gwt.console.version>1.1.2-SNAPSHOT</gwt.console.version>
<!-- <gwt.console.version>1.2.0-SNAPSHOT</gwt.console.version>-->
- <jbpm.gpd.version>4.1</jbpm.gpd.version>
+ <jbpm.gpd.version>4.2</jbpm.gpd.version>
<hibernate.version>3.3.1.GA</hibernate.version>
<slf4j.version>1.5.2</slf4j.version>
<hsqldb.version>1.8.0.7</hsqldb.version>
16 years, 6 months
JBoss JBPM SVN: r5823 - jbpm4/trunk/modules/distro.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-27 18:51:56 -0400 (Tue, 27 Oct 2009)
New Revision: 5823
Modified:
jbpm4/trunk/modules/distro/pom.xml
Log:
[JBPM-2547] remove extraneous signavio version field in distro module
Modified: jbpm4/trunk/modules/distro/pom.xml
===================================================================
--- jbpm4/trunk/modules/distro/pom.xml 2009-10-27 22:34:20 UTC (rev 5822)
+++ jbpm4/trunk/modules/distro/pom.xml 2009-10-27 22:51:56 UTC (rev 5823)
@@ -147,7 +147,6 @@
<groupId>org.jbpm.jbpm4.dependencies.signavio</groupId>
<artifactId>jbpmeditor</artifactId>
<type>war</type>
- <version>1.0</version>
</dependency>
<!-- Please sort by groupid -->
16 years, 6 months