|
|
|
@ -91,6 +91,15 @@ public class TenantActor extends RuleChainManagerActor { |
|
|
|
isRuleEngine = systemContext.getServiceInfoProvider().isService(ServiceType.TB_RULE_ENGINE); |
|
|
|
if (isRuleEngine) { |
|
|
|
if (systemContext.getPartitionService().isManagedByCurrentService(tenantId)) { |
|
|
|
try { |
|
|
|
//TODO: IM - extend API usage to have CF Exec Enabled? Not in 4.0;
|
|
|
|
cfActor = ctx.getOrCreateChildActor(new TbStringActorId("CFM|" + tenantId), |
|
|
|
() -> DefaultActorService.CF_MANAGER_DISPATCHER_NAME, |
|
|
|
() -> new CalculatedFieldManagerActorCreator(systemContext, tenantId), |
|
|
|
() -> true); |
|
|
|
} catch (Exception e) { |
|
|
|
log.info("Failed to init CF Actor.", e); |
|
|
|
} |
|
|
|
try { |
|
|
|
if (getApiUsageState().isReExecEnabled()) { |
|
|
|
log.debug("[{}] Going to init rule chains", tenantId); |
|
|
|
@ -98,11 +107,6 @@ public class TenantActor extends RuleChainManagerActor { |
|
|
|
} else { |
|
|
|
log.info("[{}] Skip init of the rule chains due to API limits", tenantId); |
|
|
|
} |
|
|
|
//TODO: IM - extend API usage to have CF Exec Enabled? Not in 4.0;
|
|
|
|
cfActor = ctx.getOrCreateChildActor(new TbStringActorId("CFM|" + tenantId), |
|
|
|
() -> DefaultActorService.CF_MANAGER_DISPATCHER_NAME, |
|
|
|
() -> new CalculatedFieldManagerActorCreator(systemContext, tenantId), |
|
|
|
() -> true); |
|
|
|
} catch (Exception e) { |
|
|
|
log.info("Failed to check ApiUsage \"ReExecEnabled\"!!!", e); |
|
|
|
cantFindTenant = true; |
|
|
|
@ -185,6 +189,10 @@ public class TenantActor extends RuleChainManagerActor { |
|
|
|
} |
|
|
|
|
|
|
|
private void onToCalculatedFieldSystemActorMsg(ToCalculatedFieldSystemMsg msg, boolean priority) { |
|
|
|
if (cfActor == null) { |
|
|
|
log.warn("[{}] CF Actor is not initialized.", tenantId); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (priority) { |
|
|
|
cfActor.tellWithHighPriority(msg); |
|
|
|
} else { |
|
|
|
|