Can anyone point me in the direction of what the syntax is for using Macro functionality in URS? I have looked through the Genesys Documentation and maybe its me but there isn’t alot of substance to what they have there.
Or Alternatively how do you build a case statement in URS 7.2 in one block?
Have looked at using the Generic Segmentation object? That's about the closest to a CASE (or multiple IF) as you'll get...
Thats fine for segmenting by expression you then need functional blocks for each function to do what you want for that case. With a traditional case statement you have the expression and the function in one construct some what more efficient than segment then function.
In Macro block you can construct a multiple if i.e;
Based on my understanding of macros in URS, if you were looking to do as in your example, you would need to specify 10 parameters:
var_current
var_track_1
var_track_2
and so forth to
var_track_9
I believe then your logic would work, EXCEPT:
For the “case” statement you specified:
var_current!=1|var_current!=2|var_current!=3|var_current!=4|var_current!=5|var_current!=6|var_current!=7|var_current!=8|var_current!=9 → Assign[var_track_error,‘I shouldn’t be here’]
You should actually use “&” (and) instead of “|” (or). Otherwise the case would always execute.
Example:
Assume var_current = 2. The first clause (var_current != 1) would then be true, so the statement would execute.
Instead, taking from your example, you could summarize to:
var_current < 1|var_current > 9 → Assign[var_track_error,‘I shouldn’t be here’]
I guess it’s easier to read in the logs as it doesn’t jump out to a sub routine. Other than that I wouldn’t really know, just another way of doing things I suppose.
In that example, I probably would still use a Generic Segmentation. Other than putting in a condition negating the ones above (GetRoutingPoint != ‘23945’ & GetRoutingPoint != ‘23944’ & …), I can’t think of a way to it in a macro.
A slightly different approach that may work:
If you put the valid routing points into a Key-Value list (that is, 23945:true|23944:true etc), you might be able to use the List Functions to retrieve the value, such as
[assuming RPList is my Key Value List]
GetStringKey(GetRoutingPoint,RPList) != ‘’ → Assign[var_walkaway, true]
GetStringKey(GetRoutingPoint,RPList) = ‘’ → Assign[var_walkaway, true]
One advantage I can see is it does not have the overhead that goes with executing a subroutine - pushing/popping variables, suspending execution of the current strategy, etc.
They are also useful for cases where you want to do something repeatedly. For example, I use a complex macro (below) to convert variables containing yes/no values into Y or N , so I only have to check for Y/N in an IF block, instead of “If YES or Y or yes or y”