Following Part 2 of implementation earlier, let us proceed to the final step.
Part 3: Database Adapter for Order Management
Create ORDERS and ITEMS tables in the database of your choice. Description of these tables shown below. SQL script can be downloaded from here.
Drag and drop a Database Adapter from Component Palette on to Services section of composite.xml. Enter OrderManagementDBAdapter for “Service Name”.
Select Database properties in the next screen. This presume you’ve successfully created Database connection pointing to the database containing ORDERS and ITEMS tables. If not, please click on the pencil icon next to “+” icon and create a new database connection.
Select “Insert of Update” operation from next screen.
Auto Query and select ORDERS table from the Available tables. Click on “>” arrow to move ORDERS table to “Selected” section. Select all attributes from next screen.
Enter ORDER_SEQ in Sequence field and hit on Search. This will populate ORDER_SEQ sequence we created earlier. Click on Finish.
We are now back to original composite.xml screen.
Right click on OrderABCS and connect it with OrderManagementDBAdapter. We need to convert OrderABCS’s canonical data into the format understood by Order Management system.
Double click on OrderABCS and go to “Static Routing” section.
Create new transformation mapping by clicking on icon next to “Transform Using” field. Select “Create New Mapper File” from next screen and accept default file name.
Create a mapping as shown below:
Finally, deploy it to Application Server and ensure that its listed in EM console.
To run this example, place Order.txt file in “D:\FUSIONTRAINING\SOA\SOATrainingSamples\MediatorExample\ftp\input” (or the directory you’ve specified for file polling). After 30 seconds, Order.txt will automatically be picked up, transformed and written to ORDERS table. Ensure ORDERS table contains data obtained from Order.txt file.