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 | Adapter Check Value Callbacks
 
Adapter Check Value Callbacks
When using both fixed resource domains and dynamic resource domains, you may allow adapter users to enter their own parameter values, allowing them to add to the current list of values for the resource domain. To enable the adapter to validate these values, you use callbacks known as adapter check values. Adapter check values are resource domain mechanisms that function very much like resource domain lookups. Any value in a parameter that is not part of the parameter's resource domain list may be validated by an adapter check value. For more information, see Registering Resource Domains.
Adapter check values can also validate resource domain lookups for each unique value that is not part of a resource domain list that is complete (that is, a list that does not accept adapter user-supplied values). For example, suppose the sequence parameter named colors contains the values "White", "Gray", "Black", and "Red". After a resource domain lookup, the resource domain list contains "Black" and "Gray". Assuming that the resource domain is configured appropriately, the Adapter Service Editor performs an adapter check value callback for "Red" and "White". If it finds either value, it deletes the cell containing that value (or overwrites it, if the sequence is in a field map).
To use an adapter check value callback, you must:
*Set the following methods of the ResourceDomainValues class as follows:
*setComplete(false), which indicates that adapter users can enter their own parameter values; it sets a flag named complete
*setCanValidate(true), which indicates that the adapterCheckValue method will validate user-supplied parameter values; it sets the canValidate flag
If both of these flags are set properly, the Adapter Service Editor calls the following method for each value that is not already in the resource domain:
Boolean adapterCheckValue(String serviceName,
String resourceDomainName,
String[][] values,
String testValue)
The first three arguments are identical to those for adapterResourceDomainLookup (shown in Resource Domain Lookups). The testValue argument contains the value being checked.
*Register the adapter check value callback at the same time you register the resource domain name, using the WmAdapterAccess.addCheckValue method (see Registering Resource Domains).