index.ts 1.41 KB
import { FlowCategoryComponentEnum } from '../../../enum/category';
import { useCreateNodeKey } from '../../../hook/useCreateNodeKey';
import type { NodeItemConfigType } from '../../../types/node';
import { RuleNodeTypeEnum } from '../../index.type';

const keys = useCreateNodeKey(FlowCategoryComponentEnum.RULE_CHAIN);

export interface RuleChainDataType {
  someConfiguration?: Recordable;
}

export const RuleChainConfig: NodeItemConfigType = {
  ...keys,
  clazz: 'org.thingsboard.rule.engine.flow.TbRuleChainInputNode',
  categoryType: RuleNodeTypeEnum.FLOW,
  name: 'rule chain',
  // backgroundColor: '#d6c4f1',
  configurationDescriptor: {
    nodeDefinition: {
      details:
        'Allows to nest the rule chain similar to single rule node. The incoming message is forwarded to the input node of the specified target rule chain. The target rule chain may produce multiple labeled outputs. You may use the outputs to forward the results of processing to other rule nodes.',
      description: 'transfers the message to another rule chain',
      inEnabled: true,
      outEnabled: true,
      relationTypes: ['Failure'],
      customRelations: true,
      ruleChainNode: true,
      defaultConfiguration: {
        ruleChainId: null,
      },
      uiResources: ['static/rulenode/rulenode-core-config.js'],
      configDirective: 'tbFlowNodeRuleChainInputConfig',
      icon: '',
      iconUrl: '',
      docUrl: '',
    },
  },
};