Integration Rule Example
Because of the multitude of scenarios that can be created using Integration Rules, there is no specific set of instructions for defining one. Therefore, we thought it might be useful to provide you a basic scenario that you can use as a basis for understanding the steps you need to take. This \topic covers the scenario, background, needed objects, and basic steps (procedure) for and OLE to SOA integration.
Scenario
We want to read some laboratory data from a relational database (SQL Server) and transfer the data to another system with a SOA enabled interface.
Background
From technical point of view, we want to read the density data (AnalysisID, Time and Value) from the source system and then post them into a legacy system by calling a specific SOA method.
Objects needed
- 1 OLEDB Connector for connecting SQL Server (Source System)
- 1 SOA Invoker Connector for connecting SOA-enabled system (Destination System)
- 1 OLEDB Dataset with the query to read data from the source system
- 1 SOA-Invoker Dataset with the configuration of the call for the destination system
The following table provides a typical output of the OLEDB Dataset.
Integration Rule OLEDB Dataset sample data
| Analysis ID (string) | Analysis Time (DateTime) | Analysis Value (Double) |
|---|---|---|
| TK_S055_DENS15C | 2011-12-18 13:40:00 | 766.1 |
| TK_S056_DENS15C | 2011-12-18 12:20:00 | 767.4 |
| TK_S603_DENS15C | 2011-12-18 15:00:00 | 814.2 |
| TK_S601_DENS15C | 2011-12-18 13:00:00 | 815.6 |
The following table provides a typical call of the SOA Invoker Dataset.
FUNCTION_NAME: LIMS_V4_POST_ANALYSIS
| Parameter Name | Type | Nullable |
|---|---|---|
| LIMS_V4_ID | String | FALSE |
| LIMS_V4_TIME | DateTime | FALSE |
| LIMS_V4_VALUE | Double | FALSE |
| \<Return Value> | Bool (true = OK / false = error) | FALSE |
Procedure
The following are the operative steps for our scenario.
From the Configured Data Server list, double-click on the VIRTUAL channel object to expand the list of Integration Rule Groups.
Right-click on the Integration Rule Group to which you want to add an Integration Rule, and select Add.
In the toolbar, click on the
Tree icon to show the list of existing datasets
This action expands the tree so that you can select items to be included in the Integration Rule.
From the newly displayed tree drag:
- OLEDB Dataset for reading data from the source SQL Server system
- SOA-Invoker Dataset for writing data to the legacy system
- Connect the two Datasets inserted in the previous step.
Drag any valid column (one of the 3 displayed by Integration Framework) from the OLEDB dataset box and drop it on the center of the SOA-Invoker box. This action connects the Datasets using a colored arrow.
Once connected the integration automatically retrieves the OLEDB Data for reading the data from the source SQL Server system and the SOA-Invoker Dataset for writing the data to the legacy system.
Click the
Save icon to save the Integration Rule.
Click the
Exit icon to close the Integration Rule.
IMPORTANT: You cannot run the Integration Rules on-the-fly during its creation phase, as some objects are stored locally in memory and are created on-the-fly to allow the definition of the Integration Rule. Instead, to run the Integration Rules, reload and then run it.
You can manually test the integration rule by re-opening and re-running it.
A specific preview window is loaded containing the preview of the Integration Rules actions performed by Integration Framework.
When running this Integration Rule, the Integration Framework will perform the following actions:
Test the connection with the source system by reading the Connector associated to the OLEDB Dataset. If the connection test fails, then it tries to reconnect again. In Case of connection problem then exits otherwise it continues with next step
IF runs the query specified in the OLEDB Dataset and retrieves the results from the system
For each record/row retrieved in step 2, the IF runs the SOA-Invoker Dataset. In our example, IF runs 4 times the SOAP method “LIMS_V4_POST_ANALYSIS” as follow:
Sequence of the calls
LIMS_V4_POST_ANALYSIS (TK_S055_DENS15C, 2011-12-18 13:40:00, 766.1)
LIMS_V4_POST_ANALYSIS (TK_S056_DENS15C, 2011-12-18 12:20:00, 767.4)
LIMS_V4_POST_ANALYSIS (TK_S603_DENS15C, 2011-12-18 15:00:00, 814.2)
LIMS_V4_POST_ANALYSIS (TK_S601_DENS15C, 2011-12-18 13:00:00, 815.6)
The association parameters between the SOAP-function parameters and the input data is defined at SOA-Invoker Dataset level (field Placeholder Name).
In our example the Placeholder name reflects the column name, so for each row the association is done by configuring the column name to be associated from the source to the destination system. The following table displays that association:
Integration Rule OLEDB-SOA Dataset association
OLEDB Dataset Column SOA Function Parameter SOA Placeholder Name Analysis_ID LIMS_V4_ID Analysis_ID Analysis_Time LIMS_V4_TIME Analysis_Time Analysis_Value LIMS_V4_VALUE Analysis_Value The resulting output of the SOA-Invoker will be a table with the return values of each call, as shown below:
Return_Value
TRUE
TRUE
TRUE
TRUE
Note: Integration Rules can be automatically started by assigning them a trigger. In order to assign an automatic trigger refer to Triggers under Integration Framework Objects.