Author: objectiser
Date: 2009-10-29 13:03:15 -0400 (Thu, 29 Oct 2009)
New Revision: 214
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq4.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp4.xml
trunk/samples/quickstart/loan_approval/messages/loanreq4.xml
Modified:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELLoanApprovalTestCase.java
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/bpel/loan_approval.bpel
trunk/samples/quickstart/loan_approval/bpel/loan_approval.bpel
trunk/samples/quickstart/loan_approval/build.xml
trunk/samples/quickstart/loan_approval/readme.txt
Log:
loan_approval example now can return its own fault if the amount=0. This currently returns
an incorrect fault to the client (RIFTSAW-91).
Modified:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELLoanApprovalTestCase.java
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELLoanApprovalTestCase.java 2009-10-29
16:24:11 UTC (rev 213)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELLoanApprovalTestCase.java 2009-10-29
17:03:15 UTC (rev 214)
@@ -63,5 +63,12 @@
assertMessageFromFile(result, "loanresp3.xml");
}
+
+ public void testSendLoanRequest4() throws Exception {
+ String result=sendSOAPMessage("loanreq4.xml",
+ "http://localhost:8080/bpel/processes/loanService");
+
+ assertMessageFromFile(result, "loanresp4.xml");
+ }
*/
}
Modified:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/bpel/loan_approval.bpel
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/bpel/loan_approval.bpel 2009-10-29
16:24:11 UTC (rev 213)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/bpel/loan_approval.bpel 2009-10-29
17:03:15 UTC (rev 214)
@@ -54,8 +54,12 @@
<variable name="approval"
- messageType="lns:approvalMessage" />
+ messageType="lns:approvalMessage" />
+ <variable name="faultResponse"
+
+ messageType="lns:errorMessage" />
+
</variables>
@@ -88,8 +92,10 @@
<link name="receive-to-assess" />
- <link name="receive-to-approval" />
+ <link name="receive-to-approval" />
+ <link name="receive-to-fault" />
+
<link name="approval-to-reply" />
<link name="assess-to-setMessage" />
@@ -114,6 +120,16 @@
<sources>
+ <source linkName="receive-to-fault">
+
+ <transitionCondition>
+
+ $request.amount = 0
+
+ </transitionCondition>
+
+ </source>
+
<source linkName="receive-to-assess">
<transitionCondition>
@@ -262,8 +278,32 @@
</targets>
- </reply>
+ </reply>
+
+ <sequence>
+ <targets>
+ <target linkName="receive-to-fault" />
+ </targets>
+
+ <assign>
+ <copy>
+ <from>
+ <literal>1</literal>
+ </from>
+ <to variable="faultResponse" part="errorCode" />
+ </copy>
+ </assign>
+
+ <reply partnerLink="customer"
+ portType="lns:loanServicePT"
+
+ operation="request" variable="faultResponse"
+
+ faultName="lns:unableToHandleRequest" />
+
+ </sequence>
+
</flow>
</process>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq4.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq4.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanreq4.xml 2009-10-29
17:03:15 UTC (rev 214)
@@ -0,0 +1,10 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://example.com/loan-approval/wsdl/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:request>
+ <firstName>Jane</firstName>
+ <name>Bloggs</name>
+ <amount>0</amount>
+ </wsdl:request>
+ </soapenv:Body>
+</soapenv:Envelope>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp4.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp4.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp4.xml 2009-10-29
17:03:15 UTC (rev 214)
@@ -0,0 +1 @@
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
\ No newline at end of file
Modified: trunk/samples/quickstart/loan_approval/bpel/loan_approval.bpel
===================================================================
--- trunk/samples/quickstart/loan_approval/bpel/loan_approval.bpel 2009-10-29 16:24:11 UTC
(rev 213)
+++ trunk/samples/quickstart/loan_approval/bpel/loan_approval.bpel 2009-10-29 17:03:15 UTC
(rev 214)
@@ -54,8 +54,12 @@
<variable name="approval"
- messageType="lns:approvalMessage" />
+ messageType="lns:approvalMessage" />
+ <variable name="faultResponse"
+
+ messageType="lns:errorMessage" />
+
</variables>
@@ -88,8 +92,10 @@
<link name="receive-to-assess" />
- <link name="receive-to-approval" />
+ <link name="receive-to-approval" />
+ <link name="receive-to-fault" />
+
<link name="approval-to-reply" />
<link name="assess-to-setMessage" />
@@ -114,6 +120,16 @@
<sources>
+ <source linkName="receive-to-fault">
+
+ <transitionCondition>
+
+ $request.amount = 0
+
+ </transitionCondition>
+
+ </source>
+
<source linkName="receive-to-assess">
<transitionCondition>
@@ -262,8 +278,32 @@
</targets>
- </reply>
+ </reply>
+
+ <sequence>
+ <targets>
+ <target linkName="receive-to-fault" />
+ </targets>
+
+ <assign>
+ <copy>
+ <from>
+ <literal>1</literal>
+ </from>
+ <to variable="faultResponse" part="errorCode" />
+ </copy>
+ </assign>
+
+ <reply partnerLink="customer"
+ portType="lns:loanServicePT"
+
+ operation="request" variable="faultResponse"
+
+ faultName="lns:unableToHandleRequest" />
+
+ </sequence>
+
</flow>
</process>
Modified: trunk/samples/quickstart/loan_approval/build.xml
===================================================================
--- trunk/samples/quickstart/loan_approval/build.xml 2009-10-29 16:24:11 UTC (rev 213)
+++ trunk/samples/quickstart/loan_approval/build.xml 2009-10-29 17:03:15 UTC (rev 214)
@@ -114,4 +114,18 @@
</java>
</target>
+ <target name="sendloanreq4">
+ <echo>Send test message to: ${ant.project.name}</echo>
+ <java
classname="org.apache.ode.tools.sendsoap.cline.HttpSoapSender">
+ <arg
value="http://localhost:8080/bpel/processes/loanService"/>
+ <arg value="messages/loanreq4.xml"/>
+ <classpath>
+ <fileset dir="../../common/lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+ </target>
+
</project>
Added: trunk/samples/quickstart/loan_approval/messages/loanreq4.xml
===================================================================
--- trunk/samples/quickstart/loan_approval/messages/loanreq4.xml
(rev 0)
+++ trunk/samples/quickstart/loan_approval/messages/loanreq4.xml 2009-10-29 17:03:15 UTC
(rev 214)
@@ -0,0 +1,10 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://example.com/loan-approval/wsdl/">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:request>
+ <firstName>Jane</firstName>
+ <name>Bloggs</name>
+ <amount>0</amount>
+ </wsdl:request>
+ </soapenv:Body>
+</soapenv:Envelope>
Modified: trunk/samples/quickstart/loan_approval/readme.txt
===================================================================
--- trunk/samples/quickstart/loan_approval/readme.txt 2009-10-29 16:24:11 UTC (rev 213)
+++ trunk/samples/quickstart/loan_approval/readme.txt 2009-10-29 17:03:15 UTC (rev 214)
@@ -25,7 +25,10 @@
to send an example loan request message with amount less than 10000
directly to the deployed process. Or use the command 'ant sendloanreq2' to
send a loan request with amount greater or equal to 10000. Or use command
-'ant sendloanreq3' to send an amount greater than 20000.
+'ant sendloanreq3' to send an amount greater than 20000, which will result
+in a fault from the approver service. To generate a fault from the BPEL
+process directly, use 'ant sendloanreq4', to send a request with an amount
+of zero.
NOTE: The "ant deploy" command will by default deploy version 1 of the
example to the server. If you wish to change the example, and redeploy,