Merge pull request #3346 from YevhenBondarenko/master

fix alarm get propagation ids
This commit is contained in:
Igor Kulikov 2020-08-21 13:52:01 +03:00 committed by GitHub
commit f40c259d3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -391,8 +391,12 @@ public class BaseAlarmService extends AbstractEntityService implements AlarmServ
}
private Set<EntityId> getPropagationEntityIds(Alarm alarm) {
List<EntityRelation> relations = relationService.findByTo(alarm.getTenantId(), alarm.getId(), RelationTypeGroup.ALARM);
return relations.stream().map(EntityRelation::getFrom).collect(Collectors.toSet());
if (alarm.isPropagate()) {
List<EntityRelation> relations = relationService.findByTo(alarm.getTenantId(), alarm.getId(), RelationTypeGroup.ALARM);
return relations.stream().map(EntityRelation::getFrom).collect(Collectors.toSet());
} else {
return Collections.singleton(alarm.getOriginator());
}
}
private void createAlarmRelation(TenantId tenantId, EntityId entityId, EntityId alarmId) {