Skip to main content Skip to footer

CONNECT Data Services Publisher

This module is used to publish data to AVEVA CONNECT Data Services. It allows mapping input data to a target stream in AVEVA CONNECT.

Settings

Name Requirements Purpose Default
Target Property String 0-64 in length The property to write the result into.  
Credential Valid credential ID The credential used to authenticate with the service.  
Namespace String 1-100 in length The namespace name to use when connecting the service.  
Stream String 1-100 in length The stream name to use when connecting to the service.  
Data Mapping List of mappings Maps input properties to output properties in the target stream. If empty, the entire input message will be written. []

The Target Property setting is used to specify the property of which the output message should be written. The Data Mapping setting is a list of mappings that define how to transform the input data into the output format. If the Data Mapping is empty, the entire input message will be written to the specified Stream. If the To property of the mapping is set to ., the from property will be written to the 'root' of the stream.

Input

The input message should contain the data to be published.

Example Input

{
  "data": {
    "Order": 42,
    "Customer": {
      "Name": "John Doe",
      "Address": {
        "Street": "123 Main St",
        "City": "Springfield"
      }
    }
  }
}

Output

The output message contains the result of the data mapping and additional metadata. If the Data Mapping is empty, the entire input message will be written to the specified Stream. In the case only a subset of the datamappings can be found on the incoming message, the output will only contain those. If no data can be mapped to the target stream, an error message will be returned and a warning will be set on the module.

If the Target Property is specified, the output will be written to outgoing message from the module. If not, it will be omitted.

Name Type Description
crosser.success Boolean true if the message was processed successfully, false otherwise.
crosser.message String Contains an error message if processing fails, otherwise this property is not set.
targetProperty Object The mapped output data, written to the property specified in Target Property.

Error Handling

If an error occurs the module will set the crosser.success property to false and include an error message in the crosser.message property.

Common Errors

Error Scenario Error Message
No Data Mapped No data could be mapped from the input according to the DataMapping setting.
Stream Not Found Stream '{StreamId}' not found.
Namespace Not Valid Namespace '{NamespaceName}' is not valid.
Credential Missing or Invalid Credential with Id {CredentialId} is not available on the node or has no value.
Credential Validation Failed Failed to connect with credential: {ErrorMessage}
Invalid Data Mapping Invalid mapping: '{ToProperty}' is not a property on the target stream type.

Examples

Example 1: Valid Data Mapping

Settings:

  • Target Property: target

  • Namespace: Customer

  • Stream: Order

  • Data Mapping:

    `` [ { "From": "Order.OrderNumber", "To": "OrderId" }, { "From": "Name", "To": "Customer.Name }, { "From": "Address.City", "To": "Customer.City" } ]

Input:

{
  "Order": {
    "OrderNumber": 42,
    "Name": "John Doe",
    "Address": {
        "Street": "123 Main St",
        "City": "Springfield"
      }
  }
}

Output:

{
  "target": {
    "OrderId": 42,
    "Customer {
      "Name": "John Doe",
      "City": "Springfield"
    }
  },
  "crosser": {
    "success": true
  }
}

Example 2: Data Mapping with .

NOTE The object in the Order property must be a valid type for the current stream. Settings:

  • Target Property: target

  • Namespace: Customer

  • Stream: Order

  • Data Mapping:

    [
      { "From": "Order", "To": "." },
    ]
    

Input:

{
  "Order": {
    "OrderNumber": 42,
    "Name": "John Doe",
    "Address": {
        "Street": "123 Main St",
        "City": "Springfield"
    }
  }
}

Output:

{
  "target": {
    "OrderNumber": 42,
    "Name": "John Doe",
    "Address": {
        "Street": "123 Main St",
        "City": "Springfield"
    }
  },
  "crosser": {
    "success": true
  }
}

Example 3: Invalid Data Mapping

Settings:

  • Target Property: target

  • Data Mapping:

    [
      { "From": "Order", "To": "InvalidProperty" }
    ]
    

Input:

{
  "data": {
    "Order": 42
  }
}

Output:

{
  "crosser": {
    "success": false,
    "message": "Invalid mapping: 'InvalidProperty' is not a property on the target stream type."
  }
}