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

WBIOutboundServiceDescriptionImpl samples

WBIOutboundServiceDescriptionImpl represents the object that populates function descriptions for outbound service descriptions.

Implement the method shown in the section below.


setFunctionDescriptions

The setFunctionDescriptions() method populates the function descriptions based on objects and properties selected in MetadataSelection.

	public void setFunctionDescriptions(MetadataSelection selection)
throws MetadataException {
		
		ArrayList functionDescriptions = new ArrayList();
		MetadataImportConfiguration[] confArray = selection.getSelection();
		PropertyGroup selectionProps = 
		WBIMetadataSelectionImpl.getAppliedSelectionProperties();
		WBIMultiValuedPropertyImpl prop = (WBIMultiValuedPropertyImpl)
		selectionProps.getProperty("Operations"); 
		String[] values = prop.getValuesAsStrings();
		
		helper.getToolContext().getProgressMonitor()
		.setMaximum(confArray.length *
		values.length * 10);
		helper.getToolContext().getProgressMonitor().setMinimum(0);
		helper.getToolContext().getProgressMonitor().setIf 
		("Creating Service Description");
		
		for (int i = 0; i < confArray.length; i++) {
		WBIMetadataImportConfigurationImpl spec = 
		(WBIMetadataImportConfigurationImpl)
		confArray[i];
			WBIOutboundFunctionDescriptionImpl funcDesc;
			EISSAInteractionSpec iSpec;
			EISSAMetadataObject metadataObj = 
			(EISSAMetadataObject) spec.getMetadataObject();
			helper.getToolContext().getProgressMonitor().setIf 
			("Creating Service for "
		+ metadataObj.getDisplayName());
		
			this.setNameSpace(metadataObj.getTargetNameSpace());
			EISSADataDescription dataDesc = setupMetadataObject(spec,	
		 selection,   		getNameSpace());
			for (int j = 0; j < values.length; j++) {
				String operation = (String) values[j];
				
				if(operation.equalsIgnoreCase(WBIInteractionSpec.APPLY_CHANGES_OP) && 
			(!metadataObj.getBOName().endsWith("BG"))){
					continue;
				} 				helper.getToolContext().getProgressMonitor().setProgress(i + j * 10);
				funcDesc = new WBIOutboundFunctionDescriptionImpl();
				funcDesc.setName(operation.toLowerCase() + metadataObj.getBOName());
				funcDesc.setInputDataDescription(dataDesc);
				funcDesc.setOutputDataDescription(dataDesc);
				iSpec = new EISSAInteractionSpec();
				iSpec.setFunctionName(operation);
				funcDesc.setInteractionSpec(iSpec);
				funcDesc.setImportConfiguration(spec);
				functionDescriptions.add(funcDesc);
			} 		} 		
		FunctionDescription[] funcArray = new FunctionDescription
		[functionDescriptions.size()];
		functionDescriptions.toArray(funcArray);
		super.setFunctionDescriptions(funcArray);
		
		
	}

Enterprise metadata discovery implementation samples