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.

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/warning.svg CAUTIONimages/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/warning.svg 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.

images/download/attachments/62851371/image2020-7-16_17-35-21-version-1-modificationdate-1603704027851-api-v2.png

By clicking on images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg 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:

images/download/attachments/62851371/image2020-7-16_17-38-13-version-1-modificationdate-1603704027848-api-v2.png

  • The added node is automatically assigned a name like objekt#1, which should identify the anonymous data item type.

  • The text values true and false (without inverted commas) are read as Data type Boolean.

  • A numeric value with one decimal point is interpreted as Data type Double.

  • An integer numerical value without decimal point is interpreted as an Integer.

  • Any text between quotation marks is read as a String.

  • Nested structures are expanded into subnodes with fields or further subnodes.

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:

images/download/attachments/62851371/image2020-7-16_19-49-2-version-1-modificationdate-1603704027845-api-v2.png

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

images/download/attachments/62851371/image2020-7-16_19-50-41-version-1-modificationdate-1603704027842-api-v2.png

  • The square brackets [...] for the data fields drivers drivers and assistants indicate a plural content, i.e. a list of single values. In the Target structure (right), an entry node is therefore inserted for each single value. These nodes are usually iterated in 'mapping' to allow a variable number of repetitions depending on the input data.

  • The Combobox 'tractor truck (type)' obviously provides a complex data structure for the truck with two fields type and hp, which also appear separately in the target structure.

images/download/attachments/62851371/image2020-7-16_19-52-46-version-1-modificationdate-1603704027839-api-v2.png

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.

  • Within the Where parameter, two criteria of the Feld Einschränkung type are AND-linked. They must both be fulfilled for an order to be accepted as a match..


  • The first Feld Einschränkung requires that the 'reference' read via a Typed attribute projection is completely identical to a string MAP_TO_RECEIPT_NO, statically defined here, in whose place in the import profile a suitable source field should be assigned via 'mapping'.


  • The second Feld Einschränkung checks whether the data object created for the purchase order in Lobster Data Platform / Orchestration was created in the current year according to the timestamp in the 'Date created' (created) 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.

images/download/attachments/62851371/image2020-7-16_19-56-5-version-1-modificationdate-1603704027836-api-v2.png


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.

images/download/attachments/62851371/image2020-7-16_19-59-46-version-1-modificationdate-1603704027830-api-v2.png


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).

images/download/attachments/62851371/image2020-7-16_20-2-10-version-1-modificationdate-1603704027827-api-v2.png

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:

images/download/attachments/62851371/image2020-7-16_20-4-1-version-1-modificationdate-1603704027824-api-v2.png


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 images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg 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':

images/download/attachments/62851371/image2020-7-16_20-11-47-version-1-modificationdate-1603704027797-api-v2.png

images/download/attachments/62851371/image2020-7-16_20-9-46-version-1-modificationdate-1603704027820-api-v2.png

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.