SPECTRUM Event Condition Rule errors when testing for text string (Legacy KB ID CNC TS31651 )

Document ID : KB000051947
Last Modified Date : 14/02/2018
Show Technical Document Details
In the original Event Condition Rule, the user had "v {102}" and should have used "{v 102}". Changing the Event Condition Rule to the following resolved the error:


0xffff0040 E 50 R CA.EventCondition, "{v 102} == {S Grave}" , "0xffff0041","{v 102} == {S Informativo}" , "0xffff0042"



Related Issues/Questions:
SPECTRUM Event Condition Rule errors when testing for text string

Problem Environment:
SPECTRUM 08.01.00.00
SPECTRUM 09.00.00.00
Event Condition Rule
User created the following Event Condition Rule:


0xffff0040 E 50 R CA.EventCondition, "v {102} == {S Grave}" , "0xffff0041","v {102} == {S Informativo}" , "0xffff0042"


The user had the "event_disp_error_file=erro_file" set in the $SPECROOT/SS/.vnmrc file. The error_file showed the following error for the above Event Condition Rule:


-------------------------------------------------
  2009/05/01 11:50:40
  Event disposition files have been (re)loaded
-------------------------------------------------


Error in file CA.EventCondition Error parsing evaluation condition string ("v {102} == {S "Grave"}"): syntax error
Error in file CA.EventConditionFailed to parse evaluation condition string ("v {102} == {S "Grave"}"): could not generate condition
Error in file CA.EventCondition Error parsing evaluation condition string ("v {102} == {S "Informativo"}"): syntax error
Error in file CA.EventConditionFailed to parse evaluation condition string ("v {102} == {S "Informativo"}"): could not generate condition
The event rule CA.EventCondition is aborted due to errors.



Causes of this problem:
The cause was a syntax error in the Event Condition Rule.

Additional Information:
Although using the "==" operator for a text string is permissible and will work, operators such as ==, !=, <, > etc should only be used for numeric values. A better solution for string operations is to use regexp as follows:


0xffff0040 E 50 R CA.EventCondition, "regexp( {v 102},{S \"Grave\"})", "0xffff0041 ", "regexp( {v 102},{S \"Informativo\"})", "0xffff0042 "


Please refer to the SPECTRUM 8.1 Event Configuration Editor User Guide and Event Configuration Files Guide and the SPECTRUM 9.0 Event Configuration User Guide for more information on using Event Rules.


(Legacy KB ID CNC TS31651 )