- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- Re: Assistance with If/Else Conditional Workflow
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 05:22 AM
08-23-2024 05:22 AM
Hello!
I’m poking at the If/Else Conditional Workflow type task but I keep hitting an error around:
Cannot convert null value ‘undefined’(language: JavaScript, type: undefined) to Java type ‘boolean’ using Value.asBoolean(). You can ensure that the operation is supported using Value.isBoolean().
No matter what I try. I’m sure I’m missing something simple.
I have a task with a really simple Powershell array that gets converted to JSON and ‘write-output’:
$RESULTSOUTPUT = @{}
$RESULTSOUTPUT.add("Unzipping Results", "Success")
$RESULTSOUTPUT.add("MECM Innstallation", "Success")
$RESULTSOUTPUT.add("Success", "True")
Write-Output($RESULTSOUTPUT | ConvertTo-Json)
Exit 0
This is set to be registered to Code “MECMsuccess” with Result Type JSON
I then have a debug task that just does write-output(“<%=results.MECMsuccess.Success%>”)
and that spits out True as expected
The next step is the If/Else Conditional Workflow task, which I setup with information from Looking guidances for triggering multiple automation tasks based on user inputs Yes/No in service catalog - #2 by Tyler_Boyd as my example:
if (results.MECMsuccess.Success == “true”) {
true;
} else if (results.MECMsuccess.Success == “false”) {
false;
}
(I also tried using three ==='s as the text block has two but if you click to expand the screenshot you can see there are three there).
The results I get no matter what are:
Error Executing Conditional Workflow Task _Catalog - MECM Email Logic - Cannot convert null value 'undefined'(language: JavaScript, type: undefined) to Java type 'boolean' using Value.asBoolean(). You can ensure that the operation is supported using Value.isBoolean().
This holds true even if I adjust things to just be a Single value result or a Key/Value. I’m not sure what in the Boolean is going on.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 06:57 AM
08-26-2024 06:57 AM
Re: Assistance with If/Else Conditional Workflow
@Tyler_Boyd @cbunge Thank you for the replies and information.
I did rebuild just a really simple workflow using the Conditional and it worked there, so I must have something boogered up in my original attempt I’ll have to flush out.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 06:40 AM
09-04-2024 06:40 AM
Re: Assistance with If/Else Conditional Workflow
I need few more input on passing the values in JS.
results.MECMsuccess.Success here MECMsuccess is the taskcode?
if yes, I am using the same but getting the below error. It will be great if we have some small examples and recoding’s.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 05:50 AM
08-23-2024 05:50 AM
Re: Assistance with If/Else Conditional Workflow
Tyler,
If it’s because I didn’t catch the capitalization of the “True” and not having a general else instead of else if… haha.
I’ll test that here and post back. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 05:56 AM
08-23-2024 05:56 AM
Re: Assistance with If/Else Conditional Workflow
I updated my old post to reflect.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 06:30 AM
08-23-2024 06:30 AM
Re: Assistance with If/Else Conditional Workflow
Interesting, I’m not seeing the same thing.
What version of Morpheus are you on? The same logic is working for me in 7.0.5.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 08:20 AM
08-23-2024 08:20 AM
Re: Assistance with If/Else Conditional Workflow
We’re on version 7.0.4
Being my first time playing around with this stuff, it couldn’t just be something I have screwed up or am doing wrong and that wouldn’t surprise me
I’m updating this test instance to 7.0.5 and will give it another go after that completes. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 06:02 AM
08-23-2024 06:02 AM
Re: Assistance with If/Else Conditional Workflow
Sorry to be a pain, but I think it almost worked.
If you look, that seems to have triggered the “Email on MECM Installation success” task, but the logic in the If/Else is
It seems the false didn’t run the fail workflow and associated task but still ran the true/success workflow and task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 05:35 AM
08-23-2024 05:35 AM
Re: Assistance with If/Else Conditional Workflow
Can you try
if (results.MECMsuccess.Success == "True") {
return true;
} else if (results.MECMsuccess.Success == "False") {
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 04:33 AM
08-26-2024 04:33 AM
Re: Assistance with If/Else Conditional Workflow
I utilized the conditionals within this package for the approvals check:
Package
Repository

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 06:12 AM
09-10-2024 06:12 AM
Re: Assistance with If/Else Conditional Workflow
@ibrahim
In my case, yup the MECMsuccess was the task code output variable from my test script. Not sure on your error as that seems to maybe indicate the wrong type of task vs what’s allowed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2024 12:41 PM
08-24-2024 12:41 PM
Re: Assistance with If/Else Conditional Workflow
If it continues to be an issue you may want to look at putting in a ticket in case you are hitting a bug.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 09:30 AM
08-23-2024 09:30 AM
Re: Assistance with If/Else Conditional Workflow
I’m hitting the same in 7.0.5 where both success and fail seem to kick off the “Success” email workflow and not the “Failure” email workflow.
I might create another variant from scratch and see if that works and why typo or something I may have in the original.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 05:54 AM
08-23-2024 05:54 AM
Re: Assistance with If/Else Conditional Workflow
Tyler,
That did it! It looks like the missing ‘return’ is what was throwing things off as the error went away and the task worked successfully on adding the “Return”
Thanks!
– Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 05:42 AM