Appendix > Installing the Remote API > To execute import and export operations
To execute import and export operations
After configuring the roundtrip configuration, you can execute an import or export operation. See the example below:
// Run an export
IRemoteExchangeConfiguration configuration = ...;
// the null means that no progress is reported
// the function will block until the export is finished
result = remoteClient.runExportDocuments(configuration,
"ReqIF 1.1", "Max Mustermann","A comment.", "_suffix", null, -1);
// check the result

// To get the available export formats
// Currently supported: "ReqIF 1.1", "Rif 1.1a"
String[] formats = remoteClient.getExportFormats();

// Run an export
IRemoteExchangeConfiguration configuration = ...;
// the null means that no progress is reported
// the function will block until the export is finished
result = remoteClient.runImportDocuments(configuration,
"Max Mustermann", "A comment.", null, -1);
// check the result


IRemoteProgressMonitor progressMontior = new IRemoteProgressMonitor() {

@Override
public boolean receiveProgress(String task, String taskName,
String subTask, double progress) {
// display the progress information
...
// return true to cancel the job, or false to keep running
return false;
};
// To run the import with progress information every second (parameter 1000 milliseconds)
remoteClient.runImportDocuments(configuration, "Max Mustermann",
"A comment.", progressMontior, 1000);
}
Was this helpful?