Conditional expressions and %

I’ve just discovered an undocumented feature/bug in Developer - when using a conditional expression in the child of a BRANCH step, if the variable isn’t a root varible, it must be enclosed with % signs.

value > 10 is fine but
record/value > 10 isn’t fine and must be stated as
%record/value% > 10

As far as I can see, this isn’t documented. Does anybody know what the rule is regarding the use (or not) of % around a variable? The documentation states that you can refer to variables either way, but this is obviously wrong. What is the reality?

It’s the same as the case with pipeline variable substitution.

I thought that we need to have the %% for every variable that we use as substitution in real time comparison.

And it’s only neglected in case of label evaluation.

The documentation for Developer 6.1 and 6.5 does state that variables may be addressed with or without the enclosing ‘%’ characters. In my experience, however, the only time an expression is ever evaluated correctly without the ‘%’ characters is the case of a simple variable that is not a subfield. For this reason I always use ‘%’ signs. In case of label evaluation, I believe this is because the path to the variable is effectively part of the variable’s name and thus includes the special forward-slash character. Pipeline substitution never works without the ‘%’ enclosure, which is where the documention clearly seems to be in error. I have found no further explanation of this on Advantage or in the docs.


As Tim replied, it is not a bug and is documented by webMethods.

Regd using variables in Branch. The variables can be defined in 2 ways:

  1. Using the label property and defining the variable in the label or
  2. Using the variable as part of a sequence or a map step inside the branch

Incase of using case 1, the property Evaluate Labels should be set to False and your statement would look like “Branch on /label”

Incase of using case 2, then the property Evaluate Labels should be set to True and your branch statement would look like “Branch”
and inside the branch statement suppose we are using a sequence then the label of the sequence should be “%label%>10:Sequence”

It is basically like when using the variable as part of the Branch statement you dont have to put the %% tag. Whereas when you are using the variable as a substep inside the branch then the %% tag is necessary and the Evaluate Labels should be set to true

1 Like