Commit d042707441b1a568c8ccebc4a6d055af934420af
Committed by
Andrew Shvayka
1 parent
41796a4d
cherry-pick from 2.5.5
Showing
2 changed files
with
3 additions
and
1 deletions
... | ... | @@ -126,6 +126,7 @@ public class AlarmController extends BaseController { |
126 | 126 | long ackTs = System.currentTimeMillis(); |
127 | 127 | alarmService.ackAlarm(getCurrentUser().getTenantId(), alarmId, ackTs).get(); |
128 | 128 | alarm.setAckTs(ackTs); |
129 | + alarm.setStatus(alarm.getStatus().isCleared() ? AlarmStatus.CLEARED_ACK : AlarmStatus.ACTIVE_ACK); | |
129 | 130 | logEntityAction(alarm.getOriginator(), alarm, getCurrentUser().getCustomerId(), ActionType.ALARM_ACK, null); |
130 | 131 | } catch (Exception e) { |
131 | 132 | throw handleException(e); |
... | ... | @@ -143,6 +144,7 @@ public class AlarmController extends BaseController { |
143 | 144 | long clearTs = System.currentTimeMillis(); |
144 | 145 | alarmService.clearAlarm(getCurrentUser().getTenantId(), alarmId, null, clearTs).get(); |
145 | 146 | alarm.setClearTs(clearTs); |
147 | + alarm.setStatus(alarm.getStatus().isAck() ? AlarmStatus.CLEARED_ACK : AlarmStatus.CLEARED_UNACK); | |
146 | 148 | logEntityAction(alarm.getOriginator(), alarm, getCurrentUser().getCustomerId(), ActionType.ALARM_CLEAR, null); |
147 | 149 | } catch (Exception e) { |
148 | 150 | throw handleException(e); | ... | ... |
... | ... | @@ -62,7 +62,7 @@ public abstract class TbAbstractAlarmNode<C extends TbAbstractAlarmNodeConfigura |
62 | 62 | } else if (alarmResult.isUpdated) { |
63 | 63 | tellNext(ctx, msg, alarmResult, DataConstants.ENTITY_UPDATED, "Updated"); |
64 | 64 | } else if (alarmResult.isCleared) { |
65 | - tellNext(ctx, msg, alarmResult, DataConstants.ENTITY_UPDATED, "Cleared"); | |
65 | + tellNext(ctx, msg, alarmResult, DataConstants.ALARM_CLEAR, "Cleared"); | |
66 | 66 | } else { |
67 | 67 | ctx.tellSuccess(msg); |
68 | 68 | } | ... | ... |