The advantage of using XML facade is to provide the ability to access the XML content via Java classes and methods. This recipe explains how to access the complex types through XML facade.
To complete the recipe, we will amend the example BPEL process from the Invoking XML facade from BPEL processes recipe.
The steps involved in accessing the complex types through XML façade are as follows:
Banking_BPEL
process and double-click on the XML_facade_node
Java Embedding activity.java.util.List<org.packt.cashflow.facade.PrincipalExchange> princEx= cf.getPrincipalExchange();
In the previous example, we receive a list of cash flows. The corresponding XML content definition states:
<xsd:complexType name="PrincipalExchange"> <xsd:sequence> </xsd:sequence> <xsd:attribute name="id" type="xsd:int"/> </xsd:complexType>
We can conclude that each of the principle exchange cash flows is modeled as an individual Java class.
Depending on the hierarchy level of the complex type, it is modeled either as a Java class or as a Java class member. Complex types are organized in the Java object hierarchy according to the XML schema definition. Mostly, complex types can be modeled as a Java class and at the same time as a member of an other Java class.