Transformers

Update transformer

Updates an existing custom transformer with new configuration

put/api/transformers/{transformerId}

Path parameters

transformerIdstring required

Request body

type'custom' required

The type of the transformer (always 'custom' for this interface).

inputTypestring required

The input data type that the transformer accepts.

outputTypestring required

The output data type that the transformer produces.

namestring required

The name of the custom transformer.

descriptionstring required

A description of what the custom transformer does.

customCodestring required

The custom JavaScript code that implements the transformation logic.

languagestring required

Example request

{
  "inputType": "string",
  "outputType": "number",
  "name": "String to Number",
  "description": "Converts string input to numeric output",
  "customCode": "function transform(input) { return parseFloat(input); }",
  "customManifest": {
    "key": "serverUrl",
    "translationKey": "connection.serverUrl",
    "validators": [
      {
        "arguments": []
      }
    ],
    "attributes": [
      {
        "key": "serverUrl",
        "translationKey": "connection.serverUrl",
        "validators": [
          {
            "arguments": []
          }
        ],
        "displayProperties": {
          "row": 1,
          "columns": 6,
          "displayInViewMode": true
        },
        "defaultValue": "oibus-client"
      }
    ],
    "enablingConditions": [
      {
        "targetPathFromRoot": "protocol",
        "referralPathFromRoot": "connection.type",
        "values": [
          "MQTT"
        ],
        "operator": "EQUALS"
      }
    ],
    "displayProperties": {
      "visible": true,
      "wrapInBox": true
    }
  }
}

Response

Transformer updated successfully

Changes