-1

I have multiple items that are traps that return an integer such as below.

app.tidal.Health.HighPriority.MessagesInQueue
app.tidal.Health.CommDefault.MessagesInQueue
app.tidal.Health.Default.MessagesInQueue

I want to create a trigger if two or more of these has returned a value of greater than 0 in the last 3 checks to send a severity High message.

I'm having a hard time trying to devise my trigger this is what I currently have:

{Template_App_Tidal_Masters:app.tidal.Health.CommDefault.MessagesInQueue.min(#3)}>0 and
{Template_App_Tidal_Masters:app.tidal.Health.Default.MessagesInQueue.min(#3)}>0 and
{Template_App_Tidal_Masters:app.tidal.Health.HighPriority.MessagesInQueue.min(#3)}>0

But obviously it won't work as it's an and statement so all 3 would have to be greater than 0 the last 3 checks. Formatted the trigger on 3 lines to make it clearer.

whoisearth
  • 4,080
  • 13
  • 62
  • 130

1 Answers1

1

This should work:

({Template_App_Tidal_Masters:app.tidal.Health.CommDefault.MessagesInQueue.min(#3)}>0) +
({Template_App_Tidal_Masters:app.tidal.Health.Default.MessagesInQueue.min(#3)}>0) +
({Template_App_Tidal_Masters:app.tidal.Health.HighPriority.MessagesInQueue.min(#3)}>0) > 1

Each part first evaluates an individual item to be larger than 0. If that is true, that part of the expression evaluates to 1, if false - to 0. In the end we sum up the results of these evaluations (not the original item values) and check whether two or more items had values larger than zero.

Richlv
  • 3,954
  • 1
  • 17
  • 21
  • yeah the problem is any of the items can be greater than 1 so if one is a value of 3 but the other 2 0 it will trigger but I want a trigger if any two of them is greater than 0 – whoisearth Aug 13 '16 at 04:23
  • expanding on this is there a way to keep the item value (ie. 644) but have it represent as a 1? then your solution works. – whoisearth Aug 13 '16 at 04:24
  • No, the expression I provided should only fire when any two are > 0 (unless I messed up there). Will expand the answer to explain it more. – Richlv Aug 14 '16 at 11:45