We start generating XML facade by setting up a project in a JDeveloper environment which provides convenient tools for building XML facades. This recipe will describe how to set up a JDeveloper project in order to build XML facade.
To complete the recipe, we need the XML schema of the BPEL process variables based on which we build XML facade. Explore the XML schema of our banking BPEL process. We are interested in the structure of the BPEL request message:
<xsd:complexType name="PrincipalExchange"> <xsd:sequence> <xsd:element minOccurs="0" name="unadjustedPrincipalExchangeDate" type="xsd:date"/> <xsd:element minOccurs="0" name="adjustedPrincipalExchangeDate" type="xsd:date"/> <xsd:element minOccurs="0" name="principalExchangeAmount" type="xsd:decimal"/> <xsd:element minOccurs="0" name="discountFactor" type="xsd:decimal"/> </xsd:sequence> <xsd:attribute name="id" type="xsd:int"/> </xsd:complexType> <xsd:complexType name="CashflowsType"> <xsd:sequence> <xsd:element maxOccurs="unbounded" minOccurs="0" name="principalExchange" type="prc:PrincipalExchange"/> </xsd:sequence> </xsd:complexType> <xsd:element name="Cashflows" type="prc:CashflowsType"/>
The request message structure presents just a small fragment of cash flows modeled in the banks. The concrete definition of a cash flow is much more complex. However, our definition contains all the right elements so that we can show the advantages of using XML facade in a BPEL process.
The steps involved in setting up a JDeveloper project for XML façade are as follows:
org.packt.cashflow.facade
. Click on Finish. We now have the following project structure in JDeveloper: