Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Listener Notifications | Listener Notification Implementation | Specifying Metadata | The useParam Argument of setResourceDomain
 
The useParam Argument of setResourceDomain
The WmTemplateDescriptor interface provides two signatures for the setResourceDomain method, one of which includes the argument useParam:
public void setResourceDomain(java.lang.String name,
java.lang.String resourceDomainName,
java.lang.String[] dependencies,
java.lang.String useParam)
You use this argument as a filter to determine which of the available fields will be included in the signature. The example in this section implements the useParam argument as USES_PARM, in the setResourceDomain method near the end of the example.
This parameter is only meaningful when the parameter identified in the name argument and the parameter names in useParam are in the same fieldMap, and the data type of the useParam parameter is boolean[]. When these conditions are satisfied, the Adapter Service Editor will treat the useParam setting as a filter on the resource domain association. When this occurs, the resource domain values will only be applied to the name parameter row in the fieldMap if the corresponding value in the useParam is true (that is, when the adapter user selects the check box).
When the adapter user selects the fields to use for the notification (by selecting the check boxes in the Uses column), values appear in the Signature column. When you save changes to the notification node, the signature changes are reflected in the associated document type.
public static final String FIELD_NAMES_PARM = "fieldNames";
public static final String FIELD_TYPES_PARM = "fieldTypes";
public static final String USES_PARM = "uses";
public static final String SIG_PARM = "signature";
public static final String NOTIFICATION_SETUP_GROUP =
"SessionLogListenerNotification.setup";
public static final String FIELD_NAMES_RD =
"SessionLogListenerNotification.fieldNames.rd";
public static final String FIELD_TYPES_RD =
"SessionLogListenerNotification.fieldTypes.rd";
private String[] _fieldNames = null;
private String[] _fieldTypes = null;
private boolean[] _uses = null;
public void setFieldNames(String[] val){_fieldNames = val;}
public void setFieldTypes(String[] val){_fieldTypes = val;}
public void setUses (boolean[] val){_uses = val;}
public void setSignature(String[] val){}
public void fillWmTemplateDescriptor(WmTemplateDescriptor descriptor,Locale l)
throws ResourceException
{
String[] parms = new String[] {FIELD_NAMES_PARM,
FIELD_TYPES_PARM,
USES_PARM,
SIG_PARM};
descriptor.createGroup(NOTIFICATION_SETUP_GROUP,parms);
descriptor.createFieldMap(parms,false);

descriptor.createTuple(new String[]{FIELD_NAMES_PARM,
FIELD_TYPES_PARM});
descriptor.setResourceDomain(FIELD_NAMES_PARM,FIELD_NAMES_RD,null);
descriptor.setResourceDomain(FIELD_TYPES_PARM,FIELD_TYPES_RD,null);
descriptor.setResourceDomain(SIG_PARM,
WmTemplateDescriptor.OUTPUT_FIELD_NAMES,
new String[]{FIELD_NAMES_PARM,FIELD_TYPES_PARM}, USES_PARM);
descriptor.setDescriptions(
MyAdapter.getInstance().getAdapterResourceBundleManager(),l);
}