Show / Hide Table of Contents

Interface IImagingJobService

Represents the Imaging Job API service.

Namespace: Relativity.Testing.Framework.Api.Services
Assembly: Relativity.Testing.Framework.Api.dll
Syntax
public interface IImagingJobService
Examples
_imagingJobService = relativityFacade.Resolve<IImagingJobService>();

Methods

| Improve this Doc View Source

Cancel(Int32, Int64, ImagingJobRequest)

Attempt to cancel imaging job.

Declaration
ImagingJobActionResponse Cancel(int workspaceId, long imagingJobId, ImagingJobRequest cancelImagingJobRequest = null)
Parameters
Type Name Description
System.Int32 workspaceId

The Artifact ID of the workspace that contains the imaging job.

System.Int64 imagingJobId

The Imaging Job ID.

ImagingJobRequest cancelImagingJobRequest

The optional ImagingJobRequest which specifies parameters for cancellation.

Returns
Type Description
ImagingJobActionResponse

A ImagingJobActionResponse containing the information about attempt to cancel imaging job.

Examples
int workspaceId = 1015427;
long imagingJobId = 10;
var cancellationRequest = new ImagingJobRequest
{
	OriginationID = Guid.NewGuid()
};
ImagingJobActionResponse cancellationResult = _imagingJobService.Cancel(workspaceId, imagingJobId, cancellationRequest);
| Improve this Doc View Source

RetryErrors(Int32, Int32, ImagingSetJobRequest)

Retry imaging set errors.

Declaration
long RetryErrors(int workspaceId, int imagingSetId, ImagingSetJobRequest retryErrorsRequest = null)
Parameters
Type Name Description
System.Int32 workspaceId

The Artifact ID of the workspace that contains the imaging job.

System.Int32 imagingSetId

The Artifact ID of a imaging set.

ImagingSetJobRequest retryErrorsRequest

The optional ImagingSetJobRequest which specifies parameters for retry errors operation.

Returns
Type Description
System.Int64

The Artifact ID for the job.

Examples
int workspaceId = 1015427;
int imagingSetId = 1000;
var retryErrorsRequest = new ImagingSetJobRequest
{
	OriginationID = Guid.NewGuid(),
	QcEnabled = false
};
long imagingJobId = _imagingJobService.RetryErrors(workspaceId, imagingSetId, retryErrorsRequest);
| Improve this Doc View Source

Run(Int32, Int32, ImagingSetJobRequest)

Schedules an imaging job.

Declaration
long Run(int workspaceId, int imagingSetId, ImagingSetJobRequest imagingSetJobRequest = null)
Parameters
Type Name Description
System.Int32 workspaceId

The Artifact ID of the workspace that contains the imaging job.

System.Int32 imagingSetId

The Artifact ID of a imaging set.

ImagingSetJobRequest imagingSetJobRequest

Request for imaging job on imaging set can set QcEnabled property and OriginationID. Can be skipped to use default false value for QcEnabled and null for OriginationID.

Returns
Type Description
System.Int64

The Imaging Job Id.

Examples
int workspaceId = 1015427;
int imaginingSetId = 2;
ImagingSetJobRequest imagingSetJobRequest = new ImagingSetJobRequest();
imagingSetJobRequest.QcEnabled = true;
int imagingJobId = _imagingJobService.Run(workspaceId, imagingSetId, imagingSetJobRequest);
| Improve this Doc View Source

SubmitMassDocument(Int32, ImagingMassJobRequest)

Submit a mass image job.

Declaration
long SubmitMassDocument(int workspaceId, ImagingMassJobRequest imagingMassJobRequest)
Parameters
Type Name Description
System.Int32 workspaceId

The Artifact ID of the workspace that contains the imaging job.

ImagingMassJobRequest imagingMassJobRequest

The ImagingMassJobRequest which specifies imaging settings and indirectly (via ImagingMassJobRequest.MassProcessID) indicating which documents to image.

Returns
Type Description
System.Int64

The Artifact ID for the job.

Examples
int workspaceId = 1015427;
int documentArtifactTypeId = 10;
List<Document> documents = Facade.Resolve<IGetAllWorkspaceEntitiesStrategy<Document>>().GetAll(workspaceId);

var joinedArtifactIds = string.Join(",", documents.Select(x => x.ArtifactID));
var createMassProcessTablesRequest = new
{
	request = new
	{
		artifactTypeId = documentArtifactTypeId,
		databaseTokenRequired = true,
		query = new
		{
			condition = $"(('Artifact ID' IN [{joinedArtifactIds}]))"
		}
	}
};

var createMassProcessTablesResult = Facade.Resolve<IRestService>()
											.Post<JObject>($"MassOperation/v1/MassOperationManager/workspace/{workspaceId}/CreateMassProcessTables", createMassProcessTablesRequest);
var massProcessId =  (int)createMassProcessTablesResult["ProcessID"];

var imagingMassJobRequest = new ImagingMassJobRequest
{
	ProfileID = imagingProfile.ArtifactID,
	MassProcessID = massProcessId.ToString(),
	SourceType = ImagingSourceType.Native
};
long imagingJobId = _imagingJobService.SubmitMassDocument(workspaceId, imagingMassJobRequest);
| Improve this Doc View Source

SubmitSingleDocument(Int32, Int32, SingleDocumentImagingJobRequest)

Submit a job to image an individual document.

Declaration
long SubmitSingleDocument(int workspaceId, int documentArtifactId, SingleDocumentImagingJobRequest singleDocumentImagingJobRequest)
Parameters
Type Name Description
System.Int32 workspaceId

The Artifact ID of the workspace that contains the imaging job.

System.Int32 documentArtifactId

The Artifact ID of the document that will be imaged.

SingleDocumentImagingJobRequest singleDocumentImagingJobRequest

The SingleDocumentImagingJobRequest which specifies imaging settings.

Returns
Type Description
System.Int64

The Artifact ID for the job.

Examples
int workspaceId = 1015427;
int documentArtifactId = 2;
var singleDocumentImagingJobRequest = new SingleDocumentImagingJobRequest
{
	OriginationID = Guid.NewGuid(),
	ProfileID = imagingProfile.ArtifactID,
	AlternateNativeLocation = null,
	RemoveAlternateNativeAfterImaging = false
};
long imagingJobId = _imagingJobService.SubmitSingleDocument(workspaceId, documentArtifactId, singleDocumentImagingJobRequest);
| Improve this Doc View Source

UpdatePriority(Int32, Int64, ImagingJobPriorityRequest)

Update the priority of an imaging job.

Declaration
ImagingJobActionResponse UpdatePriority(int workspaceId, long imagingJobId, ImagingJobPriorityRequest updateJobPriorityRequest)
Parameters
Type Name Description
System.Int32 workspaceId

The Artifact ID of the workspace that contains the imaging job.

System.Int64 imagingJobId

The Imaging Job ID.

ImagingJobPriorityRequest updateJobPriorityRequest

The ImagingJobPriorityRequest which mainly specifies new Priority.

Returns
Type Description
ImagingJobActionResponse

A ImagingJobActionResponse containing the information about attempt to update priority of imaging job.

Examples
int workspaceId = 1015427;
long imagingJobId = 1000;
var updatePriorityRequest = new ImagingJobPriorityRequest
{
	OriginationID = Guid.NewGuid(),
	Priority = 99
};
ImagingJobActionResponse updatePriorityResult = _imagingJobService.UpdatePriority(workspaceId, imagingJobId, updatePriorityRequest);
| Improve this Doc View Source

WaitForTheJobToComplete(Int32, Int32, Double)

Waits for the job to be in 'Completed' or 'Completed with Errors' status.

Declaration
void WaitForTheJobToComplete(int workspaceId, int imagingSetId, double timeout = 2)
Parameters
Type Name Description
System.Int32 workspaceId

The Artifact ID of the workspace that contains the imaging job.

System.Int32 imagingSetId

The Artifact ID of a imaging set connected with imaging job.

System.Double timeout

The maximum time in minutes to wait, default is 2.

Examples
int workspaceId = 1015427;
int imagingSetWithRunJobId = 2;
_imagingJobService.WaitForTheJobToComplete(workspaceId, imagingSetWithRunJobId, 3);
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX