@ -40,12 +40,9 @@ import org.thingsboard.rule.engine.api.ScriptEngine;
import org.thingsboard.server.actors.ActorSystemContext ;
import org.thingsboard.server.actors.tenant.DebugTbRateLimits ;
import org.thingsboard.server.common.data.DataConstants ;
import org.thingsboard.server.common.data.EntityType ;
import org.thingsboard.server.common.data.Event ;
import org.thingsboard.server.common.data.StringUtils ;
import org.thingsboard.server.common.data.audit.ActionType ;
import org.thingsboard.server.common.data.edge.Edge ;
import org.thingsboard.server.common.data.edge.EdgeEventActionType ;
import org.thingsboard.server.common.data.exception.ThingsboardException ;
import org.thingsboard.server.common.data.id.EdgeId ;
import org.thingsboard.server.common.data.id.RuleChainId ;
@ -62,14 +59,11 @@ import org.thingsboard.server.common.data.rule.RuleChainImportResult;
import org.thingsboard.server.common.data.rule.RuleChainMetaData ;
import org.thingsboard.server.common.data.rule.RuleChainOutputLabelsUsage ;
import org.thingsboard.server.common.data.rule.RuleChainType ;
import org.thingsboard.server.common.data.rule.RuleChainUpdateResult ;
import org.thingsboard.server.common.data.rule.RuleNode ;
import org.thingsboard.server.common.msg.TbMsg ;
import org.thingsboard.server.common.msg.TbMsgDataType ;
import org.thingsboard.server.common.msg.TbMsgMetaData ;
import org.thingsboard.server.dao.event.EventService ;
import org.thingsboard.server.queue.util.TbCoreComponent ;
import org.thingsboard.server.service.install.InstallScripts ;
import org.thingsboard.server.service.rule.TbRuleChainService ;
import org.thingsboard.server.service.script.JsInvokeService ;
import org.thingsboard.server.service.script.RuleNodeJsScriptEngine ;
@ -77,15 +71,11 @@ import org.thingsboard.server.service.security.permission.Operation;
import org.thingsboard.server.service.security.permission.Resource ;
import java.util.ArrayList ;
import java.util.Collections ;
import java.util.HashMap ;
import java.util.List ;
import java.util.Map ;
import java.util.Set ;
import java.util.TreeSet ;
import java.util.concurrent.ConcurrentMap ;
import java.util.concurrent.TimeUnit ;
import java.util.stream.Collectors ;
import static org.thingsboard.server.controller.ControllerConstants.EDGE_ASSIGN_ASYNC_FIRST_STEP_DESCRIPTION ;
import static org.thingsboard.server.controller.ControllerConstants.EDGE_ASSIGN_RECEIVE_STEP_DESCRIPTION ;
@ -146,9 +136,6 @@ public class RuleChainController extends BaseController {
@Autowired
protected TbRuleChainService tbRuleChainService ;
@Autowired
private InstallScripts installScripts ;
@Autowired
private EventService eventService ;
@ -246,38 +233,11 @@ public class RuleChainController extends BaseController {
public RuleChain saveRuleChain (
@ApiParam ( value = "A JSON value representing the rule chain." )
@RequestBody RuleChain ruleChain ) throws ThingsboardException {
try {
boolean created = ruleChain . getId ( ) = = null ;
ruleChain . setTenantId ( getCurrentUser ( ) . getTenantId ( ) ) ;
checkEntity ( ruleChain . getId ( ) , ruleChain , Resource . RULE_CHAIN ) ;
RuleChain savedRuleChain = checkNotNull ( ruleChainService . saveRuleChain ( ruleChain ) ) ;
if ( RuleChainType . CORE . equals ( savedRuleChain . getType ( ) ) ) {
tbClusterService . broadcastEntityStateChangeEvent ( ruleChain . getTenantId ( ) , savedRuleChain . getId ( ) ,
created ? ComponentLifecycleEvent . CREATED : ComponentLifecycleEvent . UPDATED ) ;
}
logEntityAction ( savedRuleChain . getId ( ) , savedRuleChain ,
null ,
created ? ActionType . ADDED : ActionType . UPDATED , null ) ;
if ( RuleChainType . EDGE . equals ( savedRuleChain . getType ( ) ) ) {
if ( ! created ) {
sendEntityNotificationMsg ( savedRuleChain . getTenantId ( ) , savedRuleChain . getId ( ) , EdgeEventActionType . UPDATED ) ;
}
}
return savedRuleChain ;
} catch ( Exception e ) {
logEntityAction ( emptyId ( EntityType . RULE_CHAIN ) , ruleChain ,
null , ruleChain . getId ( ) = = null ? ActionType . ADDED : ActionType . UPDATED , e ) ;
throw handleException ( e ) ;
}
}
ruleChain . setTenantId ( getCurrentUser ( ) . getTenantId ( ) ) ;
checkEntity ( ruleChain . getId ( ) , ruleChain , Resource . RULE_CHAIN ) ;
return tbRuleChainService . save ( ruleChain , getCurrentUser ( ) ) ;
}
@ApiOperation ( value = "Create Default Rule Chain" ,
notes = "Create rule chain from template, based on the specified name in the request. " +
@ -288,24 +248,11 @@ public class RuleChainController extends BaseController {
public RuleChain saveRuleChain (
@ApiParam ( value = "A JSON value representing the request." )
@RequestBody DefaultRuleChainCreateRequest request ) throws ThingsboardException {
try {
checkNotNull ( request ) ;
checkParameter ( request . getName ( ) , "name" ) ;
RuleChain savedRuleChain = installScripts . createDefaultRuleChain ( getCurrentUser ( ) . getTenantId ( ) , request . getName ( ) ) ;
tbClusterService . broadcastEntityStateChangeEvent ( savedRuleChain . getTenantId ( ) , savedRuleChain . getId ( ) , ComponentLifecycleEvent . CREATED ) ;
logEntityAction ( savedRuleChain . getId ( ) , savedRuleChain , null , ActionType . ADDED , null ) ;
return savedRuleChain ;
} catch ( Exception e ) {
RuleChain ruleChain = new RuleChain ( ) ;
ruleChain . setName ( request . getName ( ) ) ;
logEntityAction ( emptyId ( EntityType . RULE_CHAIN ) , ruleChain , null , ActionType . ADDED , e ) ;
throw handleException ( e ) ;
}
}
checkNotNull ( request ) ;
checkParameter ( request . getName ( ) , "name" ) ;
return tbRuleChainService . saveDefaultByName ( getTenantId ( ) , request , getCurrentUser ( ) ) ;
}
@ApiOperation ( value = "Set Root Rule Chain (setRootRuleChain)" ,
notes = "Makes the rule chain to be root rule chain. Updates previous root rule chain as well. " + TENANT_AUTHORITY_PARAGRAPH )
@ -316,38 +263,10 @@ public class RuleChainController extends BaseController {
@ApiParam ( value = RULE_CHAIN_ID_PARAM_DESCRIPTION )
@PathVariable ( RULE_CHAIN_ID ) String strRuleChainId ) throws ThingsboardException {
checkParameter ( RULE_CHAIN_ID , strRuleChainId ) ;
try {
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . WRITE ) ;
TenantId tenantId = getCurrentUser ( ) . getTenantId ( ) ;
RuleChain previousRootRuleChain = ruleChainService . getRootTenantRuleChain ( tenantId ) ;
if ( ruleChainService . setRootRuleChain ( getTenantId ( ) , ruleChainId ) ) {
if ( previousRootRuleChain ! = null ) {
previousRootRuleChain = ruleChainService . findRuleChainById ( getTenantId ( ) , previousRootRuleChain . getId ( ) ) ;
tbClusterService . broadcastEntityStateChangeEvent ( previousRootRuleChain . getTenantId ( ) , previousRootRuleChain . getId ( ) ,
ComponentLifecycleEvent . UPDATED ) ;
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . WRITE ) ;
return tbRuleChainService . setRootRuleChain ( getTenantId ( ) , ruleChain , getCurrentUser ( ) ) ;
logEntityAction ( previousRootRuleChain . getId ( ) , previousRootRuleChain ,
null , ActionType . UPDATED , null ) ;
}
ruleChain = ruleChainService . findRuleChainById ( getTenantId ( ) , ruleChainId ) ;
tbClusterService . broadcastEntityStateChangeEvent ( ruleChain . getTenantId ( ) , ruleChain . getId ( ) ,
ComponentLifecycleEvent . UPDATED ) ;
logEntityAction ( ruleChain . getId ( ) , ruleChain ,
null , ActionType . UPDATED , null ) ;
}
return ruleChain ;
} catch ( Exception e ) {
logEntityAction ( emptyId ( EntityType . RULE_CHAIN ) ,
null ,
null ,
ActionType . UPDATED , e , strRuleChainId ) ;
throw handleException ( e ) ;
}
}
@ApiOperation ( value = "Update Rule Chain Metadata" ,
@ -361,59 +280,19 @@ public class RuleChainController extends BaseController {
@ApiParam ( value = "Update related rule nodes." )
@RequestParam ( value = "updateRelated" , required = false , defaultValue = "true" ) boolean updateRelated
) throws ThingsboardException {
try {
TenantId tenantId = getTenantId ( ) ;
if ( debugPerTenantEnabled ) {
ConcurrentMap < TenantId , DebugTbRateLimits > debugPerTenantLimits = actorContext . getDebugPerTenantLimits ( ) ;
DebugTbRateLimits debugTbRateLimits = debugPerTenantLimits . getOrDefault ( tenantId , null ) ;
if ( debugTbRateLimits ! = null ) {
debugPerTenantLimits . remove ( tenantId , debugTbRateLimits ) ;
}
}
RuleChain ruleChain = checkRuleChain ( ruleChainMetaData . getRuleChainId ( ) , Operation . WRITE ) ;
RuleChainUpdateResult result = ruleChainService . saveRuleChainMetaData ( tenantId , ruleChainMetaData ) ;
checkNotNull ( result . isSuccess ( ) ? true : null ) ;
List < RuleChain > updatedRuleChains ;
if ( updateRelated & & result . isSuccess ( ) ) {
updatedRuleChains = tbRuleChainService . updateRelatedRuleChains ( tenantId , ruleChainMetaData . getRuleChainId ( ) , result ) ;
} else {
updatedRuleChains = Collections . emptyList ( ) ;
}
RuleChainMetaData savedRuleChainMetaData = checkNotNull ( ruleChainService . loadRuleChainMetaData ( tenantId , ruleChainMetaData . getRuleChainId ( ) ) ) ;
if ( RuleChainType . CORE . equals ( ruleChain . getType ( ) ) ) {
tbClusterService . broadcastEntityStateChangeEvent ( ruleChain . getTenantId ( ) , ruleChain . getId ( ) , ComponentLifecycleEvent . UPDATED ) ;
updatedRuleChains . forEach ( updatedRuleChain - > {
tbClusterService . broadcastEntityStateChangeEvent ( updatedRuleChain . getTenantId ( ) , updatedRuleChain . getId ( ) , ComponentLifecycleEvent . UPDATED ) ;
} ) ;
TenantId tenantId = getTenantId ( ) ;
if ( debugPerTenantEnabled ) {
ConcurrentMap < TenantId , DebugTbRateLimits > debugPerTenantLimits = actorContext . getDebugPerTenantLimits ( ) ;
DebugTbRateLimits debugTbRateLimits = debugPerTenantLimits . getOrDefault ( tenantId , null ) ;
if ( debugTbRateLimits ! = null ) {
debugPerTenantLimits . remove ( tenantId , debugTbRateLimits ) ;
}
logEntityAction ( ruleChain . getId ( ) , ruleChain , null , ActionType . UPDATED , null , ruleChainMetaData ) ;
for ( RuleChain updatedRuleChain : updatedRuleChains ) {
RuleChainMetaData updatedRuleChainMetaData = checkNotNull ( ruleChainService . loadRuleChainMetaData ( tenantId , updatedRuleChain . getId ( ) ) ) ;
logEntityAction ( updatedRuleChain . getId ( ) , updatedRuleChain , null , ActionType . UPDATED , null , updatedRuleChainMetaData ) ;
}
if ( RuleChainType . EDGE . equals ( ruleChain . getType ( ) ) ) {
sendEntityNotificationMsg ( ruleChain . getTenantId ( ) , ruleChain . getId ( ) , EdgeEventActionType . UPDATED ) ;
updatedRuleChains . forEach ( updatedRuleChain - > {
sendEntityNotificationMsg ( updatedRuleChain . getTenantId ( ) , updatedRuleChain . getId ( ) , EdgeEventActionType . UPDATED ) ;
} ) ;
}
return savedRuleChainMetaData ;
} catch ( Exception e ) {
logEntityAction ( emptyId ( EntityType . RULE_CHAIN ) , null ,
null , ActionType . UPDATED , e , ruleChainMetaData ) ;
throw handleException ( e ) ;
}
}
RuleChain ruleChain = checkRuleChain ( ruleChainMetaData . getRuleChainId ( ) , Operation . WRITE ) ;
return tbRuleChainService . saveRuleChainMetaData ( tenantId , ruleChain , ruleChainMetaData , updateRelated ,
getCurrentUser ( ) ) ;
}
@ApiOperation ( value = "Get Rule Chains (getRuleChains)" ,
notes = "Returns a page of Rule Chains owned by tenant. " + RULE_CHAIN_DESCRIPTION + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH )
@ -456,46 +335,11 @@ public class RuleChainController extends BaseController {
@ApiParam ( value = RULE_CHAIN_ID_PARAM_DESCRIPTION )
@PathVariable ( RULE_CHAIN_ID ) String strRuleChainId ) throws ThingsboardException {
checkParameter ( RULE_CHAIN_ID , strRuleChainId ) ;
try {
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . DELETE ) ;
List < RuleNode > referencingRuleNodes = ruleChainService . getReferencingRuleChainNodes ( getTenantId ( ) , ruleChainId ) ;
Set < RuleChainId > referencingRuleChainIds = referencingRuleNodes . stream ( ) . map ( RuleNode : : getRuleChainId ) . collect ( Collectors . toSet ( ) ) ;
List < EdgeId > relatedEdgeIds = null ;
if ( RuleChainType . EDGE . equals ( ruleChain . getType ( ) ) ) {
relatedEdgeIds = findRelatedEdgeIds ( getTenantId ( ) , ruleChainId ) ;
}
ruleChainService . deleteRuleChainById ( getTenantId ( ) , ruleChainId ) ;
referencingRuleChainIds . remove ( ruleChain . getId ( ) ) ;
if ( RuleChainType . CORE . equals ( ruleChain . getType ( ) ) ) {
referencingRuleChainIds . forEach ( referencingRuleChainId - >
tbClusterService . broadcastEntityStateChangeEvent ( ruleChain . getTenantId ( ) , referencingRuleChainId , ComponentLifecycleEvent . UPDATED ) ) ;
tbClusterService . broadcastEntityStateChangeEvent ( ruleChain . getTenantId ( ) , ruleChain . getId ( ) , ComponentLifecycleEvent . DELETED ) ;
}
logEntityAction ( ruleChainId , ruleChain ,
null ,
ActionType . DELETED , null , strRuleChainId ) ;
if ( RuleChainType . EDGE . equals ( ruleChain . getType ( ) ) ) {
sendDeleteNotificationMsg ( ruleChain . getTenantId ( ) , ruleChain . getId ( ) , relatedEdgeIds ) ;
}
} catch ( Exception e ) {
logEntityAction ( emptyId ( EntityType . RULE_CHAIN ) ,
null ,
null ,
ActionType . DELETED , e , strRuleChainId ) ;
throw handleException ( e ) ;
}
}
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . DELETE ) ;
tbRuleChainService . delete ( ruleChain , getCurrentUser ( ) ) ;
}
@ApiOperation ( value = "Get latest input message (getLatestRuleNodeDebugInput)" ,
notes = "Gets the input message from the debug events for specified Rule Chain Id. " +
@ -681,31 +525,14 @@ public class RuleChainController extends BaseController {
@PathVariable ( RULE_CHAIN_ID ) String strRuleChainId ) throws ThingsboardException {
checkParameter ( "edgeId" , strEdgeId ) ;
checkParameter ( RULE_CHAIN_ID , strRuleChainId ) ;
try {
EdgeId edgeId = new EdgeId ( toUUID ( strEdgeId ) ) ;
Edge edge = checkEdgeId ( edgeId , Operation . WRITE ) ;
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
checkRuleChain ( ruleChainId , Operation . READ ) ;
RuleChain savedRuleChain = checkNotNull ( ruleChainService . assignRuleChainToEdge ( getCurrentUser ( ) . getTenantId ( ) , ruleChainId , edgeId ) ) ;
logEntityAction ( ruleChainId , savedRuleChain ,
null ,
ActionType . ASSIGNED_TO_EDGE , null , strRuleChainId , strEdgeId , edge . getName ( ) ) ;
sendEntityAssignToEdgeNotificationMsg ( getTenantId ( ) , edgeId , savedRuleChain . getId ( ) , EdgeEventActionType . ASSIGNED_TO_EDGE ) ;
EdgeId edgeId = new EdgeId ( toUUID ( strEdgeId ) ) ;
Edge edge = checkEdgeId ( edgeId , Operation . WRITE ) ;
return savedRuleChain ;
} catch ( Exception e ) {
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . READ ) ;
logEntityAction ( emptyId ( EntityType . RULE_CHAIN ) , null ,
null ,
ActionType . ASSIGNED_TO_EDGE , e , strRuleChainId , strEdgeId ) ;
throw handleException ( e ) ;
}
}
return tbRuleChainService . assignRuleChainToEdge ( getTenantId ( ) , ruleChain , edge , getCurrentUser ( ) ) ;
}
@ApiOperation ( value = "Unassign rule chain from edge (unassignRuleChainFromEdge)" ,
notes = "Clears assignment of the rule chain to the edge. " +
@ -721,30 +548,13 @@ public class RuleChainController extends BaseController {
@PathVariable ( RULE_CHAIN_ID ) String strRuleChainId ) throws ThingsboardException {
checkParameter ( "edgeId" , strEdgeId ) ;
checkParameter ( RULE_CHAIN_ID , strRuleChainId ) ;
try {
EdgeId edgeId = new EdgeId ( toUUID ( strEdgeId ) ) ;
Edge edge = checkEdgeId ( edgeId , Operation . WRITE ) ;
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . READ ) ;
RuleChain savedRuleChain = checkNotNull ( ruleChainService . unassignRuleChainFromEdge ( getCurrentUser ( ) . getTenantId ( ) , ruleChainId , edgeId , false ) ) ;
logEntityAction ( ruleChainId , ruleChain ,
null ,
ActionType . UNASSIGNED_FROM_EDGE , null , strRuleChainId , strEdgeId , edge . getName ( ) ) ;
sendEntityAssignToEdgeNotificationMsg ( getTenantId ( ) , edgeId , savedRuleChain . getId ( ) , EdgeEventActionType . UNASSIGNED_FROM_EDGE ) ;
EdgeId edgeId = new EdgeId ( toUUID ( strEdgeId ) ) ;
Edge edge = checkEdgeId ( edgeId , Operation . WRITE ) ;
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . READ ) ;
return savedRuleChain ;
} catch ( Exception e ) {
logEntityAction ( emptyId ( EntityType . RULE_CHAIN ) , null ,
null ,
ActionType . UNASSIGNED_FROM_EDGE , e , strRuleChainId , strEdgeId ) ;
throw handleException ( e ) ;
}
}
return tbRuleChainService . unassignRuleChainFromEdge ( getTenantId ( ) , ruleChain , edge , getCurrentUser ( ) ) ;
}
@ApiOperation ( value = "Get Edge Rule Chains (getEdgeRuleChains)" ,
notes = "Returns a page of Rule Chains assigned to the specified edge. " + RULE_CHAIN_DESCRIPTION + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH )
@ -785,18 +595,9 @@ public class RuleChainController extends BaseController {
public RuleChain setEdgeTemplateRootRuleChain ( @ApiParam ( value = RULE_CHAIN_ID_PARAM_DESCRIPTION )
@PathVariable ( RULE_CHAIN_ID ) String strRuleChainId ) throws ThingsboardException {
checkParameter ( RULE_CHAIN_ID , strRuleChainId ) ;
try {
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . WRITE ) ;
ruleChainService . setEdgeTemplateRootRuleChain ( getTenantId ( ) , ruleChainId ) ;
return ruleChain ;
} catch ( Exception e ) {
logEntityAction ( emptyId ( EntityType . RULE_CHAIN ) ,
null ,
null ,
ActionType . UPDATED , e , strRuleChainId ) ;
throw handleException ( e ) ;
}
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . WRITE ) ;
return tbRuleChainService . setEdgeTemplateRootRuleChain ( getTenantId ( ) , ruleChain , getCurrentUser ( ) ) ;
}
@ApiOperation ( value = "Set Auto Assign To Edge Rule Chain (setAutoAssignToEdgeRuleChain)" ,
@ -808,19 +609,10 @@ public class RuleChainController extends BaseController {
public RuleChain setAutoAssignToEdgeRuleChain ( @ApiParam ( value = RULE_CHAIN_ID_PARAM_DESCRIPTION )
@PathVariable ( RULE_CHAIN_ID ) String strRuleChainId ) throws ThingsboardException {
checkParameter ( RULE_CHAIN_ID , strRuleChainId ) ;
try {
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . WRITE ) ;
ruleChainService . setAutoAssignToEdgeRuleChain ( getTenantId ( ) , ruleChainId ) ;
return ruleChain ;
} catch ( Exception e ) {
logEntityAction ( emptyId ( EntityType . RULE_CHAIN ) ,
null ,
null ,
ActionType . UPDATED , e , strRuleChainId ) ;
throw handleException ( e ) ;
}
}
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . WRITE ) ;
return tbRuleChainService . setAutoAssignToEdgeRuleChain ( getTenantId ( ) , ruleChain , getCurrentUser ( ) ) ;
}
@ApiOperation ( value = "Unset Auto Assign To Edge Rule Chain (unsetAutoAssignToEdgeRuleChain)" ,
notes = "Removes the rule chain from the list of rule chains that are going to be automatically assigned for any new edge that will be created. " +
@ -831,19 +623,11 @@ public class RuleChainController extends BaseController {
public RuleChain unsetAutoAssignToEdgeRuleChain ( @ApiParam ( value = RULE_CHAIN_ID_PARAM_DESCRIPTION )
@PathVariable ( RULE_CHAIN_ID ) String strRuleChainId ) throws ThingsboardException {
checkParameter ( RULE_CHAIN_ID , strRuleChainId ) ;
try {
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . WRITE ) ;
ruleChainService . unsetAutoAssignToEdgeRuleChain ( getTenantId ( ) , ruleChainId ) ;
return ruleChain ;
} catch ( Exception e ) {
logEntityAction ( emptyId ( EntityType . RULE_CHAIN ) ,
null ,
null ,
ActionType . UPDATED , e , strRuleChainId ) ;
throw handleException ( e ) ;
}
}
RuleChainId ruleChainId = new RuleChainId ( toUUID ( strRuleChainId ) ) ;
RuleChain ruleChain = checkRuleChain ( ruleChainId , Operation . WRITE ) ;
return tbRuleChainService . unsetAutoAssignToEdgeRuleChain ( getTenantId ( ) , ruleChain , getCurrentUser ( ) ) ;
}
// TODO: @voba refactor this - add new config to edge rule chain to set it as auto-assign
@ApiOperation ( value = "Get Auto Assign To Edge Rule Chains (getAutoAssignToEdgeRuleChains)" ,
@ -865,5 +649,4 @@ public class RuleChainController extends BaseController {
throw handleException ( e ) ;
}
}
}