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

Progress monitor sample

For enterprise metadata discovery processes that are time-consuming–such as retrieving information from an EIS and building MetadataObject instances–you can use the progress monitor.

While you are running the discovery service, the progress monitor can capture information about current processes and allow you to cancel operations. You can locate a handle to ProgressMonitor using the following: WBIMetadataDiscovery.getLogUtils().getProgressMonitor(). As a process elapses, you can use the setProgress() method to set progress levels that approach a specified maximum as shown below:

WBIMetadataConnectionImpl.getToolContext().getProgressMonitor().setMaximum(100);
WBIMetadataConnectionImpl.getToolContext().getProgressMonitor().setMinimum(0);
WBIMetadataConnectionImpl.getToolContext().getProgressMonitor().setProgress(50);
WBIMetadataConnectionImpl.getToolContext().getProgressMonitor().setIf 
                                 ("Getting namespace from Peoplesoft");

Enterprise metadata discovery implementation samples