Save time series strategies: update time series node config in rule chain JSONs; add null-check for persistence settings
This commit is contained in:
parent
6ca45f1962
commit
345e423973
@ -34,7 +34,11 @@
|
|||||||
"type": "org.thingsboard.rule.engine.telemetry.TbMsgTimeseriesNode",
|
"type": "org.thingsboard.rule.engine.telemetry.TbMsgTimeseriesNode",
|
||||||
"name": "Save Timeseries",
|
"name": "Save Timeseries",
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"defaultTTL": 0
|
"defaultTTL": 0,
|
||||||
|
"useServerTs": false,
|
||||||
|
"persistenceSettings": {
|
||||||
|
"type": "ON_EVERY_MESSAGE"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"externalId": null
|
"externalId": null
|
||||||
},
|
},
|
||||||
|
|||||||
@ -20,7 +20,11 @@
|
|||||||
"type": "org.thingsboard.rule.engine.telemetry.TbMsgTimeseriesNode",
|
"type": "org.thingsboard.rule.engine.telemetry.TbMsgTimeseriesNode",
|
||||||
"name": "Save Timeseries",
|
"name": "Save Timeseries",
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"defaultTTL": 0
|
"defaultTTL": 0,
|
||||||
|
"useServerTs": false,
|
||||||
|
"persistenceSettings": {
|
||||||
|
"type": "ON_EVERY_MESSAGE"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -19,7 +19,11 @@
|
|||||||
"type": "org.thingsboard.rule.engine.telemetry.TbMsgTimeseriesNode",
|
"type": "org.thingsboard.rule.engine.telemetry.TbMsgTimeseriesNode",
|
||||||
"name": "Save Timeseries",
|
"name": "Save Timeseries",
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"defaultTTL": 0
|
"defaultTTL": 0,
|
||||||
|
"useServerTs": false,
|
||||||
|
"persistenceSettings": {
|
||||||
|
"type": "ON_EVERY_MESSAGE"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -23,7 +23,11 @@
|
|||||||
"singletonMode": false,
|
"singletonMode": false,
|
||||||
"configurationVersion": 0,
|
"configurationVersion": 0,
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"defaultTTL": 0
|
"defaultTTL": 0,
|
||||||
|
"useServerTs": false,
|
||||||
|
"persistenceSettings": {
|
||||||
|
"type": "ON_EVERY_MESSAGE"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"externalId": null
|
"externalId": null
|
||||||
},
|
},
|
||||||
@ -275,7 +279,11 @@
|
|||||||
"singletonMode": false,
|
"singletonMode": false,
|
||||||
"configurationVersion": 0,
|
"configurationVersion": 0,
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"defaultTTL": 0
|
"defaultTTL": 0,
|
||||||
|
"useServerTs": false,
|
||||||
|
"persistenceSettings": {
|
||||||
|
"type": "ON_EVERY_MESSAGE"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"externalId": null
|
"externalId": null
|
||||||
},
|
},
|
||||||
@ -310,8 +318,10 @@
|
|||||||
"configurationVersion": 0,
|
"configurationVersion": 0,
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"defaultTTL": 180,
|
"defaultTTL": 180,
|
||||||
"skipLatestPersistence": null,
|
"useServerTs": false,
|
||||||
"useServerTs": null
|
"persistenceSettings": {
|
||||||
|
"type": "ON_EVERY_MESSAGE"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"externalId": null
|
"externalId": null
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,6 +83,9 @@ public class TbMsgTimeseriesNode implements TbNode {
|
|||||||
ctx.addTenantProfileListener(this::onTenantProfileUpdate);
|
ctx.addTenantProfileListener(this::onTenantProfileUpdate);
|
||||||
onTenantProfileUpdate(ctx.getTenantProfile());
|
onTenantProfileUpdate(ctx.getTenantProfile());
|
||||||
persistenceSettings = config.getPersistenceSettings();
|
persistenceSettings = config.getPersistenceSettings();
|
||||||
|
if (persistenceSettings == null) {
|
||||||
|
throw new TbNodeException("Persistence settings cannot be null!", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTenantProfileUpdate(TenantProfile tenantProfile) {
|
void onTenantProfileUpdate(TenantProfile tenantProfile) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user