How to have if else operation in HP OO
Is there any way to have if else operations in my HP OO flow?
Let's say I've a flow variable having value.
Value = 100
Now based on the condition, I want to trigger specific operations
If value < 100, execute operation A
else if value > 100, execute operation B
else if value == 100, execute operation C
This way can we design decision branching in OO?
Thanks in advance.
Sure, I think the operation /Base [1.12.7]/Library/Utility Operations/Deprecated/Decision Operation should work.
Check the screenshots below:
On top of what Kevin was mentioning keep in mind that in OO Designer you can easily create python operations and make your own decision like operation. CloudSlang also supports creating so called decisions from scratch - you'll need to write the cloudslang decision in textual for the moment and commit it to git and import it in OO Designer. In the future we are planning to add the ability to create decisions directly from the OO Designer.
Thanks for the solution. But I could see that the operation is depricated. Will this cause any problem if I upgrade OO or Base content pack in future? Don't we have any operation which isn't depricated?
Other options in OO Studio (traditional AFL content, not CloudSlang):
a) operations like String Comparator, String Equals, Double Comparator, can be seen as 'if' with the two (or more) responses as 'then' and 'else'; and on the else add more 'if' operation
b) create a custom operation: use scriplet (or response rules); use as reference other operations based on Do Nothing (like Double Comparator and String Equals) . More complex to create the first one, but more compact and nicer result
What Ramon suggested below as option b) is what I saw most users doing.
In addition there is an open enhancement request to have a switch / case capability out of the box that you can vote at the URL below to be implemented: