Zum Hauptinhalt springen

CreateUpdateInfo@1

Der Node CreateUpdateInfo@1 wird verwendet, um ein Update-Info-Objekt im Payload zu erstellen. Update-Info-Objekte werden verwendet, um Änderungen an den Daten für das Asset Repository und das Time Series Repository von OctoMesh nachzuverfolgen.

Adapter-Voraussetzungen​

Node-Konfiguration​

Für die Felder path, targetPath, targetValueWriteMode und targetValueKind siehe Überblick.

transformations:
- type: CreateUpdateInfo@1
targetPath: _updateItems # Path where the update info object should be stored in the payload
targetValueKind: Array # The target value kind, should be an array to store multiple update info objects
targetValueWriteMode: Append # The target value write mode, should be 'Append' to add the update info object to the array
updateKind: UPDATE # The update kind, should be 'UPDATE' to indicate an update, other options are 'INSERT'
rtId: 5fc8fda18b2fc75f925e21af # The runtime ID of the asset that should be updated, if updateKind is 'UPDATE'
rtIdPath: $.assetId # The path to the runtime ID in the payload, any valid JSON path is allowed. This property can be defined instead of the rtId property
rtWellKnownNamePath: $.Name # the path to the runtime well known name in the payload; this property has an index in the database
ckTypeId: Industry.Energy/Photovoltaic.Module # The CK type ID of the asset that should be updated, if updateKind is UPDATE
timestampPath: $.timestamp # The path to the timestamp in the payload, any valid JSON path is allowed
attributeUpdates: # The attribute updates that should be applied to the asset, multiple updates are allowed
- attributeName: PeakPower # The name of the attribute that should be updated
attributeValueType: Double # The value type of the attribute that should be updated
valuePath: $.productionPower # The path to the value in the payload, any valid JSON path is allowed
value: "demo" # A constant value that should be used. This property can be defined instead of the valuePath property

Beispiel mit Enum​

Das Folgende zeigt ein einfaches Beispiel, wie CreateUpdateInfo@1 verwendet wird, um ein Enum zu initialisieren.

transformations:
- type: CreateUpdateInfo@1
targetPath: _updateItem
updateKind: INSERT
ckTypeId: EnergyCommunity/Customer
attributeUpdates:
- attributeName: InvoiceCycle
attributeValueType: Enum
value: Monthly # When defining the value for a Enum ensure that you are using the "name" property the "key" will not be recognised