[jboss-svn-commits] JBL Code SVN: r38122 - in labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor: src/org/jboss/soa/esb/samples/quickstart/bpm5processor and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Jun 11 00:27:26 EDT 2012
Author: tcunning
Date: 2012-06-11 00:27:20 -0400 (Mon, 11 Jun 2012)
New Revision: 38122
Added:
labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/sample.bpmn
Modified:
labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/build.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/readme.txt
labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/src/org/jboss/soa/esb/samples/quickstart/bpm5processor/MyJMSListenerAction.java
Log:
JBESB-3817
Change the bpm5processor Quickstart so that instead of running the Evaluation example, we
run a simple example which shows off the ESBWorkItemHandler by passing a message to a second service.
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/build.xml 2012-06-08 11:53:14 UTC (rev 38121)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/build.xml 2012-06-11 04:27:20 UTC (rev 38122)
@@ -8,7 +8,7 @@
<!--
<property name="additional.deploys" value="Evaluation.bpmn, META-INF/persistence.xml, META-INF/JBPMorm.xml, META-INF/hibernate.cfg.xml"/>
-->
- <property name="additional.deploys" value="Evaluation.bpmn"/>
+ <property name="additional.deploys" value="sample.bpmn, Evaluation.bpmn"/>
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/jboss-esb.xml 2012-06-08 11:53:14 UTC (rev 38121)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/jboss-esb.xml 2012-06-11 04:27:20 UTC (rev 38122)
@@ -39,8 +39,8 @@
<services>
<service
- category="FirstServiceESB"
- name="SimpleListener"
+ category="EsbJbpm5Example"
+ name="HandlerListener"
description="Hello World">
<listeners>
<jms-listener name="JMS-Gateway"
@@ -60,54 +60,33 @@
<property name="processHandlerClass" value="org.jbpm.task.service.hornetq.CommandBasedHornetQWSHumanTaskHandler"/>
<property name="processHandlerHost" value="127.0.0.1"/>
<property name="processHandlerPort" value="5446"/>
- <property name="process-definition-name" value="Evaluation.bpmn"/>
- <property name="process-id" value="com.sample.evaluation"/>
+ <property name="process-definition-name" value="sample.bpmn"/>
+ <property name="process-id" value="com.sample.bpmn.hello"/>
<property name="process-action" value="startProcess"/>
<property name="esbToBpmParams">
- <mapping esb="employee" bpm="employee" value="krisv"/>
- <mapping esb="reason" bpm="reason" value="Yearly performance review"/>
+ <mapping esb="ServiceCategory" bpm="ServiceCategory" value="EsbJbpm5Example"/>
+ <mapping esb="ServiceName" bpm="ServiceName" value="Printer"/>
</property>
-
</action>
-
- <action name="routeAction" class="org.jboss.soa.esb.actions.StaticRouter">
- <property name="destinations">
- <route-to service-category="FirstServiceESB" service-name="AbortListener"/>
- </property>
- </action>
</actions>
</service>
<service
- category="FirstServiceESB"
- name="AbortListener"
- description="Hello World">
+ category="EsbJbpm5Example"
+ name="Printer"
+ description="routedTo">
<listeners>
<jms-listener name="helloWorld"
busidref="quickstartAbortChannel"
/>
</listeners>
<actions mep="OneWay">
- <action name="jbpm5-2" class="org.jboss.soa.esb.services.jbpm5.actions.Bpm5Processor">
- <property name="processHandlerClass" value="org.jbpm.task.service.hornetq.CommandBasedHornetQWSHumanTaskHandler"/>
- <property name="processHandlerHost" value="127.0.0.1"/>
- <property name="processHandlerPort" value="5446"/>
-
- <property name="process-definition-name" value="Evaluation.bpmn"/>
- <property name="process-id" value="com.sample.evaluation"/>
- <property name="process-action" value="abortProcessInstance"/>
- <property name="esbToBpmParams">
- <mapping esb="employee" bpm="employee" value="krisv"/>
- <mapping esb="reason" bpm="reason" value="Yearly performance review"/>
- </property>
-
- </action>
-
- <action name="action3" class="org.jboss.soa.esb.actions.SystemPrintln">
+ <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true"/>
- </action>
-
+ </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
- </service>
+ </service>
+
</services>
</jbossesb>
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/readme.txt
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/readme.txt 2012-06-08 11:53:14 UTC (rev 38121)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/readme.txt 2012-06-11 04:27:20 UTC (rev 38122)
@@ -1,7 +1,8 @@
Overview:
=========
The purpose of the bpm5processor quickstart sample is to demonstrate the
- ability of the ESB to process an action on a single JBPM 5 process.
+ ability of the ESB to process an action on a single JBPM 5 process, and the
+ ability of the ESBWorkItemHandler to send a message back to the ESB.
Running this quickstart:
========================
@@ -48,3 +49,26 @@
'ant runtest'.
3. Switch back to Application Server console to see the output from the ESB
4. In this folder ("Window1"), type 'ant undeploy'.
+
+
+Expected Results:
+===========================
+
+The expected results here are that the first service starts a jbpm5 process in sample.bpmn that notifies an ESB process.
+The BPM5Processor action starts the process, and once the process is started, the ESBWorkItemHandler registered is used
+to send a message to the second ESB service. The second ESB service (EsbJbpm5Example:Printer) then prints the message
+to the console.
+
+
+0:10:21,484 INFO [STDOUT] Message structure:
+00:10:21,490 INFO [STDOUT] [Hello World].
+00:10:21,514 INFO [Bpm5Processor] startProcess
+00:10:21,521 INFO [InquiryHelper] uddi:juddi.apache.org:7e11d471-a7a3-4ae8-8530-eceb9de146de is modified Mon Jun 11 00:10:06 EDT 2012 1339387806742
+00:10:21,560 INFO [STDOUT] Message structure:
+00:10:21,561 INFO [STDOUT] [ message: [ JBOSS_XML ]
+header: [ To: JMSEpr [ PortReference < <wsa:Address jms:127.0.0.1:1099#queue/quickstart_bpm5processor_Request_abort/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:destination-name : queue/quickstart_bpm5processor_Request_abort/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 50410ca7-5f46-4cb7-81f8!
-13d9027cb9fc RelatesTo: jms:correlationID#50410ca7-5f46-4cb7-81f8-13d9027cb9fc ]
+context: {}
+body: [ objects: {org.jboss.soa.esb.message.defaultEntry=, ServiceName=Deferred serialized value: 5b1e4029, ServiceCategory=Deferred serialized value: 1f06727b} ]
+fault: [ ]
+attachments: [ Named:{}, Unnamed:[] ]
+properties: [ {org.jboss.soa.esb.message.transport.type=Deferred serialized value: 11e85f2b, JMSXDeliveryCount=1, org.jboss.soa.esb.message.byte.size=2883, javax.jms.message.redelivered=false, org.jboss.soa.esb.message.source=Deferred serialized value: 2ec0093c} ] ]
Added: labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/sample.bpmn
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/sample.bpmn (rev 0)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/sample.bpmn 2012-06-11 04:27:20 UTC (rev 38122)
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions id="Definition"
+ targetNamespace="http://www.jboss.org/drools"
+ typeLanguage="http://www.java.com/javaTypes"
+ expressionLanguage="http://www.mvel.org/2.0"
+ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
+ xmlns:g="http://www.jboss.org/drools/flow/gpd"
+ xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
+ xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
+ xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
+ xmlns:tns="http://www.jboss.org/drools">
+
+ <itemDefinition id="_ServiceCategoryItem" structureRef="String" />
+ <itemDefinition id="_ServiceNameItem" structureRef="String" />
+
+ <itemDefinition id="_4-ServiceCategoryItem" structureRef="String" />
+ <itemDefinition id="_4-ServiceNameItem" structureRef="String" />
+
+ <process processType="Private" isExecutable="true" id="com.sample.bpmn.hello" name="Hello World" >
+
+ <!-- process variables -->
+ <property id="ServiceCategory" itemSubjectRef="_ServiceCategoryItem"/>
+ <property id="ServiceName" itemSubjectRef="_ServiceNameItem"/>
+
+ <!-- nodes -->
+ <startEvent id="_1" name="StartProcess" />
+ <endEvent id="_3" name="EndProcess" >
+ <terminateEventDefinition/>
+ </endEvent>
+ <task id="_4" name="JBossESB" tns:taskName="JBossESB" >
+ <ioSpecification>
+ <dataInput id="_4_ServiceNameInput" name="ServiceName" />
+ <dataInput id="_4_ServiceCategoryInput" name="ServiceCategory" />
+ <inputSet>
+ <dataInputRefs>_4_ServiceNameInput</dataInputRefs>
+ <dataInputRefs>_4_ServiceCategoryInput</dataInputRefs>
+ </inputSet>
+ <outputSet>
+ </outputSet>
+ </ioSpecification>
+ <dataInputAssociation>
+ <targetRef>_4_ServiceNameInput</targetRef>
+ <assignment>
+ <from xsi:type="tFormalExpression">#{ServiceName}</from>
+ <to xsi:type="tFormalExpression">_4_ServiceNameInput</to>
+ </assignment>
+ </dataInputAssociation>
+ <dataInputAssociation>
+ <targetRef>_4_ServiceCategoryInput</targetRef>
+ <assignment>
+ <from xsi:type="tFormalExpression">#{ServiceCategory}</from>
+ <to xsi:type="tFormalExpression">_4_ServiceCategoryInput</to>
+ </assignment>
+ </dataInputAssociation>
+ </task>
+
+ <!-- connections -->
+ <sequenceFlow id="_4-_3" sourceRef="_4" targetRef="_3" />
+ <sequenceFlow id="_1-_4" sourceRef="_1" targetRef="_4" />
+
+ </process>
+
+ <bpmndi:BPMNDiagram>
+ <bpmndi:BPMNPlane bpmnElement="com.sample.bpmn.hello" >
+ <bpmndi:BPMNShape bpmnElement="_1" >
+ <dc:Bounds x="16" y="16" width="48" height="48" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="_3" >
+ <dc:Bounds x="228" y="16" width="48" height="48" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape bpmnElement="_4" >
+ <dc:Bounds x="96" y="16" width="100" height="48" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge bpmnElement="_4-_3" >
+ <di:waypoint x="146" y="40" />
+ <di:waypoint x="252" y="40" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge bpmnElement="_1-_4" >
+ <di:waypoint x="40" y="40" />
+ <di:waypoint x="146" y="40" />
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+
+</definitions>
\ No newline at end of file
Modified: labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/src/org/jboss/soa/esb/samples/quickstart/bpm5processor/MyJMSListenerAction.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/src/org/jboss/soa/esb/samples/quickstart/bpm5processor/MyJMSListenerAction.java 2012-06-08 11:53:14 UTC (rev 38121)
+++ labs/jbossesb/branches/JBESB_4_11_CP/product/samples/quickstarts/bpm5processor/src/org/jboss/soa/esb/samples/quickstart/bpm5processor/MyJMSListenerAction.java 2012-06-11 04:27:20 UTC (rev 38122)
@@ -32,14 +32,26 @@
public MyJMSListenerAction(ConfigTree config) { _config = config; }
- public Message displayMessage(Message message) throws Exception{
+ public Message displayMessage(Message message) throws Exception {
+
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ for (String key : message.getContext().getContextKeys()) {
+ System.out.println("Context key: " + key + " Value: " + message.getContext().getContext(key)) ;
+ }
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ for (String name : message.getProperties().getNames()) {
+ System.out.println("Property name: " + name + " Value: " + message.getProperties().getProperty(name)) ;
+ }
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
System.out.println("Body: " + message.getBody().get()) ;
System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
return message;
- }
+ }
}
More information about the jboss-svn-commits
mailing list