Expertsystemen

 

External data

External data as interfaced in the Studio are data from other sources, not being databases. In this article, we expand upon the connections you can make with SOAP and local XML files. BBIS server and Fixed interfaces – both of which are also regarded as ‘external data’ – are beyond the scope of this article.

XML Files

If you want to connect to an XML file, first define the location of the XML file under data sources. Then connect to the XML file using Actions > External data. This opens the following window:

External data dialog
External data dialog

In the box called ‘Name’, type in an appropriate name for your connected data.

Select the XML connection you just defined from the drop-down list called ‘Connection type’.

Now click on the value you want from the XML file, and a green arrow will appear, to show that a connection is made.

In the optional ‘XPath’ field, you may type an XPath to make sure to get just a single value from the connection.

Press [OK] to save the connection details.

Connecting multiple data at once

The above description was OK for just the simplest of cases, but most XML files contain more than just a single value. In order to select multiple, repetitive data, make sure you already have multiple graphs in your model, since graphs lay down the structure for complex data types – see Datasets for a recap or primer on that topic. If you are set with regards to your graph structure, you can tick the checkbox called ‘Complex data type’. The Window will change as in the screenshot below.

External data dialog with 'Complex data type' checked
External data dialog with ‘Complex data type’ checked

Now your can select the (graph) structure for your connection inside the model from the ‘Datatype’ drop-down list.

The left panel shows the structure of the entire XML file; the middle panel houses the structure of your data type (graph); and the right panel contains a filtered view of the XML file, based on the selection in the leftmost panel and/or the XPath field.

You can see the sub item ‘contacten’ (contacts) is repeated in the XML file. If you select the item called ‘contacten’, the Studio will fill in the appropriate XPath — /berkeleybridge/contacten in this case. The available data in the rightmost panel will narrow down to just the contents of the ‘contacten’ item selected. And, most importantly, the output dataset will contain separate iterations (rows) for each match of the /berkeleybridge/contacten XPath.

Now drag a dataset-value from the middle to a value on the right, or vice versa. The lightning bolts will indicate that a connection is made. If you select a connected item, it will highlight the connection in the other panel. Delete a connection by selecting a connected item the middle panel and either hitting your [DEL] key, or right-clicking and then selecting [Delete].

An XML connection is born
An XML connection is born

SOAP

If you want to connect to a SOAP server, you need a SOAP definition file. Those definition files are quite complex, so please contact xxllnc Expertsystemen if you need a SOAP definition file.

In the box called ‘Name’, type in an appropriate name for your connected data. Select the right datatype you want to use (these are all the graph definitions in your model).

A SOAP connection can only be made after selecting ‘Complex data type’. Select a SOAP definition from the drop-down list called ‘Connection type’. The available data are shown. Drag a connection from one panel to the other. Iterative values will be automatically handled.

If you have repeated items in the SOAP file, like children’s names of a parent, you can define datasets in your datasets. Again, repeated items will be handled automatically.

Defining a SOAP connection
Defining a SOAP connection

Press [OK], and you will have all the information you need in the dataset.