summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/trunk/demos/mortgage-loanapproval/README
blob: 0fc2284d1c8e6d46810069f34abb098a874a3f0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Mortgage Loan Approval Demo
===========================

This demo was used as an example in the Java Developer Journal article:  http://jdj.sys-con.com/read/325183.htm.

The demo consists of two modules:

mortgage-loanapproval: provides the business logic for loan approval.  
mortgage-creditcheck: handles credit check requests. This is a java component exposed as a webservice running on the embedded Tomcat.

Please check the mortgage_assembly.png file that is located in this directory for a high level view of the demo.

When you run the mortgage-loanapproval application, a loan approval request for a customer with id 111-222-3333 
is initiated. This invokes the mortgage-creditcheck application to determine the credit status of the customer.
Depending on what the credit status of this person is, the loan is approved or diapproved. 

You need two command windows to run this demo. The order in which the applications are run is important.
Run mortgage-creditcheck first since mortgage-loanapproval is dependent on it.

In the first command window 
---------------------------
cd mortgage-creditcheck 
ant run

You should see the following displayed:
Buildfile: build.xml

run:
     [java] Starting the CreditCheck Service...
     [java] 14-Jan-2008 14:14:20 org.apache.tuscany.sca.http.jetty.JettyServer a
ddServletMapping
     [java] INFO: Added Servlet mapping: http://L3AW203:8085/CreditCheckServiceC
omponent
     [java] Press Enter to Exit...

In the second command window
----------------------------
cd mortgage-loanapproval
ant run

If the loan is approved, you will see the following displayed in the command screen where
mortgage-loanapproval is run:

Buildfile: build.xml
run:
     [java] Interest rate for a 30-year loan of $200000.0 in CA: 6.5%
     [java] Approved: John Smith[111-22-3333]

If the loan is disapproved, you will see the following displayed in the command screen where
mortgage-loanapproval is run:

Buildfile: build.xml
run:
     [java] Credit score for 111-22-3333: 708
     [java] Interest rate for a 30-year loan of $200000.0 in CA: 6.5%
     [java] Debt/Income ratio 0.2528272093971861 is too high.
     [java] Rejected: John Smith[111-22-3333]


Building the Demo Using Ant
---------------------------
With the binary distribution the demo can be built using Ant as follows:

cd mortgage-creditcheck
ant compile

cd mortgage-loanapproval
ant compile


Building the Demo Using Maven 
-----------------------------
With either the binary or source distribution the demo can be built using
Maven as follows:

cd mortgage-creditcheck
mvn

cd mortgage-loanapproval
mvn