Browse Source

renamed SingletonSupport to ClusteringMode and refactoring due to comments

pull/8414/head
YevhenBondarenko 4 years ago
parent
commit
da0bd1dc92
  1. 6
      application/src/main/data/upgrade/3.4.4/schema_update.sql
  2. 20
      application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeActorMessageProcessor.java
  3. 2
      application/src/main/java/org/thingsboard/server/service/component/AnnotationComponentDiscoveryService.java
  4. 8
      common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentClusteringMode.java
  5. 12
      common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentDescriptor.java
  6. 2
      dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java
  7. 10
      dao/src/main/java/org/thingsboard/server/dao/model/sql/ComponentDescriptorEntity.java
  8. 10
      dao/src/main/java/org/thingsboard/server/dao/service/validator/RuleChainDataValidator.java
  9. 2
      dao/src/main/java/org/thingsboard/server/dao/sql/component/AbstractComponentDescriptorInsertRepository.java
  10. 4
      dao/src/main/java/org/thingsboard/server/dao/sql/component/SqlComponentDescriptorInsertRepository.java
  11. 2
      dao/src/main/resources/sql/schema-entities.sql
  12. 4
      rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/RuleNode.java
  13. 4
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/TbMqttNode.java
  14. 4
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/azure/TbAzureIotHubNode.java
  15. 4
      ui-ngx/src/app/modules/home/pages/rulechain/rule-node-details.component.ts
  16. 4
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts
  17. 10
      ui-ngx/src/app/shared/models/component-descriptor.models.ts
  18. 6
      ui-ngx/src/app/shared/models/rule-chain.models.ts

6
application/src/main/data/upgrade/3.4.4/schema_update.sql

@ -617,9 +617,9 @@ ALTER TABLE rule_node ADD COLUMN IF NOT EXISTS singleton_mode bool DEFAULT false
UPDATE rule_node SET singleton_mode = true WHERE type IN ('org.thingsboard.rule.engine.mqtt.azure.TbAzureIotHubNode', 'org.thingsboard.rule.engine.mqtt.TbMqttNode');
ALTER TABLE component_descriptor ADD COLUMN IF NOT EXISTS singleton varchar(255) DEFAULT 'NOT_SUPPORTED';
ALTER TABLE component_descriptor ADD COLUMN IF NOT EXISTS clustering_mode varchar(255) DEFAULT 'ENABLED';
UPDATE component_descriptor SET singleton = 'SUPPORTED' WHERE name = 'mqtt';
UPDATE component_descriptor SET clustering_mode = 'USER_PREFERENCE' WHERE clazz = 'org.thingsboard.rule.engine.mqtt.TbMqttNode';
UPDATE component_descriptor SET singleton = 'ONLY_SINGLETON' WHERE name = 'azure iot hub';
UPDATE component_descriptor SET clustering_mode = 'SINGLETON' WHERE clazz = 'org.thingsboard.rule.engine.mqtt.azure.TbAzureIotHubNode';

20
application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeActorMessageProcessor.java

@ -60,7 +60,7 @@ public class RuleNodeActorMessageProcessor extends ComponentMsgProcessor<RuleNod
@Override
public void start(TbActorCtx context) throws Exception {
if (isMyNode()) {
if (isMySingletonNode()) {
tbNode = initComponent(ruleNode);
if (tbNode != null) {
state = ComponentLifecycleState.ACTIVE;
@ -70,7 +70,7 @@ public class RuleNodeActorMessageProcessor extends ComponentMsgProcessor<RuleNod
@Override
public void onUpdate(TbActorCtx context) throws Exception {
if (isMyNode()) {
if (isMySingletonNode()) {
RuleNode newRuleNode = systemContext.getRuleChainService().findRuleNodeById(tenantId, entityId);
this.info = new RuleNodeInfo(entityId, ruleChainName, newRuleNode != null ? newRuleNode.getName() : "Unknown");
boolean restartRequired = state != ComponentLifecycleState.ACTIVE ||
@ -87,11 +87,9 @@ public class RuleNodeActorMessageProcessor extends ComponentMsgProcessor<RuleNod
throw new TbRuleNodeUpdateException("Failed to update rule node", e);
}
}
} else {
if (tbNode != null) {
stop(null);
tbNode = null;
}
} else if (tbNode != null) {
stop(null);
tbNode = null;
}
}
@ -106,13 +104,13 @@ public class RuleNodeActorMessageProcessor extends ComponentMsgProcessor<RuleNod
@Override
public void onPartitionChangeMsg(PartitionChangeMsg msg) throws Exception {
if (tbNode != null) {
if (!isMyNode()) {
if (!isMySingletonNode()) {
stop(null);
tbNode = null;
} else {
tbNode.onPartitionChangeMsg(defaultCtx, msg);
}
} else if (isMyNode()) {
} else if (isMySingletonNode()) {
start(null);
}
}
@ -138,7 +136,7 @@ public class RuleNodeActorMessageProcessor extends ComponentMsgProcessor<RuleNod
}
void onRuleChainToRuleNodeMsg(RuleChainToRuleNodeMsg msg) throws Exception {
if (!isMyNode()) {
if (!isMySingletonNode()) {
putToQueue(msg.getMsg());
} else {
msg.getMsg().getCallback().onProcessingStart(info);
@ -182,7 +180,7 @@ public class RuleNodeActorMessageProcessor extends ComponentMsgProcessor<RuleNod
return new RuleNodeException("Rule Node is not active! Failed to initialize.", ruleChainName, ruleNode);
}
private boolean isMyNode() {
private boolean isMySingletonNode() {
return !ruleNode.isSingletonMode()
|| systemContext.getDiscoveryService().isMonolith()
|| defaultCtx.isLocalEntity(ruleNode.getId());

2
application/src/main/java/org/thingsboard/server/service/component/AnnotationComponentDiscoveryService.java

@ -155,7 +155,7 @@ public class AnnotationComponentDiscoveryService implements ComponentDiscoverySe
RuleNode ruleNodeAnnotation = clazz.getAnnotation(RuleNode.class);
scannedComponent.setName(ruleNodeAnnotation.name());
scannedComponent.setScope(ruleNodeAnnotation.scope());
scannedComponent.setSingleton(ruleNodeAnnotation.singleton());
scannedComponent.setClusteringMode(ruleNodeAnnotation.clusteringMode());
NodeDefinition nodeDefinition = prepareNodeDefinition(ruleNodeAnnotation);
ObjectNode configurationDescriptor = mapper.createObjectNode();
JsonNode node = mapper.valueToTree(nodeDefinition);

8
common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentSingletonSupport.java → common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentClusteringMode.java

@ -15,8 +15,8 @@
*/
package org.thingsboard.server.common.data.plugin;
public enum ComponentSingletonSupport {
SUPPORTED,
NOT_SUPPORTED,
ONLY_SINGLETON
public enum ComponentClusteringMode {
USER_PREFERENCE,
ENABLED,
SINGLETON
}

12
common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentDescriptor.java

@ -36,17 +36,17 @@ public class ComponentDescriptor extends SearchTextBased<ComponentDescriptorId>
@Getter @Setter private ComponentType type;
@ApiModelProperty(position = 4, value = "Scope of the Rule Node. Always set to 'TENANT', since no rule chains on the 'SYSTEM' level yet.", accessMode = ApiModelProperty.AccessMode.READ_ONLY, allowableValues = "TENANT", example = "TENANT")
@Getter @Setter private ComponentScope scope;
@ApiModelProperty(position = 4, value = "", accessMode = ApiModelProperty.AccessMode.READ_ONLY, allowableValues = "SUPPORTED, NOT_SUPPORTEd, ONLY_SINGLETON", example = "SUPPORTED")
@Getter @Setter private ComponentSingletonSupport singleton;
@ApiModelProperty(position = 5, value = "Clustering mode of the RuleNode. This mode represents the ability to start Rule Node in multiple microservices.", accessMode = ApiModelProperty.AccessMode.READ_ONLY, allowableValues = "USER_PREFERENCE, ENABLED, SINGLETON", example = "ENABLED")
@Getter @Setter private ComponentClusteringMode clusteringMode;
@Length(fieldName = "name")
@ApiModelProperty(position = 5, value = "Name of the Rule Node. Taken from the @RuleNode annotation.", accessMode = ApiModelProperty.AccessMode.READ_ONLY, example = "Custom Rule Node")
@ApiModelProperty(position = 6, value = "Name of the Rule Node. Taken from the @RuleNode annotation.", accessMode = ApiModelProperty.AccessMode.READ_ONLY, example = "Custom Rule Node")
@Getter @Setter private String name;
@ApiModelProperty(position = 6, value = "Full name of the Java class that implements the Rule Engine Node interface.", accessMode = ApiModelProperty.AccessMode.READ_ONLY, example = "com.mycompany.CustomRuleNode")
@ApiModelProperty(position = 7, value = "Full name of the Java class that implements the Rule Engine Node interface.", accessMode = ApiModelProperty.AccessMode.READ_ONLY, example = "com.mycompany.CustomRuleNode")
@Getter @Setter private String clazz;
@ApiModelProperty(position = 7, value = "Complex JSON object that represents the Rule Node configuration.", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
@ApiModelProperty(position = 8, value = "Complex JSON object that represents the Rule Node configuration.", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
@Getter @Setter private transient JsonNode configurationDescriptor;
@Length(fieldName = "actions")
@ApiModelProperty(position = 8, value = "Rule Node Actions. Deprecated. Always null.", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
@ApiModelProperty(position = 9, value = "Rule Node Actions. Deprecated. Always null.", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
@Getter @Setter private String actions;
public ComponentDescriptor() {

2
dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java

@ -403,7 +403,7 @@ public class ModelConstants {
public static final String COMPONENT_DESCRIPTOR_COLUMN_FAMILY_NAME = "component_descriptor";
public static final String COMPONENT_DESCRIPTOR_TYPE_PROPERTY = "type";
public static final String COMPONENT_DESCRIPTOR_SCOPE_PROPERTY = "scope";
public static final String COMPONENT_DESCRIPTOR_SINGLETON_PROPERTY = "singleton";
public static final String COMPONENT_DESCRIPTOR_CLUSTERING_MODE_PROPERTY = "clustering_mode";
public static final String COMPONENT_DESCRIPTOR_NAME_PROPERTY = "name";
public static final String COMPONENT_DESCRIPTOR_CLASS_PROPERTY = "clazz";
public static final String COMPONENT_DESCRIPTOR_CONFIGURATION_DESCRIPTOR_PROPERTY = "configuration_descriptor";

10
dao/src/main/java/org/thingsboard/server/dao/model/sql/ComponentDescriptorEntity.java

@ -23,7 +23,7 @@ import org.hibernate.annotations.TypeDef;
import org.thingsboard.server.common.data.id.ComponentDescriptorId;
import org.thingsboard.server.common.data.plugin.ComponentDescriptor;
import org.thingsboard.server.common.data.plugin.ComponentScope;
import org.thingsboard.server.common.data.plugin.ComponentSingletonSupport;
import org.thingsboard.server.common.data.plugin.ComponentClusteringMode;
import org.thingsboard.server.common.data.plugin.ComponentType;
import org.thingsboard.server.dao.model.BaseSqlEntity;
import org.thingsboard.server.dao.model.ModelConstants;
@ -52,8 +52,8 @@ public class ComponentDescriptorEntity extends BaseSqlEntity<ComponentDescriptor
private ComponentScope scope;
@Enumerated(EnumType.STRING)
@Column(name = ModelConstants.COMPONENT_DESCRIPTOR_SINGLETON_PROPERTY)
private ComponentSingletonSupport singleton;
@Column(name = ModelConstants.COMPONENT_DESCRIPTOR_CLUSTERING_MODE_PROPERTY)
private ComponentClusteringMode clusteringMode;
@Column(name = ModelConstants.COMPONENT_DESCRIPTOR_NAME_PROPERTY)
private String name;
@ -82,7 +82,7 @@ public class ComponentDescriptorEntity extends BaseSqlEntity<ComponentDescriptor
this.actions = component.getActions();
this.type = component.getType();
this.scope = component.getScope();
this.singleton = component.getSingleton();
this.clusteringMode = component.getClusteringMode();
this.name = component.getName();
this.clazz = component.getClazz();
this.configurationDescriptor = component.getConfigurationDescriptor();
@ -95,7 +95,7 @@ public class ComponentDescriptorEntity extends BaseSqlEntity<ComponentDescriptor
data.setCreatedTime(createdTime);
data.setType(type);
data.setScope(scope);
data.setSingleton(singleton);
data.setClusteringMode(clusteringMode);
data.setName(this.getName());
data.setClazz(this.getClazz());
data.setActions(this.getActions());

10
dao/src/main/java/org/thingsboard/server/dao/service/validator/RuleChainDataValidator.java

@ -25,7 +25,7 @@ import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.plugin.ComponentSingletonSupport;
import org.thingsboard.server.common.data.plugin.ComponentClusteringMode;
import org.thingsboard.server.common.data.rule.NodeConnectionInfo;
import org.thingsboard.server.common.data.rule.RuleChain;
import org.thingsboard.server.common.data.rule.RuleChainMetaData;
@ -114,19 +114,19 @@ public class RuleChainDataValidator extends DataValidator<RuleChain> {
}
ConstraintValidator.validateFields(nodeConfig, errorPrefix);
ComponentSingletonSupport nodeConfigType = null;
ComponentClusteringMode nodeConfigType = null;
try {
nodeConfigType = ReflectionUtils.getAnnotationProperty(ruleNode.getType(),
"org.thingsboard.rule.engine.api.RuleNode", "singleton");
"org.thingsboard.rule.engine.api.RuleNode", "clusteringMode");
} catch (Exception e) {
log.warn("Failed to validate singleton mode: {}", ExceptionUtils.getRootCauseMessage(e));
return;
}
if (ComponentSingletonSupport.NOT_SUPPORTED.equals(nodeConfigType) && ruleNode.isSingletonMode()) {
if (ComponentClusteringMode.ENABLED.equals(nodeConfigType) && ruleNode.isSingletonMode()) {
throw new DataValidationException(String.format("Singleton mode not supported for [%s].", ruleNode.getType()));
}
if (ComponentSingletonSupport.ONLY_SINGLETON.equals(nodeConfigType) && !ruleNode.isSingletonMode()) {
if (ComponentClusteringMode.SINGLETON.equals(nodeConfigType) && !ruleNode.isSingletonMode()) {
throw new DataValidationException(String.format("Supported only singleton mode for [%s].", ruleNode.getType()));
}
}

2
dao/src/main/java/org/thingsboard/server/dao/sql/component/AbstractComponentDescriptorInsertRepository.java

@ -77,7 +77,7 @@ public abstract class AbstractComponentDescriptorInsertRepository implements Com
.setParameter("scope", entity.getScope().name())
.setParameter("search_text", entity.getSearchText())
.setParameter("type", entity.getType().name())
.setParameter("singleton", entity.getSingleton().name());
.setParameter("clustering_mode", entity.getClusteringMode().name());
}
private ComponentDescriptorEntity processSaveOrUpdate(ComponentDescriptorEntity entity, String query) {

4
dao/src/main/java/org/thingsboard/server/dao/sql/component/SqlComponentDescriptorInsertRepository.java

@ -44,10 +44,10 @@ public class SqlComponentDescriptorInsertRepository extends AbstractComponentDes
}
private static String getInsertOrUpdateStatement(String conflictKeyStatement, String updateKeyStatement) {
return "INSERT INTO component_descriptor (id, created_time, actions, clazz, configuration_descriptor, name, scope, search_text, type, singleton) VALUES (:id, :created_time, :actions, :clazz, :configuration_descriptor, :name, :scope, :search_text, :type, :singleton) ON CONFLICT " + conflictKeyStatement + " DO UPDATE SET " + updateKeyStatement + " returning *";
return "INSERT INTO component_descriptor (id, created_time, actions, clazz, configuration_descriptor, name, scope, search_text, type, clustering_mode) VALUES (:id, :created_time, :actions, :clazz, :configuration_descriptor, :name, :scope, :search_text, :type, :clustering_mode) ON CONFLICT " + conflictKeyStatement + " DO UPDATE SET " + updateKeyStatement + " returning *";
}
private static String getUpdateStatement(String id) {
return "actions = :actions, " + id + ",created_time = :created_time, configuration_descriptor = :configuration_descriptor, name = :name, scope = :scope, search_text = :search_text, type = :type, singleton = :singleton";
return "actions = :actions, " + id + ",created_time = :created_time, configuration_descriptor = :configuration_descriptor, name = :name, scope = :scope, search_text = :search_text, type = :type, clustering_mode = :clustering_mode";
}
}

2
dao/src/main/resources/sql/schema-entities.sql

@ -126,7 +126,7 @@ CREATE TABLE IF NOT EXISTS component_descriptor (
scope varchar(255),
search_text varchar(255),
type varchar(255),
singleton varchar(255)
clustering_mode varchar(255)
);
CREATE TABLE IF NOT EXISTS customer (

4
rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/RuleNode.java

@ -16,7 +16,7 @@
package org.thingsboard.rule.engine.api;
import org.thingsboard.server.common.data.plugin.ComponentScope;
import org.thingsboard.server.common.data.plugin.ComponentSingletonSupport;
import org.thingsboard.server.common.data.plugin.ComponentClusteringMode;
import org.thingsboard.server.common.data.plugin.ComponentType;
import org.thingsboard.server.common.data.rule.RuleChainType;
@ -39,7 +39,7 @@ public @interface RuleNode {
Class<? extends NodeConfiguration> configClazz();
ComponentSingletonSupport singleton() default ComponentSingletonSupport.NOT_SUPPORTED;
ComponentClusteringMode clusteringMode() default ComponentClusteringMode.ENABLED;
boolean inEnabled() default true;

4
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/TbMqttNode.java

@ -33,7 +33,7 @@ import org.thingsboard.rule.engine.api.util.TbNodeUtils;
import org.thingsboard.rule.engine.credentials.BasicCredentials;
import org.thingsboard.rule.engine.credentials.ClientCredentials;
import org.thingsboard.rule.engine.credentials.CredentialsType;
import org.thingsboard.server.common.data.plugin.ComponentSingletonSupport;
import org.thingsboard.server.common.data.plugin.ComponentClusteringMode;
import org.thingsboard.server.common.data.plugin.ComponentType;
import org.thingsboard.server.common.msg.TbMsg;
import org.thingsboard.server.common.msg.TbMsgMetaData;
@ -48,7 +48,7 @@ import java.util.concurrent.TimeoutException;
type = ComponentType.EXTERNAL,
name = "mqtt",
configClazz = TbMqttNodeConfiguration.class,
singleton = ComponentSingletonSupport.SUPPORTED,
clusteringMode = ComponentClusteringMode.USER_PREFERENCE,
nodeDescription = "Publish messages to the MQTT broker",
nodeDetails = "Will publish message payload to the MQTT broker with QoS <b>AT_LEAST_ONCE</b>.",
uiResources = {"static/rulenode/rulenode-core-config.js"},

4
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/azure/TbAzureIotHubNode.java

@ -29,7 +29,7 @@ import org.thingsboard.rule.engine.credentials.ClientCredentials;
import org.thingsboard.rule.engine.credentials.CredentialsType;
import org.thingsboard.rule.engine.mqtt.TbMqttNode;
import org.thingsboard.rule.engine.mqtt.TbMqttNodeConfiguration;
import org.thingsboard.server.common.data.plugin.ComponentSingletonSupport;
import org.thingsboard.server.common.data.plugin.ComponentClusteringMode;
import org.thingsboard.server.common.data.plugin.ComponentType;
import javax.net.ssl.SSLException;
@ -39,7 +39,7 @@ import javax.net.ssl.SSLException;
type = ComponentType.EXTERNAL,
name = "azure iot hub",
configClazz = TbAzureIotHubNodeConfiguration.class,
singleton = ComponentSingletonSupport.ONLY_SINGLETON,
clusteringMode = ComponentClusteringMode.SINGLETON,
nodeDescription = "Publish messages to the Azure IoT Hub",
nodeDetails = "Will publish message payload to the Azure IoT Hub with QoS <b>AT_LEAST_ONCE</b>.",
uiResources = {"static/rulenode/rulenode-core-config.js"},

4
ui-ngx/src/app/modules/home/pages/rulechain/rule-node-details.component.ts

@ -26,7 +26,7 @@ import { RuleChainService } from '@core/http/rule-chain.service';
import { RuleNodeConfigComponent } from './rule-node-config.component';
import { Router } from '@angular/router';
import { RuleChainType } from '@app/shared/models/rule-chain.models';
import { ComponentSingletonSupport } from '@shared/models/component-descriptor.models';
import { ComponentClusteringMode } from '@shared/models/component-descriptor.models';
@Component({
selector: 'tb-rule-node',
@ -134,6 +134,6 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O
}
isSingletonEditAllowed() {
return this.ruleNode.component.singleton === ComponentSingletonSupport.SUPPORTED;
return this.ruleNode.component.clusteringMode === ComponentClusteringMode.USER_PREFERENCE;
}
}

4
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts

@ -89,7 +89,7 @@ import { DebugEventType, EventType } from '@shared/models/event.models';
import { MatMiniFabButton } from '@angular/material/button';
import { TbPopoverService } from '@shared/components/popover.service';
import { VersionControlComponent } from '@home/components/vc/version-control.component';
import { ComponentSingletonSupport } from '@shared/models/component-descriptor.models';
import { ComponentClusteringMode } from '@shared/models/component-descriptor.models';
import Timeout = NodeJS.Timeout;
@Component({
@ -470,7 +470,7 @@ export class RuleChainPageComponent extends PageComponent
component: ruleNodeComponent,
name: '',
nodeClass: desc.nodeClass,
singletonMode: ruleNodeComponent.singleton !== ComponentSingletonSupport.NOT_SUPPORTED,
singletonMode: ruleNodeComponent.clusteringMode !== ComponentClusteringMode.ENABLED,
icon,
iconUrl,
x: 30,

10
ui-ngx/src/app/shared/models/component-descriptor.models.ts

@ -30,16 +30,16 @@ export enum ComponentScope {
TENANT = 'TENANT'
}
export enum ComponentSingletonSupport {
SUPPORTED = 'SUPPORTED',
NOT_SUPPORTED = 'NOT_SUPPORTED',
ONLY_SINGLETON = 'ONLY_SINGLETON'
export enum ComponentClusteringMode {
USER_PREFERENCE = 'USER_PREFERENCE',
ENABLED = 'ENABLED',
SINGLETON = 'SINGLETON'
}
export interface ComponentDescriptor {
type: ComponentType | RuleNodeType;
scope?: ComponentScope;
singleton: ComponentSingletonSupport;
clusteringMode: ComponentClusteringMode;
name: string;
clazz: string;
configurationDescriptor?: any;

6
ui-ngx/src/app/shared/models/rule-chain.models.ts

@ -19,7 +19,7 @@ import { TenantId } from '@shared/models/id/tenant-id';
import { RuleChainId } from '@shared/models/id/rule-chain-id';
import { RuleNodeId } from '@shared/models/id/rule-node-id';
import { RuleNode, RuleNodeComponentDescriptor, RuleNodeType } from '@shared/models/rule-node.models';
import { ComponentSingletonSupport, ComponentType } from '@shared/models/component-descriptor.models';
import { ComponentClusteringMode, ComponentType } from '@shared/models/component-descriptor.models';
export interface RuleChain extends BaseData<RuleChainId>, ExportableEntity<RuleChainId> {
tenantId: TenantId;
@ -64,7 +64,7 @@ export const ruleNodeTypeComponentTypes: ComponentType[] =
export const unknownNodeComponent: RuleNodeComponentDescriptor = {
type: RuleNodeType.UNKNOWN,
name: 'unknown',
singleton: ComponentSingletonSupport.NOT_SUPPORTED,
clusteringMode: ComponentClusteringMode.ENABLED,
clazz: 'tb.internal.Unknown',
configurationDescriptor: {
nodeDefinition: {
@ -81,7 +81,7 @@ export const unknownNodeComponent: RuleNodeComponentDescriptor = {
export const inputNodeComponent: RuleNodeComponentDescriptor = {
type: RuleNodeType.INPUT,
singleton: ComponentSingletonSupport.NOT_SUPPORTED,
clusteringMode: ComponentClusteringMode.ENABLED,
name: 'Input',
clazz: 'tb.internal.Input'
};

Loading…
Cancel
Save