Client Settings help

(imported topic written by sinucus)

I’m trying to track some information via Client Settings and I’m having some problems with it.

My action code is as follows;

setting “__Version”=“May15” on “{parameter “action issue date” of action}” for client

setting “__ActionCount”="{if (not exists setting “__ActionCount” whose (exists value of it) of client) then “1” else if (value of setting “__Version” of client as string = “May15”) then (value of setting “__ActionCount” of action as integer + 1) else “1”}" on “{parameter “action issue date” of action}” for client

When I run it for the first time on a computer it works. The “not exists” check is working just fine.

Command succeeded setting “__Version”=“May15” on “Wed, 28 May 2014 18:27:27 +0000” for client (action:37831)

Command succeeded setting “__ActionCount”=“1” on “Wed, 28 May 2014 18:27:27 +0000” for client (action:37831)

But when the value exists it doesn’t work. I’m unsure why.

Command succeeded setting “__Version”=“May15” on “Wed, 28 May 2014 18:28:09 +0000” for client (action:37832)

Command failed (Relevance substitution failed) setting “__ActionCount”="{if (not exists setting “__ActionCount” whose (exists value of it) of client) then “1” else if (value of setting “__Version” of client as string = “May15”) then (value of setting “__ActionCount” of action as integer + 1) else “1”}" on “{parameter “action issue date” of action}” for client (action:37832)

Here are QnA results, as you can see the if then appears to run correctly and and QnA results return proper values, but it still fails. Any idea why?

q: value of setting “__Version” of client as string = “May15”

A: True

T: 0.207 ms

I: singular boolean

q: value of setting “__ActionCount” of client

A: 1

T: 0.141 ms

I: singular string

q: value of setting “__ActionCount” of client as integer + 1

A: 2

T: 0.164 ms

I: singular integer

(imported comment written by sinucus)

Looks like I solved my own problem. I had some stupid typos and some casting errors. During my 500 test runs I switched over to using parameters which mean I needed to move to “of action” instead of “of client” and when I moved back to using client settings I didn’t port that line back over, oops.

The real kicker of this was casting. client settings are stored as strings, and you can’t do math operations on strings. So I converted it to integer to do the math but then relevance can’t seem to write an integer if it was looking for a string before? Anyway… So cast as integer and then back to string for the write operation so that it’s strings on both sides and boom… It worked!

setting “__ActionCount”="{if (not exists setting “__ActionCount” whose (exists value of it) of client) then “1” else if (value of setting “__Version” of client as string = “May15”) then ((value of setting “__ActionCount” of client as integer) + 1) as string else “1”}" on “{parameter “action issue date” of action}” for client

Pet peeve here… Why can’t I use client settings in Fixlet Debugger? OH DEAR GOD that would have saved me like 2 hours of testing! When you run action in Fixlet debugger and try to set client settings you get an error “Unimplemeneted command ‘setting’” It would be real nice if you fixed that.

(imported comment written by jgstew)

I agree, in general, debugging actions in the fixlet debugger is a real pain. You frequently have to rewrite it to work in the debugger then rewrite it back again to make it work optimally in the console.

(imported comment written by TJessee)

Gentlemen,

There is a handy tool out there for doing session relevance. Here is the link to it

http://support.bigfix.com/labs/relevanceeditor.html

(imported comment written by jgstew)

But we weren’t talking about session relevance.