Highlighted
Frequent Contributor.
Frequent Contributor.
1086 views

How to have if else operation in HP OO

Hi,

Is there any way to have if else operations in my HP OO flow?

For ex. 

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.

0 Likes
6 Replies
Highlighted
Super Contributor.
Super Contributor.

Hello, 

 

Sure, I think the operation /Base [1.12.7]/Library/Utility Operations/Deprecated/Decision Operation should work. 

 

Check the screenshots below: 

2019-01-11_8-50-00.png2019-01-11_8-50-15.png2019-01-11_8-50-25.png2019-01-11_8-50-32.png2019-01-11_8-51-59.png2019-01-11_8-52-09.png2019-01-11_8-52-21.png2019-01-11_8-52-27.png

Highlighted
Outstanding Contributor.
Outstanding Contributor.

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.

https://cloudslang-docs.readthedocs.io/en/latest/tutorial/12_lesson.html 

https://docs.microfocus.com/itom/Operations_Orchestration:2018.12/Use/use/Use_OO_Designer/Python_Operations

 

 

Andrei Vasile Truta
0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

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?

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

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

Highlighted
Micro Focus Expert
Micro Focus Expert

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:

https://community.softwaregrp.com/t5/Operations-Orchestration-Idea/Switchcase-Operation/idi-p/1663753

HTH,

Lucian

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Could you show one example for option b.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.