Creating static target structures
When creating a target structure for a Lobster_data profile, in addition to the Lobster SCM templates, a specific existing data structure can also be used to create an overall target structure or to add a subnode to it. Similar to the use of Lobster SCM templates (see for details), the relevant dialog is opened from the Menu for a Target structure by executing the function Load template with the Lobster SCM template category.
The option Append structure as subnode can be set and used in conjunction with the selection of a target node via the parameter api.scm.appendToNode to extend an existing target structure.
CAUTION
If the option Append structure as subnode is not set, the generated structure replaces the complete existing target structure and unsaved settings are irrevocably lost.
Instead of selecting a predefined template under Entity, you can enter a specific data structure in Xml/JSON format in the Xml/Json to static structure parameter or paste it from the clipboard.
By clicking on
Apply, a target structure of nodes and fields is created from the entered data, to which the specified Fix value and a corresponding Data type are automatically assigned.
For the example shown above the following picture of the generated 'static target structure' results:
|
|
In practice, it will often make sense to remove all or part of the assigned Fix values and replace them with assignments from the source data.
Examples
Example: JSON structure export from a portal
In order to collect specific data for a long-distance truck transport, a portal was created in which the type of vehicle and one or more drivers and assistants are selected:
The 'Structure export' of the sample data entered here in test mode via the portal delivers the following JSON structure, from which a target structure for a Lobster_data profile is created as described above:
Structure export of the inputs in JSON format |
Target structure created from this for a lobster_data profile |
|
|
Example: Transfer XML structure from the query configurator into the search for an import profile
If a profile is used for an Import to update existing data objects in Lobster Data Platform / Orchestration, their internal ID (id) is often not contained in the input data because it is unknown in the source system. However, this unique indicator is required so that an 'update' of an existing item can be performed by import. If the input data uses other key characteristics to identify a data item, these must be 'converted' to the relevant internal ID of Lobster Data Platform / Orchestration during the import. This is made possible by the search node in the import structure, in which the relevant search criteria are formulated and can be bound to field values from the input data via 'mapping'.
The example shows the structure of a Search, created with the Search builder to identify Orders by a string of characters that should be present in Lobster Data Platform / Orchestration in a reference attribute 'Reciept No.' (RECEIPT_NO) of the respective order in the 'Reference' (reference) field.
This conjunction would be useful, for example, if the externally assigned document number is reset per calendar year and incremented during the year, and updates for documents from the previous period are excluded. Then the link between the 'Receipt no.' and the period (current calendar year) provides a unique reference for an order to be updated. |
|
With the Search builder a suitable Search can be created, not only in order to be able to test it with concrete specifications (here: in place of the value DUMMY_RECEIPT_NO). The definition of the query can also be displayed directly as an XML structure and even edited if necessary. This display in the 'XML' tab is also suitable for copying all or part of the XML structure of the search to the clipboard in order to add it to the target structure in the context of an Import profile. In the image on the right, the portion from the XML is selected defining the Where parameter shown above. This AND-link (SearchJunction) is now copied to the clipboard to transfer it to a profile to carry out updates for existing orders. |
|
The screenshot on the right shows the Target structure of an Import profile, which was exceptionally created from the Single import template (core:Import) for demonstration purposes, since this template is more compact than the otherwise superior Batch import. The search node from the template is expanded and selected on the screen. It contains the node ISearchRestriction, which is also selected and serves as a placeholder for different types of search conditions. In its place, the search condition stored in the clipboard is inserted. The node 'Order' was inserted below the search as a template for Orders (ord:Order). |
|
The selection is reduced to the node ISearchRestriction, so that when you execute the Menu function Load template with the template category Lobster SCM, it appears as api.scm.appendToNode:
►IMPORTANT◄ The option Append structure as subnode must be set.
The content of the clipboard was already inserted into the input field Xml/Json to static structure.
The button
Apply (not in the screenshot) starts the insertion of the static structure in the node ISearchRestriction.
The image on the right shows the contents of the selected placeholder node ISearchRestriction after adding the static structure for the search condition as a subnode. The 'description' of the placeholder not visible in the image suggests that the search condition should actually take its place: One of [core:PropertySearch, core:SearchJunction, core:SimplePropertySearch, core:SubSearch] In this respect, you could now cut the SearchJunction node from the ISearchRestriction, insert it again above and delete the placeholder. Alternatively, you can keep the structure as shown on the right, if you set the placeholder by the parameter XML/JSON handling 'Transparent':
|
►NOTE◄ In order for the 'search' for specific Orders to really work, the static text value MAP_TO_RECEIPT_NO in the field value#2_2_val (framed in blue in the image) must be replaced by an assignment from a suitable field of the source structure. |