I am trying to write a line of code in a variable but for some reason it is not executing and doesnot substitutes.
In the pipeline i have a variable called “processValidationResult”. I need to set different value in the variable “code” depending on the processValidationResult variable.
The line which i have written is as follows,
Setup your branch to switch on /processValidationResult
Set the labels of your conditional steps to the following
‘Success’ being one of you checks
$default being your else condtion.
Either usea sequence operator to process multiple steps based on your true/false conditions such as set your variable.
Dynamic Method
Setup Branch Operator to evaluate labels make sure you don’t populate the switch field.
in the labels of your condition child steps: put something like this for you first condition:
%processValidationResult% = ‘Success’
Your else could be either a default or something like 1=1 because only one condition will be executed just list this one last. You also might be able to just list $default there and get it to be your else condition.
A think the biggest concept here is to understand the Branch Step in detail using static comparisons as well as dynamic expression comparisons. Also realizing that you code blocks are effectively sequences in the Integrator.
So if you want to execute multiple steps based on a condition you need to put those steps within a sequence and execute the sequence based on your conditions.
Oh! thanx for the postings.
Well, i have already implemented the same. But then i thought of reducing the code size and was planning to implement in one line rather than using Branch.
thanx, i would then go ahead with my older version.
Well you could do it in an awk phase that is evaluated in your variables contents. However for what you are doing its overkill, and probably slower than just using the Branch which compiles to an If statement anyhow. So keep in mind there is not allot of overhead on many of these routines… The end up compiling to there lower counterparts anyhow.
Looks like something that was overlooked is that the sample line Sandip posted (%ifvar processValidationResult equals(‘Success’)%200%else%405%end%) is for dynamic server pages (DSP) not for FLOW steps.