Screenshot of the FileReader Information Model in SMARTUNIFIER¶
Structure of the Information Model for the File Reader Channel
Event:
The event defined in the Information Model for the File Reader acts as a trigger within the Mapping. Whenever SMARTUNIFIER detects a new XML file in the designated ‘input’ folder, the corresponding rule will be executed.
Variables:
Variables specified in the Event correspond to the values defined in the XML file (order not relevant).
The group function allows you to combine logical entities into paths. You can use existing naming conventions and styles for naming equipment to organize the configuration components. This simplifies the structuring and management of configurations.
Hint
We recommend using a consistent “Group” name throughout the demo. For instance, to identify the artifacts created for this scenario, the group name “demo.xml-rest” is used.
A second Information Model is needed for the REST-Server.
Create an Information Model that represents the structure of the data on the REST server.
Screenshot of the REST server Information Model in SMARTUNIFIER¶
Structure of the Information Model for the REST server:
Variables
The variable Data which is defined as a custom data type represents a data object on the Rest server. By invoking Data, we can conveniently access all associated variables at once, rather than retrieving each individually.
The individual variables nested within Data specifically represent the actual values.
To create the Mapping we need to proceed with the steps outlined below:
1. Create the Mapping:
Enter the group name: demo.xml-rest
Enter a name: e.g. XmlDataToRest
Add the Information Models form earlier:
demo.xml-rest.FileReader
demo.xml-rest.RestServer
Hint
You can enter for each Information Model a short name which is used within the Rule to access all elements of the specific Information Model e.g. xml and rest.
2. Create a Single Rule that defines the Mapping between the File Reader and the Rest Server Information Model.
a. Enter a Rule Name.
b. Drag and drop the XmlData Event from the File Reader Information Model into the trigger field.
c. Drag and drop the Data variable from the Rest Server Information Model into the actions panel. Make sure to choose the Complex assignment type.
d. Assign the appropriate source element to each target element either via drag-and-drop or, in the case of type conversion, by entering code.
Deployments are described in the chapter Deployment.
To deploy our Communication Instance we need to proceed with the steps outlined below:
1. Select the Local Deployment
2. Select the Instance, the Endpoint default:Default and Info for the level of detail of the log (We can leave the other configuration at their default value for this demo).
3. Save the Deployment.
4. Now Deploy and Start the Instance.
Screenshot of a deployed Instance in SMARTUNIFIER¶