keskiviikko 10. huhtikuuta 2013

Tutorial 1 part 36 - adding file interface


We now have a fully working solution to our original need. As an extension let's develop an alternate interface to the same service. It is very common to have multiple ways to initiate composite services. In this case we add a file based integration option.


Adding file interface
From the component palette (on right side) Drag and Drop File adapter to the left -most lane (exposed services). This will start the file adapter wizard.









Define format later (we will be using a wizard for that as well)


Read file -> we will just be reading files that are incoming.


File directories -> Where to poll for incoming data




File pattern:
Make sure the file contains multiple messages checkbox is checked (missing from the image below actually) and that the file adapter publishes messages in batches of one. This makes the file adapter send each line on the input file as individual request. If you do not check it, file adapter reads the whole file and sends the full contents as a sequence forwards. You’d had to add some logic to break the sequence into individual requests before sending it to the existing BPEL flow that takes separate requests. This is not difficult to do and you’d do that for example by adding a small additional BPEL flow that has a while or for-each construct to loop over all of them.



Polling frequency








Message format (here we use another wizard to define how to parse incoming file and what parameters we are interested in).





There is an icon that looks like looks like gear. Its tool tip reads: “Define Schema for Native Format”. Press it for starting another wizard that defines how to parse the incoming file.





Use a sample file as basis of parsing.




The contents of my test file are btw;
ObjectId;AssetId;LocationId;EventId;EventTime;EventClass;EventSeverity;EventText
geo-987;Car-45;PASILA;889;2012-04-18Z16:04:35;GeoFence;Informational;Car moved  from geo-fence geo-987
geo-987;Car-45;PASILA;890;2012-04-18Z16:11:35;GeoFence;Informational;Car moved into geo-fence geo-987
geo-987;Car-47;PASILA;889;2012-04-18Z16:11:42;GeoFence;Informational;Car moved from geo-fence geo-987











Completed






Completed the file format wizard





Completed adding a file adapter





Ei kommentteja:

Lähetä kommentti