<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: WFA - Checking DNS before launching a Datastore creation Workflow in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113727#M20177</link>
    <description>&lt;P&gt;Hi Sinhaa,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In fact I want to keep the MVEL function because it also allows me to find the appropriate IP to set on the LIF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you said, thanks MVEL code, the workflow is aborted before creating anything (volume, etc ...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to have an uderstandable message when the workflow is failing. So the command before the volume creation is perfect for me.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Dec 2015 10:34:14 GMT</pubDate>
    <dc:creator>POLICARD</dc:creator>
    <dc:date>2015-12-15T10:34:14Z</dc:date>
    <item>
      <title>WFA - Checking DNS before launching a Datastore creation Workflow</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113667#M20165</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a workflow for creating a NFS Datastore and mounting it automatically in Vcenter.&lt;BR /&gt;&lt;BR /&gt;A FQDN name is used for mounting the datastore. I want to test it before creating anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have created a MVEL function:&lt;/P&gt;&lt;PRE&gt;function ResolveDns(fqdn)
{
import java.net.*;
throws UnknownHostException
InetAddress add = InetAddress.getByName(fqdn);
 
String ipaddress = add.getHostAddress();
return ipaddress;
}&lt;/PRE&gt;&lt;P&gt;This function is working as expected because the workflow fails if the DNS entry doesn't exist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But The error message is very ugly:&lt;/P&gt;&lt;PRE&gt;[Error: failed to access property: ResolveDns('e11dcdot1.pharma.aventis.com'): [Error: InetAddress.getByName(fqdn): e11dcdot1.pharma.aventis.com]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]]
[Near : {... e11dcdot1.pharma.aventis.com' ....}]
^
[Line: 1, Column: 0]&lt;/PRE&gt;&lt;P&gt;How to manage with exception and having a friendly message instead of this ?&lt;BR /&gt;&lt;BR /&gt;I tried some try / catch, but I have a compilation error:&lt;/P&gt;&lt;P&gt;The faulty code:&lt;/P&gt;&lt;PRE&gt;function ResolveDns(fqdn)
{
throws  UnknownHostException
import java.net.*;
try {
	InetAddress add = InetAddress.getByName(fqdn);
}
catch(UnknownHostException e) {
	System.err.println("Cannot find host");
	System.exit(1);
	}

String ipaddress = add.getHostAddress();
return ipaddress;
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result:&lt;/P&gt;&lt;PRE&gt;Illegal expression: Failed to compile function definition by MVEL:function ResolveDns(fqdn)
{
throws  UnknownHostException
import java.net.*;
try {
InetAddress add = InetAddress.getByName(fqdn);
}
catch(UnknownHostException e) {
System.err.println("Cannot find host");
System.exit(1);...&lt;/PRE&gt;&lt;P&gt;Do you have any idea ... ? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks by advance&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 22:31:28 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113667#M20165</guid>
      <dc:creator>POLICARD</dc:creator>
      <dc:date>2025-06-04T22:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - Checking DNS before launching a Datastore creation Workflow</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113696#M20169</link>
      <description>&lt;P&gt;Why use MVEL function?, you can integrate directly&amp;nbsp;catch in commands. Perhaps more simple for managing exceptions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An example in PS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[Net.DNS]::GetHostEntry("hosttotest")&lt;BR /&gt;}&lt;BR /&gt;catch&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; throw "Host not found"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;François&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 20:28:09 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113696#M20169</guid>
      <dc:creator>francoisbnc</dc:creator>
      <dc:date>2015-12-14T20:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - Checking DNS before launching a Datastore creation Workflow</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113715#M20171</link>
      <description>&lt;P&gt;Hi François,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If even it was possible ... I love Powershell and I am discovering MVEL (due to WFA).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is the message I have if I test any Powershell code in a WFA function :&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.netapp.com/t5/image/serverpage/image-id/4455i0856B0DB0AF04282/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="wfa powershell error.png" title="wfa powershell error.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 08:46:42 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113715#M20171</guid>
      <dc:creator>POLICARD</dc:creator>
      <dc:date>2015-12-15T08:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - Checking DNS before launching a Datastore creation Workflow</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113719#M20172</link>
      <description>&lt;P&gt;You cannot use powershell in function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just create a command like below you can integrate in workflow you want. It throw Host not found if host is not in dns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;param (&lt;BR /&gt;[parameter(Mandatory=$true, HelpMessage="Host to verify")]&lt;BR /&gt;[string]$host&lt;/P&gt;&lt;P&gt;)&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;[Net.DNS]::GetHostEntry($host)&lt;BR /&gt;}&lt;BR /&gt;catch&lt;BR /&gt;{&lt;BR /&gt;throw "Host not found"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.netapp.com/t5/image/serverpage/image-id/4458iC4A497A84EC8919D/image-size/medium?v=mpbl-1&amp;amp;px=-1" border="0" alt="2015-12-15_10-05-20.png" title="2015-12-15_10-05-20.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;François&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 09:09:45 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113719#M20172</guid>
      <dc:creator>francoisbnc</dc:creator>
      <dc:date>2015-12-15T09:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - Checking DNS before launching a Datastore creation Workflow</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113725#M20175</link>
      <description>&lt;P&gt;There are advantage of having MVEL functions over doing it in a Command Code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;A workflow *preview* can do this function validation for me. A code in comamnd can't make this check until execution starts which may be too late. Big advantage.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;I can use it in building expressions for Workflow User-Inputs etc.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;But the disadvantage is MVEL being an expression language, you can't use complex programming constructs in its function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is NO try-catch in MVEL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to do what you want to do?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm thinking but right now I don't know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sinhaa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 10:17:20 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113725#M20175</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2015-12-15T10:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - Checking DNS before launching a Datastore creation Workflow</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113726#M20176</link>
      <description>&lt;P&gt;Hi Francois&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am using a name generated automatically. I was convinced I cannot use a variable in a&amp;nbsp;step prior to the volume creation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have checked and it's working fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 10:25:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113726#M20176</guid>
      <dc:creator>POLICARD</dc:creator>
      <dc:date>2015-12-15T10:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - Checking DNS before launching a Datastore creation Workflow</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113727#M20177</link>
      <description>&lt;P&gt;Hi Sinhaa,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In fact I want to keep the MVEL function because it also allows me to find the appropriate IP to set on the LIF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you said, thanks MVEL code, the workflow is aborted before creating anything (volume, etc ...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to have an uderstandable message when the workflow is failing. So the command before the volume creation is perfect for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 10:34:14 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113727#M20177</guid>
      <dc:creator>POLICARD</dc:creator>
      <dc:date>2015-12-15T10:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: WFA - Checking DNS before launching a Datastore creation Workflow</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113744#M20184</link>
      <description>&lt;P&gt;At the end I have to remove the command that cannot really check the DNS entry and I keep the MVEL function with the ugly message...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The most important is the workflow is not running if the DNS entry doesn't exist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope a future version of WFA will allow to create a specific&amp;nbsp;error output depending on MVEL behavior... Or a way for adding some command for checking only with powershell code runable before the real execution (and only for checking).&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 15:37:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/WFA-Checking-DNS-before-launching-a-Datastore-creation-Workflow/m-p/113744#M20184</guid>
      <dc:creator>POLICARD</dc:creator>
      <dc:date>2015-12-15T15:37:58Z</dc:date>
    </item>
  </channel>
</rss>

