JBoss JBPM SVN: r6015 - jbpm4/trunk.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-12-21 22:47:27 -0500 (Mon, 21 Dec 2009)
New Revision: 6015
Modified:
jbpm4/trunk/pom.xml
Log:
update gpd version to 4.3-SNAPSHOT
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-12-21 18:59:32 UTC (rev 6014)
+++ jbpm4/trunk/pom.xml 2009-12-22 03:47:27 UTC (rev 6015)
@@ -54,7 +54,7 @@
<aspectjrt.version>1.5.3</aspectjrt.version>
<freemarker.version>2.3.15</freemarker.version>
<gwt.console.version>1.3.0</gwt.console.version>
- <jbpm.gpd.version>4.2</jbpm.gpd.version>
+ <jbpm.gpd.version>4.3-SNAPSHOT</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, 4 months
JBoss JBPM SVN: r6014 - jbpm4/trunk/modules/devguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-12-21 13:59:32 -0500 (Mon, 21 Dec 2009)
New Revision: 6014
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
Log:
Added bpmn2 to overview doc
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-12-21 18:56:08 UTC (rev 6013)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml 2009-12-21 18:59:32 UTC (rev 6014)
@@ -16,6 +16,8 @@
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="bpmn2"/> shows how the BPMN 2.0 process language can be used with jBPM.
+ </para>
<para><xref linkend="processvirtualmachine" /> through <xref linkend="advancedgraphexecution" />
explain the core of jBPM, the process virtual machine (PVM) and how activity
and event listener can be build for it.
16 years, 4 months
JBoss JBPM SVN: r6013 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/bpmn/usertask/taskform and 4 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-12-21 13:56:08 -0500 (Mon, 21 Dec 2009)
New Revision: 6013
Added:
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/request_vacation.ftl
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/vacationrequest.bpmn.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/verify_request.ftl
Removed:
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/usertask/taskform/
Modified:
jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/usertask/taskform/TaskFormTest.java
Log:
Cleanup BPMN 2.0 examples for console usage
Modified: jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/examples/build.xml 2009-12-21 18:07:52 UTC (rev 6012)
+++ jbpm4/trunk/modules/distro/src/main/files/examples/build.xml 2009-12-21 18:56:08 UTC (rev 6013)
@@ -73,6 +73,13 @@
<exclude name="org/jbpm/examples/task/notification process.jpdl.xml" />
<exclude name="org/jbpm/examples/task/reminder process.jpdl.xml" />
<exclude name="org/jbpm/examples/rulesdecision/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/task/notification/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/task/reminder/process.jpdl.xml" />
+ <exclude name="org/jbpm/examples/bpmn/event/terminateend/terminate_end_event.bpmn.xml" />
+ <exclude name="org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway.bpmn.xml" />
+ <exclude name="org/jbpm/examples/bpmn/gateway/exclusive/exclusive_gateway_default_seq_flow.bpmn.xml" />
+ <exclude name="org/jbpm/examples/bpmn/gateway/parallel/parallel_gateway.bpmn.xml" />
+ <exclude name="org/jbpm/examples/bpmn/task/service/service_task_java.bpmn.xml" />
</fileset>
</jar>
<taskdef name="jbpm-deploy" classname="org.jbpm.pvm.internal.ant.JbpmDeployTask" classpathref="jbpm.libs.incl.dependencies" />
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/usertask/taskform/TaskFormTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/usertask/taskform/TaskFormTest.java 2009-12-21 18:07:52 UTC (rev 6012)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/usertask/taskform/TaskFormTest.java 2009-12-21 18:56:08 UTC (rev 6013)
@@ -17,9 +17,9 @@
super.setUp();
NewDeployment deployment = repositoryService.createDeployment();
- deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/usertask/taskform/vacationrequest.bpmn.xml");
- deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/usertask/taskform/request_vacation.ftl");
- deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/usertask/taskform/verify_request.ftl");
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/task/usertask/taskform/vacationrequest.bpmn.xml");
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/task/usertask/taskform/request_vacation.ftl");
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/task/usertask/taskform/verify_request.ftl");
String deployId = deployment.deploy();
registerDeployment(deployId);
Copied: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/request_vacation.ftl (from rev 5986, jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/usertask/taskform/request_vacation.ftl)
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/request_vacation.ftl (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/request_vacation.ftl 2009-12-21 18:56:08 UTC (rev 6013)
@@ -0,0 +1,30 @@
+<html>
+<head>
+ <style type="text/css">
+ ${CSS!".body {font-family:sans-serif;}"}
+ </style>
+</head>
+ <body>
+
+ <form action="${form.action}" method="POST" enctype="multipart/form-data">
+
+ <h3>How many days would you like to go on vacation?</h3>
+ <select name="number_of_days">
+ <option value="3">3 days</option>
+ <option value="5">5 days</option>
+ <option value="10">10 days</option>
+ </select><br>
+
+ <br/>
+ <br/>
+
+ Your name: <input type="text" name="employee_name" /><br/>
+
+ <br/>
+ <br/>
+
+ <input type="submit" name="Done"/>
+
+ </form>
+ </body>
+</html>
\ No newline at end of file
Copied: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/vacationrequest.bpmn.xml (from rev 5986, jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/usertask/taskform/vacationrequest.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/vacationrequest.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/vacationrequest.bpmn.xml 2009-12-21 18:56:08 UTC (rev 6013)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions id="vacationRequest"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../../../../../bpmn/src/main/resources/BPMN20.xsd"
+ xmlns="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://jbpm.org/example/bpmn2/vacation_request"
+ xmlns:jbpm="http://jbpm.org/bpmn2">
+
+ <process id="vacationRequestProcess" name="BPMN2 Example process using task forms">
+
+ <startEvent id="start" />
+
+ <sequenceFlow id="flow1" name="fromStartToRequestVacation"
+ sourceRef="start" targetRef="requestVacation" />
+
+ <userTask id="requestVacation" name="Request Vacation"
+ implementation="other">
+ <potentialOwner resourceRef="user" />
+ <rendering id="requestForm">
+ <jbpm:form>org/jbpm/examples/bpmn/usertask/taskform/request_vacation.ftl</jbpm:form>
+ </rendering>
+ </userTask>
+
+ <sequenceFlow id="flow2"
+ name="fromRequestVacationToVerifyRequest" sourceRef="requestVacation"
+ targetRef="verifyRequest" />
+
+ <userTask id="verifyRequest" name="Verify Request"
+ implementation="other">
+ <potentialOwner resourceRef="manager" />
+ <rendering id="verifyForm">
+ <jbpm:form>org/jbpm/examples/bpmn/usertask/taskform/verify_request.ftl</jbpm:form>
+ </rendering>
+ </userTask>
+
+ <sequenceFlow id="flow3" name="fromVerifyRequestToEnd"
+ sourceRef="verifyRequest" targetRef="theEnd">
+ <conditionExpression xsi:type="tFormalExpression">${verificationResult == 'OK'}</conditionExpression>
+ </sequenceFlow>
+
+ <sequenceFlow id="flow4"
+ name="fromVerifyRequestToSendRejectionMessage" sourceRef="verifyRequest"
+ targetRef="sendRejectionMessage">
+ <conditionExpression xsi:type="tFormalExpression">${verificationResult == 'Not OK'}</conditionExpression>
+ </sequenceFlow>
+
+ <scriptTask id="sendRejectionMessage" name="Send rejection Message"
+ scriptLanguage="bsh">
+ <script>
+ <![CDATA[System.out.println("Vacation request refused!");]]>
+ </script>
+ </scriptTask>
+
+ <sequenceFlow id="flow5"
+ name="fromSendRejectionMessageToEnd" sourceRef="sendRejectionMessage"
+ targetRef="theEnd" />
+
+ <endEvent id="theEnd" name="End" />
+
+
+ </process>
+</definitions>
Copied: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/verify_request.ftl (from rev 5986, jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/usertask/taskform/verify_request.ftl)
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/verify_request.ftl (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/usertask/taskform/verify_request.ftl 2009-12-21 18:56:08 UTC (rev 6013)
@@ -0,0 +1,24 @@
+<html>
+<head>
+ <style type="text/css">
+ ${CSS!".body {font-family:sans-serif;}"}
+ </style>
+</head>
+ <body>
+
+ <form action="${form.action}" method="POST" enctype="multipart/form-data">
+
+ <h3>Your employee, ${employee_name} would like to go on vacation</h3>
+ Number of days: ${number_of_days}<br/>
+
+ <hr>
+
+ In case you reject, please provide a reason:<br/>
+ <input type="textarea" name="reason"/><br/>
+
+ <input type="submit" name="verificationResult" value="OK">
+ <input type="submit" name="verificationResult" value="Not OK">
+
+ </form>
+ </body>
+</html>
\ No newline at end of file
16 years, 4 months
JBoss JBPM SVN: r6012 - in jbpm4/trunk/modules: examples/src/test/resources/org/jbpm/examples/bpmn/task/service and 1 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-12-21 13:07:52 -0500 (Mon, 21 Dec 2009)
New Revision: 6012
Modified:
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/parallel/parallel_gateway.bpmn.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/service/service_task_java.bpmn.xml
jbpm4/trunk/modules/integration/report/src/main/resources/specific_system_overview.rptconfig
jbpm4/trunk/modules/integration/report/src/main/resources/specific_system_overview.rptdesign
Log:
Fixed typo in BPMN 2 example process names
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/parallel/parallel_gateway.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/parallel/parallel_gateway.bpmn.xml 2009-12-21 17:29:04 UTC (rev 6011)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/gateway/parallel/parallel_gateway.bpmn.xml 2009-12-21 18:07:52 UTC (rev 6012)
@@ -5,7 +5,7 @@
xmlns="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://jbpm.org/example/bpmn2/parallel_gateway">
- <process id="parallelGateway" name="BPMN2 example parallel gatewar">
+ <process id="parallelGateway" name="BPMN2 example parallel gateway">
<startEvent id="Start" />
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/service/service_task_java.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/service/service_task_java.bpmn.xml 2009-12-21 17:29:04 UTC (rev 6011)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/service/service_task_java.bpmn.xml 2009-12-21 18:07:52 UTC (rev 6012)
@@ -30,7 +30,7 @@
</bpmn:operation>
</bpmn:interface>
- <bpmn:process id="ServiceTaskJavaProcess" name="Simple process with java service task">
+ <bpmn:process id="ServiceTaskJavaProcess" name="BPMN 2.0 example java service task">
<bpmn:startEvent id="Start" />
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/specific_system_overview.rptconfig
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/specific_system_overview.rptconfig 2009-12-21 17:29:04 UTC (rev 6011)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/specific_system_overview.rptconfig 2009-12-21 18:07:52 UTC (rev 6012)
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.17" id="1">
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.16" id="1">
<list-property name="configVars">
<structure>
<property name="name">__isdisplay__startDate_321_0</property>
- <property name="value">2009-10-20</property>
+ <property name="value">2009-08-07</property>
</structure>
<structure>
<property name="name">__isdisplay__endDate_322_1</property>
- <property name="value">2009-10-20</property>
+ <property name="value">2009-12-22</property>
</structure>
<structure>
<property name="name">startDate_321_2</property>
- <property name="value">2009-10-20</property>
+ <property name="value">2009-08-07</property>
</structure>
<structure>
<property name="name">startDate_321_type_</property>
@@ -19,7 +19,7 @@
</structure>
<structure>
<property name="name">endDate_322_3</property>
- <property name="value">2009-10-20</property>
+ <property name="value">2009-12-22</property>
</structure>
<structure>
<property name="name">endDate_322_type_</property>
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/specific_system_overview.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/specific_system_overview.rptdesign 2009-12-21 17:29:04 UTC (rev 6011)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/specific_system_overview.rptdesign 2009-12-21 18:07:52 UTC (rev 6012)
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.17" id="1">
- <property name="author">jBPM</property>
- <property name="createdBy">Eclipse BIRT Designer Version 2.3.2.r232_20090202 Build <2.3.2.v20090218-0730></property>
+<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.16" id="1">
+ <property name="createdBy">Eclipse BIRT Designer Version 2.3.0.v20080606 Build <2.3.0.v20080618-0630></property>
<property name="units">in</property>
- <text-property name="title">Periodic Overview</text-property>
- <html-property name="description">System oveview for a specific time period</html-property>
+ <text-property name="title">Periodic overview</text-property>
<list-property name="userProperties">
<structure>
<property name="name">process_instances_date_aggregation.process_instance_dates.x</property>
@@ -36,7 +34,6 @@
<property name="bidiLayoutOrientation">ltr</property>
<parameters>
<scalar-parameter name="startDate" id="321">
- <text-property name="helpText">(format yyyy-MM-dd)</text-property>
<method name="validate"><![CDATA[importPackage(Packages.java.text);
df = new SimpleDateFormat("yyyy-MM-dd");
@@ -54,7 +51,7 @@
<property name="valueType">static</property>
<property name="dataType">date</property>
<property name="paramType">simple</property>
- <text-property name="promptText">Start date</text-property>
+ <text-property name="promptText">Start date (format yyyy-MM-dd)</text-property>
<property name="concealValue">false</property>
<property name="isRequired">true</property>
<property name="controlType">text-box</property>
@@ -65,7 +62,6 @@
</structure>
</scalar-parameter>
<scalar-parameter name="endDate" id="322">
- <text-property name="helpText">(format yyyy-MM-dd)</text-property>
<method name="validate"><![CDATA[importPackage(Packages.java.text);
// validate format
@@ -93,7 +89,7 @@
<property name="valueType">static</property>
<property name="dataType">date</property>
<property name="paramType">simple</property>
- <text-property name="promptText">End Date</text-property>
+ <text-property name="promptText">End date (format: yyyy-MM-dd)</text-property>
<property name="isRequired">true</property>
<property name="controlType">text-box</property>
<property name="distinct">true</property>
@@ -104,12 +100,11 @@
</scalar-parameter>
</parameters>
<data-sources>
- <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="MySQL" id="248">
- <property name="odaDriverClass">com.mysql.jdbc.Driver</property>
- <property name="odaURL">jdbc:mysql://localhost:3306/jbpmdb</property>
- <property name="odaUser">jbpm</property>
- <encrypted-property name="odaPassword" encryptionID="base64">amJwbQ==</encrypted-property>
- <property name="odaJndiName">java://JbpmDS</property>
+ <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="HsqlDB on JBoss" id="248">
+ <property name="odaDriverClass">org.hsqldb.jdbcDriver</property>
+ <property name="odaURL">jdbc:hsqldb:hsql://localhost:1701</property>
+ <property name="odaUser">sa</property>
+ <property name="odaJndiName">java:/JbpmDS</property>
</oda-data-source>
</data-sources>
<data-sets>
@@ -147,7 +142,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">MySQL</property>
+ <property name="dataSource">HsqlDB on JBoss</property>
<list-property name="parameters">
<structure>
<property name="name">param_1</property>
@@ -454,7 +449,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">MySQL</property>
+ <property name="dataSource">HsqlDB on JBoss</property>
<list-property name="parameters">
<structure>
<property name="name">param_1</property>
@@ -730,7 +725,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">MySQL</property>
+ <property name="dataSource">HsqlDB on JBoss</property>
<list-property name="parameters">
<structure>
<property name="name">param_1</property>
@@ -838,7 +833,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">MySQL</property>
+ <property name="dataSource">HsqlDB on JBoss</property>
<list-property name="parameters">
<structure>
<property name="name">param_1</property>
@@ -955,7 +950,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">MySQL</property>
+ <property name="dataSource">HsqlDB on JBoss</property>
<list-property name="parameters">
<structure>
<property name="name">param_1</property>
16 years, 4 months
JBoss JBPM SVN: r6011 - in jbpm4/trunk/modules: devguide/src/main/docbook/en/modules and 5 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-12-21 12:29:04 -0500 (Mon, 21 Dec 2009)
New Revision: 6011
Added:
jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.receive.task.java.png
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/receive/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/receive/ReceiveTaskJavaTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/receive/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/receive/receive_task_java.bpmn.xml
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/script/ScriptTaskTest.java
Log:
JBPM-2665: document Java receive task
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.receive.task.java.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.receive.task.java.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml 2009-12-21 16:48:15 UTC (rev 6010)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml 2009-12-21 17:29:04 UTC (rev 6011)
@@ -857,6 +857,42 @@
</para>
</section>
+
+ <section id="receiveTaskJava">
+
+ <title>Task: Java Receive task</title>
+
+ <para>
+ A <emphasis role="bold">receive task</emphasis> is a task that waits for the arrival of
+ an external message. Besides the obvious use case involving webservices, the specification
+ is liberal in what to do in other environment. The web service use case is not yet
+ implemented, but the receive task can already be used in a Java environment.
+ </para>
+
+ <para>
+ The receive task is depicted as a rounded rectangle (= task shape) with a little enveloppe
+ in the left top corner.
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.receive.task.java.png"/></imageobject></mediaobject>
+ </para>
+
+ <para>
+ In a Java environment, the receive task without any other attribute filled in besides
+ an id and (optionally) a name, behaves as a wait state. To introduce a wait state in your
+ business process, just add the following line:
+ <programlisting>
+<receiveTask id="receiveTask" name="wait" />
+ </programlisting>
+ Process execution will wait in such a receive task. The process can then be continued
+ using the familiar jBPM <emphasis role="bold">signal methods</emphasis>. Note that
+ this will probably change in the future, since a 'signal' has a completely different
+ meaning in BPMN 2.0.
+ <programlisting>
+Execution execution = processInstance.findActiveExecutionIn("receiveTask");
+executionService.signalExecutionById(execution.getId());
+ </programlisting>
+ </para>
+
+ </section>
</section> <!-- End of basic constructs section -->
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/receive/ReceiveTaskJavaTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/receive/ReceiveTaskJavaTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/receive/ReceiveTaskJavaTest.java 2009-12-21 17:29:04 UTC (rev 6011)
@@ -0,0 +1,49 @@
+/*
+ * 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.examples.bpmn.task.receive;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ *
+ * @author Joram Barrez
+ */
+public class ReceiveTaskJavaTest extends JbpmTestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/task/receive/receive_task_java.bpmn.xml");
+ registerDeployment(deployment.deploy());
+ }
+
+ public void testWaitStatebehaviour() {
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("receiveTaskJava");
+ assertActivityActive(processInstance.getId(), "receiveTask");
+ executionService.signalExecutionById(processInstance.findActiveExecutionIn("receiveTask").getId());
+ //assertProcessInstanceEnded(processInstance);
+ }
+
+}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/script/ScriptTaskTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/script/ScriptTaskTest.java 2009-12-21 16:48:15 UTC (rev 6010)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/script/ScriptTaskTest.java 2009-12-21 17:29:04 UTC (rev 6011)
@@ -39,8 +39,7 @@
protected void setUp() throws Exception {
super.setUp();
NewDeployment deployment = repositoryService.createDeployment();
- deployment
- .addResourceFromClasspath("org/jbpm/examples/bpmn/task/script/script_task.bpmn.xml");
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/task/script/script_task.bpmn.xml");
registerDeployment(deployment.deploy());
}
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/receive/receive_task_java.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/receive/receive_task_java.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/receive/receive_task_java.bpmn.xml 2009-12-21 17:29:04 UTC (rev 6011)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../../../../../bpmn/src/main/resources/BPMN20.xsd"
+ xmlns="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://jbpm.org/example/bpmn2/receiveTaskJava">
+
+ <process id="receiveTaskJava" name="Bpmn 2.0 example receive task Java">
+
+ <startEvent id="Start" />
+
+ <sequenceFlow id="flow1" sourceRef="Start"
+ targetRef="receiveTask" />
+
+ <receiveTask id="receiveTask" name="wait" />
+
+ <sequenceFlow id="flow2" sourceRef="receiveTask"
+ targetRef="End" />
+
+ <endEvent id="End" name="End" />
+
+ </process>
+</definitions>
16 years, 4 months
JBoss JBPM SVN: r6010 - jbpm4/trunk/modules/log.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-21 11:48:15 -0500 (Mon, 21 Dec 2009)
New Revision: 6010
Removed:
jbpm4/trunk/modules/log/target/
Log:
deleting target directory
16 years, 4 months
JBoss JBPM SVN: r6009 - jbpm4/trunk/modules/log/target/maven-archiver.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-21 11:45:24 -0500 (Mon, 21 Dec 2009)
New Revision: 6009
Removed:
jbpm4/trunk/modules/log/target/maven-archiver/pom.properties
Log:
deleting target directory
Deleted: jbpm4/trunk/modules/log/target/maven-archiver/pom.properties
===================================================================
--- jbpm4/trunk/modules/log/target/maven-archiver/pom.properties 2009-12-21 16:45:12 UTC (rev 6008)
+++ jbpm4/trunk/modules/log/target/maven-archiver/pom.properties 2009-12-21 16:45:24 UTC (rev 6009)
@@ -1,5 +0,0 @@
-#Generated by Maven
-#Mon Dec 21 17:34:35 CET 2009
-version=4.3-SNAPSHOT
-groupId=org.jbpm.jbpm4
-artifactId=jbpm-log
16 years, 4 months
JBoss JBPM SVN: r6008 - jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-21 11:45:12 -0500 (Mon, 21 Dec 2009)
New Revision: 6008
Removed:
jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/ConsoleHandler.class
jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/Jdk14Log.class
jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/Log4jLog.class
jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/LogFactory.class
Log:
deleting target directory
Deleted: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/ConsoleHandler.class
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/Jdk14Log.class
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/Log4jLog.class
===================================================================
(Binary files differ)
Deleted: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/LogFactory.class
===================================================================
(Binary files differ)
16 years, 4 months
JBoss JBPM SVN: r6007 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples and 16 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-21 11:39:23 -0500 (Mon, 21 Dec 2009)
New Revision: 6007
Added:
jbpm4/trunk/modules/log/target/
jbpm4/trunk/modules/log/target/classes/
jbpm4/trunk/modules/log/target/classes/org/
jbpm4/trunk/modules/log/target/classes/org/jbpm/
jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/
jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/
jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/ConsoleHandler.class
jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/Jdk14Log.class
jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/Log4jLog.class
jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/LogFactory.class
jbpm4/trunk/modules/log/target/maven-archiver/
jbpm4/trunk/modules/log/target/maven-archiver/pom.properties
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MockRunnerExtensions.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MockRunnerTest.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/jms/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/jms/JmsTest.java
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/jbpm.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/process.jpdl.xml
Removed:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/jms/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/jms/
Modified:
jbpm4/trunk/modules/examples/pom.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java
jbpm4/trunk/modules/test-base/pom.xml
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
Log:
JBPM-2695 added JMS test helper methods to JbpmTestCase. added JMS mock test case to module test-cfg
Modified: jbpm4/trunk/modules/examples/pom.xml
===================================================================
--- jbpm4/trunk/modules/examples/pom.xml 2009-12-21 15:20:53 UTC (rev 6006)
+++ jbpm4/trunk/modules/examples/pom.xml 2009-12-21 16:39:23 UTC (rev 6007)
@@ -37,17 +37,14 @@
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-test-base</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-jpdl</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-bpmn</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
@@ -72,24 +69,6 @@
<artifactId>spring</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mockejb</groupId>
- <artifactId>mockejb</artifactId>
- <version>0.6-beta2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- <version>2.1_3</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>apache-oro</groupId>
- <artifactId>jakarta-oro</artifactId>
- <version>2.0.8</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java 2009-12-21 15:20:53 UTC (rev 6006)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java 2009-12-21 16:39:23 UTC (rev 6007)
@@ -24,9 +24,6 @@
import java.io.Serializable;
import java.util.List;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.ObjectMessage;
@@ -37,9 +34,7 @@
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;
-import javax.naming.Context;
import javax.naming.InitialContext;
-import javax.naming.NamingException;
import org.jbpm.api.JbpmException;
import org.jbpm.api.model.OpenExecution;
@@ -51,161 +46,133 @@
/**
* @author Koen Aers
+ * @author Tom Baeyens
*/
-public class JmsActivity extends JpdlAutomaticActivity
-{
+public class JmsActivity extends JpdlAutomaticActivity {
private static final Log log = Log.getLog(JmsActivity.class.getName());
private static final long serialVersionUID = 1L;
- protected String type = "text";
- protected String text = "";
- protected String expression = "";
+ protected String type = null;
+ protected String textExpression = null;
+ protected String objectExpression = null;
protected MapDescriptor mapDescriptor = null;
- protected String connectionFactoryName = "";
- protected String destinationName = "";
+ protected String connectionFactoryName = null;
+ protected String destinationName = null;
- public void perform(OpenExecution execution)
- {
- try
- {
- Context context = new InitialContext();
- if (context == null)
- return;
- ConnectionFactory connectionFactory = getConnectionFactory(context);
- if (connectionFactory == null)
- return;
- Destination destination = getDestination(context);
- if (destination instanceof Queue)
- {
- performQueueSend(connectionFactory, (Queue)destination);
+ public void perform(OpenExecution execution) {
+ try {
+ InitialContext initialContext = new InitialContext();
+
+ QueueConnectionFactory connectionFactory = (QueueConnectionFactory) initialContext.lookup(connectionFactoryName);
+ QueueConnection queueConnection = connectionFactory.createQueueConnection();
+ try {
+
+ QueueSession queueSession = queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
+ try {
+
+ Queue queue = (Queue) initialContext.lookup(destinationName);
+ QueueSender queueSender = queueSession.createSender(queue);
+ try {
+ Message message = createMessage(queueSession);
+ queueSender.send(message);
+
+ } catch (Exception e) {
+ logAndRethrow(e);
+ } finally {
+ queueSender.close();
+ }
+
+ } catch (Exception e) {
+ logAndRethrow(e);
+ } finally {
+ queueSession.close();
+ }
+
+ } catch (Exception e) {
+ logAndRethrow(e);
+ } finally {
+ queueConnection.close();
}
+
+ } catch (Exception e) {
+ logAndRethrow(e);
}
- catch (JMSException e)
- {
- log.warn("JMSException while performing JmsActivity", e);
- }
- catch (NamingException e)
- {
- log.warn("NamingException while performing JmsActivity", e);
- }
}
- private Object substituteVariables(String input)
- {
- return (Object)ScriptManager.getScriptManager().evaluateExpression(input, null);
+ private void logAndRethrow(Exception e) {
+ if (e instanceof JbpmException) {
+ throw (JbpmException) e;
+ }
+ log.error("couldn't send jms message: "+e.getMessage(), e);
+ throw new JbpmException("couldn't send jms message: "+e.getMessage(), e);
}
- private void performQueueSend(ConnectionFactory connectionFactory, Queue queue) throws JMSException
- {
- if (!(connectionFactory instanceof QueueConnectionFactory))
- return;
- QueueConnection queueConnection = ((QueueConnectionFactory)connectionFactory).createQueueConnection();
- QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
- queueConnection.start();
- QueueSender queueSender = queueSession.createSender(queue);
- Message message = createMessage(queueSession);
- queueSender.send(message);
- queueSender.close();
- queueConnection.stop();
- queueConnection.close();
- queueSession.close();
- }
-
- private Message createMessage(Session session) throws JMSException {
+ private Message createMessage(Session session) throws Exception {
if ("text".equals(type)) {
return createTextMessage(session);
} else if ("object".equals(type)) {
return createObjectMessage(session);
} else if ("map".equals(type)) {
return createMapMessage(session);
- } else {
- return null;
}
+ throw new JbpmException("no type configured in jms activity");
}
-
- private MapMessage createMapMessage(Session session) throws JMSException {
+
+ private MapMessage createMapMessage(Session session) throws Exception {
MapMessage result = session.createMapMessage();
if (mapDescriptor != null) {
List<Descriptor> keyDescriptors = mapDescriptor.getKeyDescriptors();
List<Descriptor> valueDescriptors = mapDescriptor.getValueDescriptors();
for (int i = 0; i < keyDescriptors.size(); i++) {
- String key = (String)WireContext.create(keyDescriptors.get(i));
- Object value = WireContext.create(valueDescriptors.get(i));
+ String key = (String) WireContext.create(keyDescriptors.get(i));
+ Object value = (String) WireContext.create(valueDescriptors.get(i));
result.setObject(key, value);
}
}
return result;
}
-
- private TextMessage createTextMessage(Session session) throws JMSException {
- return session.createTextMessage((String)substituteVariables(text));
- }
-
- private ObjectMessage createObjectMessage(Session session) throws JMSException {
- Object object = substituteVariables(expression);
- if (!(object instanceof Serializable)) {
- throw new JbpmException(object + " is not serializable and cannot be used as payload of a jms object message");
- }
- return session.createObjectMessage((Serializable)substituteVariables(expression));
- }
- private Destination getDestination(Context context) throws NamingException
- {
- Destination result = null;
- Object object = context.lookup(destinationName);
- if (object instanceof Destination)
- {
- result = (Destination)object;
+ private TextMessage createTextMessage(Session session) throws Exception {
+ Object value = ScriptManager.getScriptManager().evaluateExpression(textExpression, null);
+ if (value!=null) {
+ return session.createTextMessage(value.toString());
}
- else
- {
- log.warn("Object bound to " + destinationName + " is no javax.jms.Destination");
- }
- return result;
+ throw new JbpmException("null value for expression '"+textExpression+"' in jms activity");
}
- private ConnectionFactory getConnectionFactory(Context context) throws NamingException
- {
- ConnectionFactory result = null;
- Object object = context.lookup(connectionFactoryName);
- if (object instanceof ConnectionFactory)
- {
- result = (ConnectionFactory)object;
+ private ObjectMessage createObjectMessage(Session session) throws Exception {
+ Object object = ScriptManager.getScriptManager().evaluateExpression(objectExpression, null);
+ if ( (object!=null)
+ && !(object instanceof Serializable)
+ ) {
+ throw new JbpmException("can't send jms message: creation of object message expression '"+objectExpression+"' must be done with serializable: "+object);
}
- else
- {
- log.warn("Object bound to " + connectionFactoryName + " is no javax.jms.ConnectionFactory");
- }
- return result;
+ return session.createObjectMessage((Serializable) object);
}
- public void setType(String type)
- {
+ public void setType(String type) {
this.type = type;
}
- public void setText(String text)
- {
- this.text = text;
+ public void setText(String text) {
+ this.textExpression = text;
}
-
+
public void setExpression(String expression) {
- this.expression = expression;
+ this.objectExpression = expression;
}
-
+
public void setMapDescriptor(MapDescriptor mapDescriptor) {
this.mapDescriptor = mapDescriptor;
}
- public void setConnectionFactoryName(String connectionFactoryName)
- {
+ public void setConnectionFactoryName(String connectionFactoryName) {
this.connectionFactoryName = connectionFactoryName;
}
- public void setDestinationName(String destinationName)
- {
+ public void setDestinationName(String destinationName) {
this.destinationName = destinationName;
}
}
Added: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/ConsoleHandler.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/ConsoleHandler.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/Jdk14Log.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/Jdk14Log.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/Log4jLog.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/Log4jLog.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/LogFactory.class
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/log/target/classes/org/jbpm/internal/log/LogFactory.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/log/target/maven-archiver/pom.properties
===================================================================
--- jbpm4/trunk/modules/log/target/maven-archiver/pom.properties (rev 0)
+++ jbpm4/trunk/modules/log/target/maven-archiver/pom.properties 2009-12-21 16:39:23 UTC (rev 6007)
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Mon Dec 21 17:34:35 CET 2009
+version=4.3-SNAPSHOT
+groupId=org.jbpm.jbpm4
+artifactId=jbpm-log
Property changes on: jbpm4/trunk/modules/log/target/maven-archiver/pom.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/test-base/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-base/pom.xml 2009-12-21 15:20:53 UTC (rev 6006)
+++ jbpm4/trunk/modules/test-base/pom.xml 2009-12-21 16:39:23 UTC (rev 6007)
@@ -68,6 +68,22 @@
<artifactId>mockrunner</artifactId>
<version>0.4.1</version>
</dependency>
+ <dependency>
+ <!-- mockrunner transitive dependency (not in mockrunner pom) -->
+ <groupId>org.mockejb</groupId>
+ <artifactId>mockejb</artifactId>
+ <version>0.6-beta2</version>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>2.1_3</version>
+ </dependency>
+ <!-- dependency>
+ <groupId>apache-oro</groupId>
+ <artifactId>jakarta-oro</artifactId>
+ <version>2.0.8</version>
+ </dependency -->
</dependencies>
<!-- Plugins -->
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-12-21 15:20:53 UTC (rev 6006)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-12-21 16:39:23 UTC (rev 6007)
@@ -103,7 +103,15 @@
}
}
}
+
+ public void createQueue(String connectionFactoryJndiName, String queueJndiName) {
+ MockRunnerExtensions.createQueue(connectionFactoryJndiName, queueJndiName);
+ }
+ public List getJmsMessagesFromQueue(String connectionFactoryJndiName, String queueJndiName) {
+ return MockRunnerExtensions.consumeMessage(connectionFactoryJndiName, queueJndiName);
+ }
+
protected String verifyDbClean() {
String errorMsg = null;
String recordsLeftMsg = Db.verifyClean(processEngine);
Added: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MockRunnerExtensions.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MockRunnerExtensions.java (rev 0)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MockRunnerExtensions.java 2009-12-21 16:39:23 UTC (rev 6007)
@@ -0,0 +1,101 @@
+/*
+ * 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;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jbpm.api.JbpmException;
+
+import com.mockrunner.ejb.JNDIUtil;
+import com.mockrunner.jms.JMSTestModule;
+import com.mockrunner.mock.jms.JMSMockObjectFactory;
+import com.mockrunner.mock.jms.MockQueue;
+import com.mockrunner.mock.jms.MockQueueConnectionFactory;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class MockRunnerExtensions {
+
+ static {
+ try {
+ new InitialContext().getEnvironment();
+ } catch (NamingException e) {
+ try {
+ JNDIUtil.initMockContextFactory();
+ } catch (Exception e2) {
+ e.printStackTrace();
+ throw new RuntimeException("coudn't initialize mock jndi: "+e2.getMessage(), e2);
+ }
+ }
+ }
+
+ static Map<String, JMSMockObjectFactory> jmsMockObjectFactories = new HashMap<String, JMSMockObjectFactory>();
+ static Map<String, JMSTestModule> jmsTestModules = new HashMap<String, JMSTestModule>();
+
+ public static void createQueue(String connectionFactoryJndiName, String queueJndiName) {
+ MockQueue queue = getJmsTestModule(connectionFactoryJndiName)
+ .getDestinationManager()
+ .createQueue(queueJndiName);
+
+ try {
+ new InitialContext().bind(queueJndiName, queue);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't bind mock queue '"+queueJndiName+"': "+e.getMessage(), e);
+ }
+ }
+
+ private static JMSTestModule getJmsTestModule(String connectionFactoryJndiName) {
+ JMSTestModule jmsTestModule = jmsTestModules.get(connectionFactoryJndiName);
+ if (jmsTestModule==null) {
+ JMSMockObjectFactory jmsMockObjectFactory = getMockObjectFactory(connectionFactoryJndiName);
+ jmsTestModule = new JMSTestModule(jmsMockObjectFactory);
+ jmsTestModules.put(connectionFactoryJndiName, jmsTestModule);
+ }
+ return jmsTestModule;
+ }
+
+ private static JMSMockObjectFactory getMockObjectFactory(String connectionFactoryJndiName) {
+ JMSMockObjectFactory jmsMockObjectFactory = jmsMockObjectFactories.get(connectionFactoryJndiName);
+ if (jmsMockObjectFactory==null) {
+ jmsMockObjectFactory = new JMSMockObjectFactory();
+ jmsMockObjectFactories.put(connectionFactoryJndiName, jmsMockObjectFactory);
+ MockQueueConnectionFactory mockQueueConnectionFactory = jmsMockObjectFactory.getMockQueueConnectionFactory();
+ try {
+ new InitialContext().bind(connectionFactoryJndiName, mockQueueConnectionFactory);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't bind mock queue connection factory '"+connectionFactoryJndiName+"': "+e.getMessage(), e);
+ }
+ }
+ return jmsMockObjectFactory;
+ }
+
+ public static List consumeMessage(String connectionFactoryJndiName, String queueJndiName) {
+ return getJmsTestModule(connectionFactoryJndiName).getCurrentMessageListFromQueue(queueJndiName);
+ }
+}
Property changes on: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MockRunnerExtensions.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MockRunnerTest.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MockRunnerTest.java (rev 0)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MockRunnerTest.java 2009-12-21 16:39:23 UTC (rev 6007)
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+import javax.jms.Queue;
+import javax.naming.InitialContext;
+
+import com.mockrunner.ejb.JNDIUtil;
+import com.mockrunner.jms.JMSTestModule;
+import com.mockrunner.mock.jms.JMSMockObjectFactory;
+import com.mockrunner.mock.jms.MockQueueConnectionFactory;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class MockRunnerTest extends BaseJbpmTestCase {
+
+ public void testMockRunner() throws Exception {
+ JNDIUtil.initMockContextFactory();
+ JMSMockObjectFactory jmsMockObjectFactory = new JMSMockObjectFactory();
+ MockQueueConnectionFactory mockQueueConnectionFactory = jmsMockObjectFactory.getMockQueueConnectionFactory();
+ JMSTestModule jmsTestModule = new JMSTestModule(jmsMockObjectFactory);
+
+
+ InitialContext initialContext = new InitialContext();
+
+ initialContext.bind("jms/ConnectionFactory", mockQueueConnectionFactory);
+
+ assertSame(mockQueueConnectionFactory, initialContext.lookup("jms/ConnectionFactory"));
+
+ Queue queue = jmsTestModule.getDestinationManager().createQueue("JmsActivityQueue");
+
+ initialContext.bind("queues/JmsActivityQueue", queue);
+
+ assertSame(queue, initialContext.lookup("queues/JmsActivityQueue"));
+ }
+}
Property changes on: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MockRunnerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/jms/JmsTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/jms/JmsTest.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/jms/JmsTest.java 2009-12-21 16:39:23 UTC (rev 6007)
@@ -0,0 +1,63 @@
+/*
+ * 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.jms;
+
+import java.util.List;
+
+import javax.jms.MapMessage;
+
+import org.jbpm.test.JbpmCustomCfgTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class JmsTest extends JbpmCustomCfgTestCase {
+
+ String deploymentId;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ deploymentId = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/test/jms/process.jpdl.xml")
+ .deploy();
+
+ createQueue("jms/ConnectionFactory", "queue/ProductQueue");
+ }
+
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentId);
+
+ super.tearDown();
+ }
+
+ public void testSendJmsMessage() throws Exception {
+ executionService.startProcessInstanceByKey("Jms");
+
+ List messages = getJmsMessagesFromQueue("jms/ConnectionFactory", "queue/ProductQueue");
+ assertEquals(messages.toString(), 1, messages.size());
+
+ MapMessage mapMessage = (MapMessage) messages.get(0);
+ assertEquals("shampoo", mapMessage.getString("product"));
+ }
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/jms/JmsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/jbpm.cfg.xml 2009-12-21 16:39:23 UTC (rev 6007)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.businesscalendar.cfg.xml" />
+ <import resource="jbpm.tx.hibernate.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.bpmn.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/process.jpdl.xml 2009-12-21 16:39:23 UTC (rev 6007)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Jms">
+
+ <start g="20,20,48,48">
+ <transition to="send message" />
+ </start>
+
+ <jms name="send message"
+ connection-factory="jms/ConnectionFactory"
+ destination="queue/ProductQueue"
+ g="96,16,83,52">
+ <map>
+ <entry>
+ <key><string value="product"/></key>
+ <value><string value="shampoo"/></value>
+ </entry>
+ </map>
+ <transition to="wait" />
+ </jms>
+
+ <state name="wait" g="352,17,88,52"/>
+
+</process>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/jms/process.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 4 months
JBoss JBPM SVN: r6006 - in jbpm4/trunk/modules/devguide/src/main/docbook/en: modules and 1 other directory.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-12-21 10:20:53 -0500 (Mon, 21 Dec 2009)
New Revision: 6006
Added:
jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.01.png
jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.02.png
jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.03.png
jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.04.png
jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.png
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
Log:
JBPM-2675 and JBPM-2660: added complete example to BPMN 2.0 documentation
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.01.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.01.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.02.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.02.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.03.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.03.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.04.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.console.04.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.vacationrequest.example.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml 2009-12-21 10:03:33 UTC (rev 6005)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml 2009-12-21 15:20:53 UTC (rev 6006)
@@ -136,16 +136,6 @@
</section>
- <section id="gettingStartedWithBpmn2" >
-
- <title>Getting started</title>
-
- <para>
-
- </para>
-
- </section>
-
<section id="Bpmn2Execution" >
<title>Bpmn 2.0 execution</title>
@@ -870,4 +860,205 @@
</section> <!-- End of basic constructs section -->
+ <section id="completeExample">
+
+ <title>Complete example (including console task forms)</title>
+
+ <para>
+ <emphasis role="bold">Prerequisites</emphasis>: to run the example, we assume that a working
+ jBPM console has been installed on your JBoss server. If not, please run the 'demo.setup.jboss'
+ install script first.
+ </para>
+
+ <para>
+ The business process we're implementing looks as follows:
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.vacationrequest.example.png"/></imageobject></mediaobject>
+ You might recognize this example, since we’ve also implemented it in
+ JPDL as an example in our distribution.
+ </para>
+ <para>
+ The business process is simple: an employee can start a new process and
+ make a request for a certain amount of vacation days. After the request
+ task has been completed, the manager will find a verification task in
+ its tasklist. The Manager can now decide to accept or reject this
+ request. Depending on the outcome (that’s the little rhombus on the
+ outgoing sequence flow - it means there is a conditional expression on the sequence flow),
+ a rejection message is send or the process ends. Do note that in fact we've used a shortcut
+ here: instead of putting expressions on the outgoing sequence flow of the 'verify request'
+ task, we've could have used an exclusive gateway after the user task to control the flow
+ through the process. Also note that since we haven't implemented swimlanes yet (probably
+ the next release), it's difficult to actually see who does what in the business process.
+ </para>
+
+ <para>
+ The XML version of this process looks as follows:
+ <programlisting>
+<process id="vacationRequestProcess" name="BPMN2 Example process using task forms">
+
+ <startEvent id="start" />
+
+ <sequenceFlow id="flow1" name="fromStartToRequestVacation"
+ sourceRef="start" targetRef="requestVacation" />
+
+ <userTask id="requestVacation" name="Request Vacation"
+ implementation="other">
+ <potentialOwner resourceRef="user" />
+ <rendering id="requestForm">
+ <jbpm:form>org/jbpm/examples/bpmn/usertask/taskform/request_vacation.ftl</jbpm:form>
+ </rendering>
+ </userTask>
+
+ <sequenceFlow id="flow2"
+ name="fromRequestVacationToVerifyRequest" sourceRef="requestVacation"
+ targetRef="verifyRequest" />
+
+ <userTask id="verifyRequest" name="Verify Request"
+ implementation="other">
+ <potentialOwner resourceRef="manager" />
+ <rendering id="verifyForm">
+ <jbpm:form>org/jbpm/examples/bpmn/usertask/taskform/verify_request.ftl</jbpm:form>
+ </rendering>
+ </userTask>
+
+ <sequenceFlow id="flow3" name="fromVerifyRequestToEnd"
+ sourceRef="verifyRequest" targetRef="theEnd">
+ <conditionExpression xsi:type="tFormalExpression">
+ ${verificationResult == 'OK'}
+ </conditionExpression>
+ </sequenceFlow>
+
+ <sequenceFlow id="flow4"
+ name="fromVerifyRequestToSendRejectionMessage" sourceRef="verifyRequest"
+ targetRef="sendRejectionMessage">
+ <conditionExpression xsi:type="tFormalExpression">
+ ${verificationResult == 'Not OK'}
+ </conditionExpression>
+ </sequenceFlow>
+
+ <scriptTask id="sendRejectionMessage" name="Send rejection Message"
+ scriptLanguage="bsh">
+ <script>
+ <![CDATA[System.out.println("Vacation request refused!");]]>
+ </script>
+ </scriptTask>
+
+ <sequenceFlow id="flow5"
+ name="fromSendRejectionMessageToEnd" sourceRef="sendRejectionMessage"
+ targetRef="theEnd" />
+
+ <endEvent id="theEnd" name="End" />
+</process>
+ </programlisting>
+ <emphasis role="bold">Note</emphasis>: this example is already installed when you've
+ used the demo setup. Also note that we're using a Script Task here, to quickly write
+ something as output instead of sending a real message (the diagram is showing a Service
+ Task). Also note that we've taken some shortcuts here regarding task assignment (will
+ be fixed in the next release).
+ </para>
+
+ <para>
+ The constructs used in this implementation are all covered in the previous section.
+ Also note that we're using the <emphasis role="bold">taskform functionality</emphasis>
+ here, which is a custom jBPM extension for the <emphasis role="bold">rendering</emphasis>
+ element of a User task.
+ <programlisting>
+<userTask id="verifyRequest" name="Verify Request"
+ implementation="other">
+ <potentialOwner resourceRef="manager" />
+ <rendering id="verifyForm">
+ <jbpm:form>org/jbpm/examples/bpmn/usertask/taskform/verify_request.ftl</jbpm:form>
+ </rendering>
+</userTask>
+ </programlisting>
+ The mechanism regarding task forms for BPMN 2.0 is complete equivalent to that of JPDL.
+ The form itself is a <ulink url="http://freemarker.org/">Freemarker</ulink> template file
+ that needs to be incorporated in the deployment. For example, the 'verify_request' form
+ looks like as follows.
+ <programlisting>
+<html>
+ <body>
+
+ <form action="${form.action}" method="POST" enctype="multipart/form-data">
+
+ <h3>Your employee, ${employee_name} would like to go on vacation</h3>
+ Number of days: ${number_of_days}<br/>
+
+ <hr>
+
+ In case you reject, please provide a reason:<br/>
+ <input type="textarea" name="reason"/><br/>
+
+ <input type="submit" name="verificationResult" value="OK">
+ <input type="submit" name="verificationResult" value="Not OK">
+
+ </form>
+ </body>
+</html>
+ </programlisting>
+ Note that <emphasis role="bold">process variables can be
+ used using the ${my_process_variable} construct.</emphasis> Also note that named
+ input controls (eg. input field, submit button) can be used to
+ <emphasis role="bold">define new process variables</emphasis>.
+ For example, the text input of the following field will be stored as the process
+ variable 'reason'
+ <programlisting>
+<input type="textarea" name="reason"/>
+ </programlisting>
+ Note that there are two submit buttons (which makes sense if you look at the 'OK' and 'Not OK'
+ sequence flows going out the 'request vacation' task. By pressing one of these buttons, the
+ process variable 'verificationResult' will be stored. It can then be used to evaluate the
+ outgoing sequence flow:
+ <programlisting>
+<sequenceFlow id="flow3" name="fromVerifyRequestToEnd"
+ sourceRef="verifyRequest" targetRef="theEnd">
+ <conditionExpression xsi:type="tFormalExpression">
+ ${verificationResult == 'OK'}
+ </conditionExpression>
+</sequenceFlow>
+ </programlisting>
+ </para>
+
+ <para>
+ The process can now be deployed. You can use the ant deploy task for this (see examples),
+ or you can point your jBPM configuration to the database of the console. To deploy
+ your process programmatically, you need to add the task forms to your deployment:
+ <programlisting>
+NewDeployment deployment = repositoryService.createDeployment();
+deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/usertask/taskform/vacationrequest.bpmn.xml");
+deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/usertask/taskform/request_vacation.ftl");
+deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/usertask/taskform/verify_request.ftl");
+deployment.deploy();
+ </programlisting>
+ You can now embed (or run on a standalone server) this business process, by using the
+ familiar jBPM API operations. For example, process instances can now be started using the
+ key (ie. the process id for BPMN 2.0):
+ <programlisting>
+ProcessInstance pi = executionService.startProcessInstanceByKey("vacationRequestProcess");
+ </programlisting>
+ Or tasks list can be retrieved:
+ <programlisting>
+Task requestTasktask = taskService.createTaskQuery().candidate("peter").uniqueResult();
+ </programlisting>
+ </para>
+
+ <para>
+ When deploying to the jBPM console database, you should see our new business process popping up.
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.vacationrequest.example.console.01.png"/></imageobject></mediaobject>
+
+ After you start a new process, a new task should be available in the employee's tasklist.
+ When clicking on 'view', the task form will be displayed, requesting to fill in some
+ variables for further use in the process.
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.vacationrequest.example.console.02.png"/></imageobject></mediaobject>
+
+ After task completion, the manager will find a new verification task in his task list.
+ He can now accept or reject the vacation request, based on the input of the employee.
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.vacationrequest.example.console.03.png"/></imageobject></mediaobject>
+
+ Since the database schema remains unchanged when we added BPMN 2.0 on top of the jBPM PVM, all
+ existing reports can be applied to our new BPMN 2.0 processes.
+ <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.vacationrequest.example.console.04.png"/></imageobject></mediaobject>
+ </para>
+
+ </section>
+
</chapter>
16 years, 4 months