IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > Adapter Toolkit > Implementing code from the IBM WebSphere Adapter Toolkit > Enterprise metadata discovery general interfaces and implementation for application adapters > Enterprise metadata discovery implementation samples

WBIMetadataSelectionImpl samples

WBIMetadataSelectionImpl represents the object that holds the MetadataObjects that users can select for importing. This class also holds properties that users specify to select from the set of available MetadataObjects.

Extend WBIMetadataSelectionImpl and implement the following methods described below.


createSelectionProperties

The createSelectionProperties() method returns a property group used to capture inputs from users. These inputs include business object namespace, supported operations, and the relative path in the module project where XML schema definitions should be saved.

			public PropertyGroup createSelectionProperties() {
		
		WBIPropertyGroupImpl pg = null;
		try {
			pg = new WBIPropertyGroupImpl("Selection Properties");
			pg.setDisplayName("SelectionProperties"); 
			pg.setDescription("SelectionProperties"); 
			
			MetadataConfigurationType[] types = WBIMetadataDiscoveryImpl.
getMetadataConfiguration();

for(int i=0;i	types.length;i++){
				if (types[i].equals(MetadataConfigurationType.GENERIC_RECORDS) ||
 types[i].equals(MetadataConfigurationType.GENERATED_RECORDS)
						|| types[i].equals	(MetadataConfigurationType.GENERATED_DATA_BINDING) ||
 types[i].equals(MetadataConfigurationType.GENERIC_DATA_BINDING)) {
					artifactType = types[i].toString();
				} 				if(types[i].equals(MetadataConfigurationType.INBOUND_SERVICE) ||
 types[i].equals(MetadataConfigurationType.OUTBOUND_SERVICE)){
					serviceType = types[i].toString();
				} 			} 			WBIMultiValuedPropertyImpl operationProp = new WBIMultiValuedPropertyImpl
("Operations", String.class); 
			operationProp.setDisplayName("Operations"); 
			operationProp.setDescription("Operations");  
			operationProp.setRequired(true);
			String[] operations=null;
			if(serviceType.equals(MetadataConfigurationType.INBOUND_SERVICE.toString())){
				operations = new String[3];
				operations[0] ="Create";
				operations[1] ="Update";
				operations[2] ="Delete"; 
			}else{
				if(artifactType.equals(MetadataConfigurationType.GENERATED_DATA_BINDING.toString
())){// is WPS
					operations = operationsWPS;
				}else{
					operations = operationsNonWPS;
				}			
			} 			operationProp.setValidValues(operations);
			for(int idx=0;idxoperationProp.addValue(operations[idx]);
			} 			pg.addProperty(operationProp);

			//Copy the applied properties to the new instance 			if (getAppliedSelectionProperties() != null)
				EMDUtil.copyValues(getAppliedSelectionProperties(), pg);
		
		} catch (MetadataException e) {
			throw new RuntimeException(e.getMessage());
		} 		return pg;
	}

Enterprise metadata discovery implementation samples