Resource Domain Lookups
A dynamic resource domain uses resource domain lookups. That is, it uses addResourceDomainLookup to enable the adapter to look up parameter values in the adapter resource.
When adapter users create an adapter service node, they select a connection in which the adapter service executes. That connection also provides data from the resource domain that you registered with the connection.
When a node is created, the Adapter Service Editor initiates a resource domain lookup to the connection class for each of the adapter's metadata parameters that are associated with dynamic resource domains. Additional lookups are made as the adapter user modifies the values of parameters upon which other parameters depend (see
Associating Metadata Parameters with
Resource Domains).
All resource domain lookups invoke the same method in the WmManagedConnection implementation class:
ResourceDomainValues[] adapterResourceDomainLookup(String serviceName,
String resourceDomainName,
String[][] values)
where:
Argument | Description |
serviceName | Always contains the class name of the adapter service. |
resourceDomainName | Contains the registered name of the resource domain. |
values | |
For example, consider the following call:
d.setResourceDomain( "columnsArg", "columnsLookup", new String[] {"tablesArg"});
This call creates a dependency on tablesArg (see
Associating Metadata Parameters with
Resource Domains). When the lookup for the columnsLookup resource domain is made, the values argument will contain the current settings for the tablesArg parameter. Data in the values argument is organized such that the first dimension of the array determines the dependent parameter, and the second dimension iterates the data in the parameter. Thus, values[0][0] contains the value of the first dependent parameter. If it is a sequence parameter, then values[0][1] would contain the next value in the sequence, values[0][2] the next, and so on. If there were more than one dependency, the contents of the second parameter on which the lookup depends would be contained in values[1][].
Note:
Placing a sequence parameter in a field map has several effects on the resource domain lookup process (see
Tuples).
The signature of adapterResourceDomainLookup indicates that an array of ResourceDomainValues objects should be returned. Unless your implementation includes tuples, there should be exactly one object in the response array, and the name attribute of that ResourceDomainValues object should always be the same as the resourceDomainName argument passed into the method.
When the Adapter Service Editor receives the lookup response data, it is evaluated against any data in the "current" parameter (the parameter for which the lookup was performed). An entry in the current parameter is considered valid if any one of the following is true:
The parameter value matches a value in the ResourceDomainValues list
ResourceDomainValues.setComplete(false) and ResourceDomainValues.setCanValidate(false)
ResourceDomainValues.setComplete(false) and ResourceDomainValues.setCanValidate(true) and the value was successfully validated through the AdapterCheckValue facility
If the current parameter settings are considered valid, then the parameter values remain unchanged. However, any current parameter values are merged with the values in the lookup response when the parameter's drop-down list is opened. (This effectively extends the resource domain to include values that were entered by the user.) If the current parameter settings are not considered valid, then the invalid value will be deleted by a value in the resource domain.