Each job must be assigned a unique name to identify it. Details of the progress and results of the job can be retrieved using this unique name. Note that
job names cannot contain any of the following characters: \ / : ? " * < > |
The following code sample illustrates how to submit an uploaded file for cleansing and wait for it to finish.
/// <summary>
/// Submits a file to Data8 for cleansing.
/// </summary>
/// <param name="uploadId">The identifier of the uploaded file returned from the Upload Manager.</param>
/// <returns>The name of the completed data cleansing job.</returns>
private string CleanseData(int uploadId)
{
// Create a unique name for the job.
string name = String.Format("Data Cleansing Job {0:yyyyMMdd}.{1:N}", DateTime.Now, new Guid());
// Start the data cleansing job.
JobManager proxy = new JobManager();
proxy.SubmitJob(Username, Password, name, FILE_FORMAT_NAME, WORKFLOW_NAME, uploadId);
// Wait for the process to finish.
while (true)
{
Thread.Sleep(TimeSpan.FromSeconds(10));
JobStatus status = proxy.GetJobDetails(Username, Password, name);
if (status.Completed != null)
break;
}
return name;
}