Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Adapter Services | The Metadata Model for Adapter Services | Resource Domains | Populating Resource Domains with Values
 
Populating Resource Domains with Values
To populate a fixed or dynamic resource domain with values, you implement the ResourceDomainValues class in your WmManagedConnection implementation.
This class is the primary container for controlling the behavior of adapter service parameters. It is used during the registration process when you register a fixed resource domain, and it is returned from the adapterResourceDomainLookup method in response to a dynamic callback (as described in Resource Domain Lookups).
A ResourceDomainValues object contains:
*The name of the resource domain.
*The current list of values for the resource domain.
This list can contain an array of either strings or ResourceDomainValue objects. This array constitutes the list of values that appears in the appropriate widgets in the Adapter Service Editor. The displayed values are communicated as strings, regardless of the data type of the parameter associated with the resource domain.
Note:
Using a values list that cannot be converted to the parameter's data type results in a run-time error. Null and empty strings are not accepted in numeric parameters.
*Methods that:
*Allow adapter users to supply values (set the setComplete method to false).
When using both fixed resource domains and dynamic resource domains, you may allow adapter users to enter their own values, allowing them to add to the current list of values for the resource domain. For more information, see Registering Resource Domains
*Enable the adapter check values to validate the adapter user-supplied values (set the setCanValidate method to true).
As mentioned previously, to validate adapter user-supplied values you use callbacks known as adapter check values. The values are validated by the adapterCheckValue method. For more information, see Adapter Check Value Callbacks.
*Disable parameters in the Adapter Service Editor, by setting the setDisabled method to true.
For example, assume that a parameter named portNumber has a data type of int. When constructing the associated resource domain values, limit the values list to numeric strings as follows:
new ResourceDomainValues("portNumberLookup", new String[]
{"6048","8088","9090"});
The example above shows a ResourceDomainValues object with a set list. You have the option to define a range of values, by providing a minimum/maximum value. In this case, a single ResourceDomainValues object is used to define the minimum and maximum values of a numeric parameter. The conditions for doing this are as follows:
*The parameter must be of a numeric data type (such as int or long).
*The parameter cannot be a sequence parameter (array).
*The ResourceDomainValues object must contain exactly one value that is constructed from a ResourceDomainValue object.
*ResourceDomainValues.setComplete must be false. You must set this method explicitly if you used the ResourceDomainValue[] constructor; otherwise, changes to the parameter will not be saved.
*The embedded ResourceDomainValue object must have a name representing a numeric value, and an endName representing a number value greater that the value of the name.
Note:
This is the only defined use for ResourceDomainValue.endName. In all other cases, only ResourceDomainValue.name is used. All other ResourceDomainValue attributes are placeholders, and are not currently implemented. Using a String[] to construct ResourceDomainValues is equivalent to using a ResourceDomainValue[] where only the ResourceDomainValue.name attributes are populated.