An agent's rule doesn't seem to execute


(Pierre von Kaenel) #1

I have a set of agents that gather notes. Each agent has as key attributes FundamentalRating and PriceRating (both are numbers and initially are 0). After reading an agent’s alias notes, I assign values to the two attributes. To be sure i don’t overlook assigning values, I include for each agent the following Rule (in Action Inspector):

if($FundamentalRating==0 & $PriceRating==0){$Badge=“0”};

I am assuming that I can assign a Rule to an agent, and from what I read in one forum response, rules run within a second or so. My problem is that some agents display a correct badge of 0, but others incorrectly display a badge of 0 when one or both of the attributes are not 0. Those not displaying a badge are correct (at least one of the attributes is not 0). When entering the rules, I cut and pasted them into each agent.

Is my syntax wrong?


(Mark Anderson) #2

It’s not wrong but probably not correctly covering outcomes. If a note gets a “o” badge and then either tested rating changes, the badge remains the same, because you only act on one half of the test you’re doing. Is spect you want this:

if($FundamentalRating==0 & $PriceRating==0){$Badge="0"}else{$Badge=;};

Now, if a rating is applied, $Badge is reset to the default (or prototype inherited) badge value.

An agent can have a rule, but it only applies the agent itself, as with a normal note. To affect the aliases created in response to the agents query ($AgentQuery) you need to set the agent’s action ($AgentAction).


(Pierre von Kaenel) #3

Thanks - your code works.

And thanks for the added comment. I don’t want this rule to apply to the aliases, but if I ever do need such an outcome for a different situation, I’ll remember it.