It's all about the answers!

Ask a question

How to test multiple conditions on a conditional step?


Igor Lemes (111812) | asked Jul 26 '12, 11:09 a.m.
I have a step that i want to run on a very specific scenario. For that, I'd need to test 3 environment variables. 
$var1=value1
$var2=value2
$var3=value3

I'm trying to avoid chaining 3 projects.

I've read this article:( http://www-01.ibm.com/support/docview.wss?uid=swg21410161 ) but it's not clear if i can run these commands on the inside the Condition or the Command Box.

So I figured I'd ask you guys whats the best practice for this kind of situation.
The Build Forge versionis 7.1.3.2
Thanks!

2 answers



permanent link
Robert haig (1.0k16) | answered Jul 28 '12, 1:27 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
 use multiple conditional steps to do a multi-stage evaluation of your complex conditional.  In each conditional step, .bset a variable to a value you'll test later.  

permanent link
Bruce Albrecht (6624) | answered Jul 30 '12, 1:21 p.m.
If you can run a step on  Unix, you could create a step like
.bset env "CONDITION=`if [ "$var1" = "value1" -a "$var2" = "value2" -a "$var3"="value3" ]; then echo true; else echo false;fi`"
and then make the step you only want to run in that situation conditional on $CONDITION containing true.

There's probably a simple way to do this with Windows as well, but I try to avoid scripting on Windows.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.