%@page import="com.oracle.bpel.client.Locator"%>
<%@page import="com.oracle.bpel.client.NormalizedMessage"%>
<%@page import="com.oracle.bpel.client.dispatch.IDeliveryService"%>
Invoke MyLoanFLow
<%
String ssn = request.getParameter("SSN");
if (ssn == null)
{
%>
Invoke MyLoanFlow BPEL Application
Loan Application Form
<%
}
else
{
// 1. Get form fields
String email = request.getParameter("email");
String name = request.getParameter("name");
String amount = request.getParameter("amount");
String model = request.getParameter("model");
String year = request.getParameter("year");
// 2. Create loan application XML document
String xml = ""
+ "" + ssn + ""
+ "" + email + ""
+ "" + name + ""
+ "" + amount + " "
+ "" + model + " "
+ "" + year + " "
+ " "
+ "";
// 3. Initiate the BPEL process here
// Connect to Oracle BPEL server
Locator locator = new Locator("default","bpel");
IDeliveryService deliveryService = (IDeliveryService)
locator.lookupService(IDeliveryService.SERVICE_NAME );
// Construct a normalized message and send to Oracle BPEL Process Manager
NormalizedMessage nm = new NormalizedMessage();
nm.addPart("payload", xml);
// Initiate the BPEL process
deliveryService.post("MyLoanFlow", "initiate", nm);
%>
BPEL Process MyLoanFlow
initiated
with a loan application containing SSN=<%= ssn %>
Please refer to the
BPEL Console
to see the status of the initiated MyLoanFlow BPEL Process.
<%
}
%>