<?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 Having trouble calling a Function from a Command in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Having-trouble-calling-a-Function-from-a-Command/m-p/30438#M6270</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to update a Command and some of the information that it needs to function needs to be pulled from a couple of Functions. The Command and one of the Functions are custom items written by NetApp PS, and the other Function is a custom function that I wrote. While I cannot include the source here due to company policy, I can provide code fragments that might help you to diagnose the issue. The error message that I receive is &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;“The term 'nextRuleClientMatch' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.”. A fragment of the Command code looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $message += @"&lt;BR /&gt;*) Add new netgroups to netgroup file&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +) $(nextRuleClientMatch(2,$($splitText[1]),$($splitText[2]),$($splitText[6])))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +) $(nextRuleClientMatch(3,$($splitText[1]),$($splitText[2]),$($splitText[6])))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +) $(nextRuleClientMatch(4,$($splitText[1]),$($splitText[2]),$($splitText[6])))&lt;BR /&gt;*)&amp;nbsp;&amp;nbsp;&amp;nbsp; Make sure netgroups are not empty, this can break all NFS access. If there are no servers, add ADMIN_PROD&lt;BR /&gt;"@&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the error message, I should be able to call Functions from a Command. I have not been able to locate any documentation on coding in WFA, so all I can do it assume and base new code code on existing examples. If there is any decent documentation on coding in WFA, please point me to it. I'd be &lt;SPAN style="text-decoration: underline;"&gt;so&lt;/SPAN&gt; happy to read it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update: I am using WFA 2.1, looking forward to 2.2GA!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Scott L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 05:37:33 GMT</pubDate>
    <dc:creator>SCOTT_LINDLEY</dc:creator>
    <dc:date>2025-06-05T05:37:33Z</dc:date>
    <item>
      <title>Having trouble calling a Function from a Command</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Having-trouble-calling-a-Function-from-a-Command/m-p/30438#M6270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to update a Command and some of the information that it needs to function needs to be pulled from a couple of Functions. The Command and one of the Functions are custom items written by NetApp PS, and the other Function is a custom function that I wrote. While I cannot include the source here due to company policy, I can provide code fragments that might help you to diagnose the issue. The error message that I receive is &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;“The term 'nextRuleClientMatch' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.”. A fragment of the Command code looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $message += @"&lt;BR /&gt;*) Add new netgroups to netgroup file&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +) $(nextRuleClientMatch(2,$($splitText[1]),$($splitText[2]),$($splitText[6])))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +) $(nextRuleClientMatch(3,$($splitText[1]),$($splitText[2]),$($splitText[6])))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; +) $(nextRuleClientMatch(4,$($splitText[1]),$($splitText[2]),$($splitText[6])))&lt;BR /&gt;*)&amp;nbsp;&amp;nbsp;&amp;nbsp; Make sure netgroups are not empty, this can break all NFS access. If there are no servers, add ADMIN_PROD&lt;BR /&gt;"@&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the error message, I should be able to call Functions from a Command. I have not been able to locate any documentation on coding in WFA, so all I can do it assume and base new code code on existing examples. If there is any decent documentation on coding in WFA, please point me to it. I'd be &lt;SPAN style="text-decoration: underline;"&gt;so&lt;/SPAN&gt; happy to read it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update: I am using WFA 2.1, looking forward to 2.2GA!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Scott L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:37:33 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Having-trouble-calling-a-Function-from-a-Command/m-p/30438#M6270</guid>
      <dc:creator>SCOTT_LINDLEY</dc:creator>
      <dc:date>2025-06-05T05:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble calling a Function from a Command</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Having-trouble-calling-a-Function-from-a-Command/m-p/30445#M6271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scott,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #454545; font-family: Calibri, sans-serif; font-size: 14.545454025268555px; background-color: #ffffff;"&gt;“The term 'nextRuleClientMatch' is not recognized as the name of a cmdlet, &lt;SPAN style="color: #ff0000;"&gt;function&lt;/SPAN&gt;, script file, or operable program."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #454545; font-family: Calibri, sans-serif; font-size: 14.545454025268555px; background-color: #ffffff;"&gt;The above Error is thrown by Powershell and the word function above is in context of a &lt;SPAN style="color: #003300;"&gt;Powershell&lt;/SPAN&gt; function and NOT WFA function(s). The WFA fuctions are in MVEL ( and not powershell) and can't be used inside a command Code. WFA commands are essentially a Powershell script and can't access WFA MVEL fuctions inside the code. MVEL expressions, functions can be used in a workflow at parameter value for the commands its having.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #454545; font-family: Calibri, sans-serif; font-size: 14.545454025268555px; background-color: #ffffff;"&gt;To elaborate, I'll take an example.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #454545; font-family: Calibri, sans-serif; font-size: 14.545454025268555px; background-color: #ffffff;"&gt;I have a function named return_value which just returns the passed value:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=======&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;def return_string(value) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return value; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=======&lt;/P&gt;&lt;P&gt;I have command which take message as a parameter:&lt;/P&gt;&lt;P&gt;==========&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;param (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;&amp;nbsp; [parameter(Mandatory=$true, HelpMessage="Message to print")]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;&amp;nbsp; [string]$Message&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;Get-WFALogger -Info -message "Message is : $Message"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;===========&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to print the message &lt;STRONG&gt;"Hello World!"&lt;/STRONG&gt;. Now if I want to call the function to set the value of the Parameter Message, I can't call this MVEL function in the cmd code. To do this, I've to put the command in a workflow in details I can set the parameter like :&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;return_value("Hello ")+return_value("World!") &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the image here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So to solve your problem of using function to set the message, Declare the message as a Parameter of the command and then in the workflow, you can call the function at the workflow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #454545; font-family: Calibri, sans-serif; font-size: 14.545454025268555px; background-color: #ffffff;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 03:37:40 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Having-trouble-calling-a-Function-from-a-Command/m-p/30445#M6271</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2014-04-24T03:37:40Z</dc:date>
    </item>
  </channel>
</rss>

