index.ts
2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { ActionCategoryComponentEnum } from '../../../enum/category';
import { useCreateNodeKey } from '../../../hook/useCreateNodeKey';
import type { NodeItemConfigType } from '../../../types/node';
import { RuleNodeTypeEnum } from '../../index.type';
const keys = useCreateNodeKey(ActionCategoryComponentEnum.SAVE_TIMESERIES);
export interface SaveTimeseriesDataType {
someConfiguration?: Recordable;
}
export const SaveTimeseriesConfig: NodeItemConfigType = {
...keys,
clazz: 'org.thingsboard.rule.engine.telemetry.TbMsgTimeseriesNode',
categoryType: RuleNodeTypeEnum.ACTION,
name: 'save timeseries',
configurationDescriptor: {
nodeDefinition: {
details:
"Saves timeseries telemetry data based on configurable TTL parameter. Expects messages with 'POST_TELEMETRY_REQUEST' message type. Timestamp in milliseconds will be taken from metadata.ts, otherwise 'now' message timestamp will be applied. Allows stopping updating values for incoming keys in the latest ts_kv table if 'skipLatestPersistence' is set to true.\n <br/>Enable 'useServerTs' param to use the timestamp of the message processing instead of the timestamp from the message. Useful for all sorts of sequential processing if you merge messages from multiple sources (devices, assets, etc).\n<br/>In the case of sequential processing, the platform guarantees that the messages are processed in the order of their submission to the queue. However, the timestamp of the messages originated by multiple devices/servers may be unsynchronized long before they are pushed to the queue. The DB layer has certain optimizations to ignore the updates of the \"attributes\" and \"latest values\" tables if the new record has a timestamp that is older than the previous record. So, to make sure that all the messages will be processed correctly, one should enable this parameter for sequential message processing scenarios.",
description: 'Saves timeseries data',
inEnabled: true,
outEnabled: true,
relationTypes: ['Success', 'Failure'],
customRelations: false,
ruleChainNode: false,
defaultConfiguration: {
defaultTTL: 0,
skipLatestPersistence: false,
useServerTs: false,
},
uiResources: ['static/rulenode/rulenode-core-config.js'],
configDirective: 'tbActionNodeTimeseriesConfig',
icon: 'material-symbols:file-upload',
iconUrl: '',
docUrl: '',
},
},
};