Skip to content

Commit

Permalink
update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Dec 28, 2024
1 parent 1fefb2d commit 89cca43
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ private ProcessingContext<T> getBuildProcessingContext(ProcessingContext<T> cont
substituteValueInPayload(sourceId, payloadTarget, mapping.transformGenericPath2C8YPath(pathTarget));
context.setSourceId(sourceId.value.toString());
substitute.repairStrategy = RepairStrategy.CREATE_IF_MISSING;
} else {
substituteValueInPayload(substitute, payloadTarget, pathTarget);
}
substituteValueInPayload(substitute, payloadTarget, pathTarget);
}
/*
* step 4 prepare target payload for sending to c8y
Expand Down
Binary file modified resources/samples/SampleMappings_13.pdf
Binary file not shown.
Binary file modified resources/samples/SampleMappings_13.xlsx
Binary file not shown.
44 changes: 44 additions & 0 deletions resources/samples/mappings-INBOUND.json
Original file line number Diff line number Diff line change
Expand Up @@ -1058,5 +1058,49 @@
"qos": "AT_LEAST_ONCE",
"lastUpdate": 1735221431554,
"genericDeviceIdentifier": "_IDENTITY_.externalId"
},
{
"id": "5725916",
"identifier": "t7vj81",
"name": "Mapping - 25",
"mappingTopic": "alarm/tires_c8ySourceId",
"mappingTopicSample": "alarm/tires_c8ySourceId",
"targetAPI": "ALARM",
"direction": "INBOUND",
"sourceTemplate": "{\"msg_type\":\"c8y_FlatTireAlarm\",\"tx\":\"Left rear tire loses air!\",\"bus_c8ySourceId\":\"10203040\"}",
"targetTemplate": "{\"type\":\"c8y_FlatTireAlarm\",\"text\":\"Left rear tire loses air!\",\"severity\":\"MAJOR\",\"status\":\"ACTIVE\",\"time\":\"2022-03-19T12:03:27.845Z\"}",
"mappingType": "JSON",
"substitutions": [
{
"pathSource": "bus_c8ySourceId",
"pathTarget": "_IDENTITY_.c8ySourceId",
"repairStrategy": "DEFAULT",
"expandArray": false
},
{
"pathSource": "tx",
"pathTarget": "text",
"repairStrategy": "DEFAULT",
"expandArray": false
},
{
"pathSource": "msg_type",
"pathTarget": "type",
"repairStrategy": "DEFAULT",
"expandArray": false
}
],
"active": true,
"debug": false,
"tested": false,
"supportsMessageContext": false,
"createNonExistingDevice": false,
"updateExistingDevice": false,
"autoAckOperation": true,
"useExternalId": false,
"snoopStatus": "NONE",
"snoopedTemplates": [],
"qos": "AT_LEAST_ONCE",
"lastUpdate": 1735420127589
}
]

0 comments on commit 89cca43

Please sign in to comment.