YAML configuration syntax

This is the general form of a Companion for integration YAML configuration file :

- RootXpath1:
    destName1[id1]:
        - xPathMapping1 : id1
        - xPathMapping2 : column2
        - xPathMapping3 : column3

- RootXpath2:
      destName2[id2]:
        - xPathMapping4 : id2
        - xPathMapping5 : column5
        - xPathMapping6 : column6

Each top level entry is a XPath to the elements in the STEP XML that should be sent to the destination. For each matching element in the XML, one message will be sent to the destination

The following line is the destination name followed by the list of ID columns between brackets, separated by commas. According to the output type, the destination name can represent a table, a collection, a topic, a file, ...

Then, indicate the list of mappings to populate the output message. Each line consists of a XPath to be applied on the root element and the target name, separated by a colon. According to the output type, the target name can represent a column in a table, a key in a JSON document, ... Companion for integration provides a variety of custom functions to efficiently expose STEP data using JSON.

The following sections give few examples of YAML configuration for the different kind of STEP data.

Products

- Product[@UserTypeID=...]:
    products[id]: # table name[primary key]
        - ./@ID: id
        - Name/text(): name
        - Values/Value[@AttributeID="..."]/text(): attribute
        - AssetCrossReference[@Type="..."][1]/@AssetID: primaryimage

Classifications

- Classification[@UserTypeID=...]:
    classifications[id]: # table name[primary key]
        - ./@ID: id
        - Name/text(): name
        - MetaData/Value[@AttributeID="..."]/text(): attribute

Assets

- Asset[@UserTypeID=...]:
    assets[id]: # table name[primary key]
        - ./@ID: id
        - Name/text(): name
        - Values/Value[@AttributeID="..."]/text(): attribute

Entities

- Entity[@UserTypeID=...]:
    entities[id]: # table name[primary key]
        - ./@ID: id
        - Name/text(): name
        - Values/Value[@AttributeID="..."]/text(): attribute

Attributes

- Attribute:
    attributes[id]: # table name[primary key]
        - ./@ID: id
        - Name/text(): name
        - Validation/:
            - ./@BaseType: validation.type
            - ./@MinValue: validation.min
            - ./@MaxValue: validation.max
            - ./@MaxLength: validation.length
            - ./@InputMask: validation.mask
        - ListOfValueLink/@ListOfValueID: listofvalue
        - DimensionLink[1]/@DimensionID: dim1
        - DimensionLink[2]/@DimensionID: dim2

List Of Values

- ListOfValue:
    listsofvalues[id]: # table name[primary key]
        - ./@ID: id
        - Name/text(): name
        - Validation/:
              - ./@BaseType: validation.type
              - ./@MinValue: validation.min
              - ./@MaxValue: validation.max
              - ./@MaxLength: validation.length
              - ./@InputMask: validation.mask
        - DimensionLink[1]/@DimensionID: dim1
        - DimensionLink[2]/@DimensionID: dim2

Deletion messages

For some connectors there is no way to handle suppressions (ie: ActiveMQ), then it is possible to generate deletion messages by adding the following lines to the yaml file:

- DeletedProducts:
    deletedProduct[id]:    
        - ./@ID: id
- DeletedClassifications:
    deletedProduct[id]:    
        - ./@ID: id
- DeletedAssets:
    deletedAsset[id]:    
        - ./@ID: id
- DeletedEntities:
    deletedEntity[id]:    
        - ./@ID: id

You also need to add the following lines in the OIEP in case you use Advanced StepXML format:

<DeleteProducts></DeleteProducts>
<DeleteAssets></DeleteAssets>
<DeleteClassifications></DeleteClassifications>
<DeleteEntities></DeleteEntities>

Ignored output

If a destination name starts with a dot, then Companion for integration will handle the entry but no message will be sent to the destination.

It can be useful to store intermediary data using the store custom function, or to temporarily disable a destination.

Last Updated: