Inject parameters

NSM service designers use the <injectParameter> element and the <name>, <description>, <methodCall>, <arguments>, and <code> tags to define inject parameters in the XML NSM service template when designing NSM service templates. Inject parameters are populated by evaluating the results of executing functions.

There are two types of functions that can be used: predefined NSM functions and user defined JavaScript functions. Inject parameters are evaluated when the service is executed.

The following sample XML shows the structure of an <injectParameter> element and parameter tags.

<injectParameters>
	<injectParameter>
		<name>IP01</name>
		<description>inject parameter 01 description</description>
		<methodCall>concat</methodCall>
		<arguments>clientParameter1,clientParameter2</arguments>
		<code></code>
	</injectParameter>
</injectParameters>

Table 1. Inject parameter element and tag details
Element/Tag Type Description
<injectParameters> Containing list Contains a list of one or more <injectParameter> elements.
<injectParameter> Container Contains the inject parameter details. Each inject parameter is encapsulated within a <injectParameter> </injectParameter> element pair.
<name> String Specifies the name of the inject parameter. In the example, the name of the inject parameter is IP01.
<description> String Specifies the description of the inject parameter. In the example, the description of the inject parameter is inject parameter 01 description.
<methodCall> String

Specifies the name of the function (NSM predefined function or JavaScript function) that is called. This tag must be populated for predefined NSM functions and JavaScript functions.

In the example, the function is a predefined NSM function called concat.

<arguments> Comma-separated string

Specifies a comma delimited list of parameters that are passed into the function (NSM predefined function or JavaScript function). The <arguments> tag must be populated for predefined NSM functions. The <arguments> tag is populated for JavaScript functions only if the JavaScript function requires one or more parameters.

The client parameters were defined previously in the NSM service template using the <clientParameter> element.

In the example, the names of the arguments passed into the NSM function called concat are clientParameter1,clientParameter2. The two values are supplied by the <clientParameter> elements that were defined previously in the NSM service template.

<code> JavaScript

Specifies user-defined JavaScript code.

Note: The <code> tag is ignored for predefined NSM functions.