CloudStreams 10.15 | webMethods CloudStreams Documentation | Administering webMethods CloudStreams | Cloud Connections, Services, and Connector Listeners | REST Parameters | Parameter Formatters for REST Connector Services | Implementing a Custom Parameter Formatter
 
Implementing a Custom Parameter Formatter
In cases where the default parameter formatter is not sufficient to achieve the desired parameter behavior, you can write a custom implementation for the parameter formatter.
Implement a custom formatter as follows:
1. Write an IS service implementation, adhering to the bundled IS specification wm.cloudstreams.service.common.lookup.specs:formatterSpec.
2. The fully-qualified service namespace should be referred with the formatter service attribute under the parameter definition. Ensure that the formatter type attribute is set to "paramFormatter".
3. Optionally, any service arguments can be specified within the formatter element definition.
Example
Consider a custom service implementation:
my.custom.formatter:sample
The parameter definition for a resource using the above, within the Connector Descriptor, would look like this:
<parameter name="SampleParam" dataType="Record"
documentRef="my.custom.document:sample" style="QUERYSTRING_PARAM">
<formatter service = "my.custom.formatter:sample" type = "paramFormatter">
<arg name="separator" value=";" />
</formatter>
</parameter>