Submitting useful Property Bag items for Alert Description

In a previous post, I gave an example of how to submit useful information, by means of a Property Bag, to extend more information to an operator while viewing State Change Events in Health Explorer.

Another interesting part of submitting this information in a nicely formatted data item, is that this data item can also be used in the Alert Description.

Just to recap from the previous post, the Property Bag name-value pair we are submitting is:

Call oBag.AddValue("Details","The number of records in the " & strTableName & " table in " & strDBServer & _
" / " & strDatabase & " database has exceeded Critical threshold: " & strHighThreshold & "." & _
"Current record count is " & strCount & ".")

So, instead of configuring the Alert Description like:

The number of records in the $Data/Context/DataItem/Property[@Name='Table']$ table in the $Data/Context/DataItem/Property[@Name='DBServer']$ / $Data/Context/DataItem/Property[@Name='Database']$ database has exceeded the critical threshold: $Data/Context/DataItem/Property[@Name='HighThreshold']$. Current record count is: $Data/Context/DataItem/Property[@Name='RecordCount']$.

image

…we can configure the Alert Description by simply using the Data Item passed into the workflow via the Property Bag:

$Data/Context/DataItem/Property[@Name='Details']$

image

As you can see, by creating a Details property bag and formatting those details in the script, we can take some of the confusion out of formatting these alert descriptions in the GUI.

All we need to know is, there is a Data Item passed to this workflow that has the formatted details.  And that Data Item is:

$Data/Context/DataItem/Property[@Name='Details']$

The final result of using this data item in the Alert Description is:

image

And, from my previous post, we also used this data item for the State Change Event:

image