Building your first iFlow – Part 2: Initializing the iFlow
In Building your first iFlow – Part 1:Initializing the Project the Weather Report project was created in Eclipse with an empty iFlow. Components will now be added to the iFlow to perform the processing and data manipulation.
There are three tasks to the iFlow. The first is the task to retrieve the current weather weather in XML from an external service, then extract the current weather and finally create and send an email with the weather reported by the external service.
The iFlow will need some means of initializing, so the “Timer Start” event will be added to the integration. This allows an iFlow to be run. There are other events that can be used to start an iFlow but this event allows it to be triggered when the iFlow is deployed or at a specific recurring interval.
NOTE: There is an issue with a Timer Start event and mail credentials.
The Timer Start event will need to specify a time and not be marked as “Run Once” as below
It is expected this will be fixed soon!
For the initial creation of the iFlow the “Run Once” option will be selected
For now specify a time in the future to execute the iFlow
Next we need a component that will make a request to download the weather data. This is the “Service Call” task and is used to synchronously call an external service (API) to get data and then once completed move onto the next operation in the flow. The next step in the sequence will normally be some kind of converter if the format is not XML or some kind of modifier or splitter to parse the data into messages that can be processed further on down the pipeline.
There are no options to configure in the service call since authentication is not being used. However a receiver component is required to be able to receive data into the message flow.
The receiver is the abstract message source that will be a source for messages. To configure how the messages will be received requires a channel.
Click on the Connectors pane and choose “Message Flow”. Click over the “Request-Reply” component and then the “Receiver component to join the two together. This creates a new channel, however the channel still needs to be configured.
Note the direction of the arrow attached to the receiver component. This indicates the direction the request will be made.
Ensuring the channel is selected by making sure orange check boxes are showing at the start, end and middle of the channel component, select the “Configure Channel” option when right clicking over the channel component.
It is important to remember that this is the only way to configure the channnel.
Clicking on the “Channels” tab can have unpredictable results.
This will display the the panel to configure the selected channel. Select the adapter type of HTTP by clicking on the “Browse” button. This will enable the “Adapter Specific” configuration panel with the correct options enabled and displayed. Depending on the adapter type chosen, different options will be displayed.
Here the URL of the weather service is entered that is http://api.openweathermap.org/data/2.5/weather
The additional query parameters allow the type of response, in this case it is XML and the location which is Chippenham in the UK. Of course you could just have easily used Walldorf,DE if you were working at SAP’s headquarters.
The remaining options are straightforward. This is an HTTP GET call and does not require authentication or proxying since the HCI tenant does not need to connect through a proxy.
In the next step the remainder of the iFlow will be configured….