SeanKohler
Expert
Expert

OGNL IF Statement

Jump to solution

Please share if you have figured out how (if possible) to use a conditional statement before a GetAction runs.

For example... this works fine.

adUserSearch.jpg

But if I want to only call the action if the searchTerm length is 5 characters, I cannot figure out a proper syntax to make that happen.  (Tried lots of ways... just not the right way--if one exists.)

adUserSearch2.jpg

1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee

statement ? true : false

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

0 Kudos
4 Replies
cdecanini_
VMware Employee
VMware Employee

statement ? true : false

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

0 Kudos
SeanKohler
Expert
Expert

Thanks Christophe.

I am missing something still.  It isn't working.

(#searchTerm.length > 5) ? GetAction("org.zzzzz.ActiveDirectory","getAdUserStringArrayByAdHost").call( #searchTerm , #adHost) : null

0 Kudos
SeanKohler
Expert
Expert

Looks like I cannot get length this way...

#searchTerm.length

0 Kudos
SeanKohler
Expert
Expert

#searchTerm.length()>5?GetAction("org.zzzzz.ActiveDirectory","getAdUserStringArrayByAdHost").call( #searchTerm , #adHost) : null

Just one of those mornings I guess. I got it worked out.  Thanks for the assist!