Home

 

Applying the pattern

To apply the pattern, we create an XML input file for the JET transformation:

Let us start by creating a sample.xml that creates the same test client we used as exemplar. Open the sample.xml file that is contained in the RAD75PatternsTransform project. Modify it to match what is in...

Example 9-3 Sample.xml to run the transformation

<root>
	<client name="RAD75Patterns2" package="itso.rad75.bank.client"
			reference="/RAD75Patterns">
		<customer id="1" ssn="xxx-xx-xxxx" title="Mr" firstName="Ahmed"
													lastName="Moharram">
			<account id="11" amount="10000.00D">
				<transaction type="Credit" amount="2500.00D"></transaction>
			</account>
			<account id="12" amount="11234.23D">
				<transaction type="Debit" amount="1234.23D"></transaction>
				<transaction type="Credit" amount="5000.00D"></transaction>
			</account>
		</customer>
	</client>
</root>

Note: A version of sample.xml is available in the RAD75PatternsClient project in the assets directory.

Right-click sample.xml and select Run As Æ Input for Jet Transformation.

Explore the newly created RAD75Patterns2Client project:

A package itso.rad75.bank.client is created.
The client program BankClient.java is created.
The classpath has been set so that there are no errors.

Figure 9-22 Client generated by transformation

ibm.com/redbooks