

Last date modified: June 17 2025
The Processing API supports the automation of your processing workflows. You can programmatically use this API to create and update custodians, data sources, processing sets, and profiles required for processing. It provides an alternative to manually creating them through the Relativity UI. You also can use the Processing API to run inventory, discovery, and publishing jobs.
Use the information on this page to learn about Processing API fundamentals. It includes prerequisites for developing with this API, and code samples for common operations. Additional resources to help you get started with the Processing API include:
See these related pages:
The Processing application provides system admins with the ability to ingest raw data directly into a workspace for review. When you set up a processing workflow, you create a processing profile. This profile specifies settings that control how the processing engine ingests the data. You create or reference the following items:
You also create a processing set that links a processing profile to one or more data sources. When you run a discovery job, the processing engine discovers files in the data source based on the values specified in the processing set. For more information, see
The Processing API provides interfaces and objects that you can use to automate many of the tasks in a processing workflow. It includes the following interfaces that you can use to access services, which interact with custodian, data source, and processing set objects:
Each of these interfaces provide a ReadAsync() and SaveAsync() method, which you can use to create, update, or retrieve processing objects. The Processing API includes the ProcessingCustodian, ProcessingDatasource, ProcessingProfile, and ProcessingSet classes. You can set or retrieve properties on these classes by calling the ReadAsync() or SaveAsync() method on their respective interfaces. You must call the SaveAsync() method to add any new or modified objects to the database.
The Processing API also includes the IProcessingJobManager interface. You can use this interface to access the Processing Job Manager service for running inventory, discovery, and publishing jobs. It includes the following methods:
Common workflows for processing include inventorying, discovering, and then publishing data, or just discovering and then publishing data. You can only inventory files that haven’t been discovered. Additionally, you can only publish files after Relativity has completed discovery. For more information, see Processing Job Manager and Processing API services for REST.
In Relativity, you want to enable the auto-publish option on the processing profile, so that the discovered files are automatically added to the workspace. See Relativity environment setup.
Complete the following prerequisites to begin development with the Processing API:
You can download the SDKs required for automating processing workflows from the Relativity Community. For more information, see Download the SDKs.
After you download the following SDKs, install or extract their contents to folders on your local machine:
You must install the Processing application on this Relativity instance.
You need to obtain the Artifact IDs of several items that the classes in the Processing API reference. Use these steps to obtain this information from the workspace database:
You must install the Processing application in your Relativity environment in order to view the table for time zones and processing profiles.
Use these guidelines when automating workflows with the Processing API:
The Processing Custodian Manager service supports read and save operations on custodian objects. The ProcessingCustodian class represents a custodian associated with the files that you want to process. For more information, see
To create a ProcessingCustodian instance, invoke the constructor and then initialize the following properties:
Next, call the SaveAsync() method on the proxy created with the IProcessingCustodianManager interface to access the service. You must then pass this method the initialized ProcessingCustodian instance and the workspace Artifact ID.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
public async Task<bool> ProcessingCustodianManager_Create_SaveAsync(IHelper helper)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingCustodianManager proxy = helper.GetServicesManager().CreateProxy<IProcessingCustodianManager>(ExecutionIdentity.User))
{
try
{
//Build the ProcessingCustodian object.
ProcessingCustodian processingCustodian = new ProcessingCustodian
{
ArtifactID = 0, // Indicates a new ProcessingCustodian object.
DocumentNumberingPrefix = "REL",
FirstName = "John",
LastName = "Smith"
};
//Create the ProcessingCustodian object. The service returns the Artifact ID of the object.
int artifactId = await proxy.SaveAsync(processingCustodian, WorkspaceId);
if (artifactId != 0)
{
success = true;
}
else
{
Logger.LogMessage(LogLevel.Error, nameof(ProcessingCustodianManager_Create_SaveAsync), "Create failed", this.GetType().Name);
}
}
catch (Exception exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingCustodianManager_Create_SaveAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
Read the values for the properties on a ProcessingCustodian object by calling the ReadAsync() method on the proxy created with IProcessingCustodianManager interface. The ReadAsync() method requires that you pass the Artifact IDs of the ProcessingCustodian object and the workspace as arguments.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public async Task<bool> ProcessingCustodianManager_ReadAsync(IHelper helper, int processingCustodianArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingCustodianManager proxy = helper.GetServicesManager().CreateProxy<IProcessingCustodianManager>(ExecutionIdentity.User))
{
try
{
//Read the ProcessingCustodian object.
ProcessingCustodian processingCustodian = await proxy.ReadAsync(processingCustodianArtifactId, WorkspaceId);
//Display the last and first name of the custodian.
string fullName = $"{processingCustodian.LastName}, {processingCustodian.FirstName}";
Logger.LogMessage(LogLevel.Debug, nameof(ProcessingCustodianManager_ReadAsync), fullName, this.GetType().Name);
success = true;
}
catch (Exception exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingCustodianManager_ReadAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
When updating a ProcessingCustodian instance, you call the AsyncRead() method on the proxy created with the IProcessingCustodianManager interface. Next, set the properties on the instance to their new values, and then call the SaveAsync() method. You must call the SaveAsync() method in order for your changes to be added to the database.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
public async Task<bool> ProcessingCustodianManager_Update_SaveAsync(IHelper helper, int processingCustodianArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingCustodianManager proxy = helper.GetServicesManager().CreateProxy<IProcessingCustodianManager>(ExecutionIdentity.User))
{
try
{
//Read the ProcessingCustodian object.
ProcessingCustodian processingCustodian = await proxy.ReadAsync(processingCustodianArtifactId, WorkspaceId);
//Modify the document numbering prefix and first name.
processingCustodian.DocumentNumberingPrefix = "ECA";
processingCustodian.FirstName = "Sam";
processingCustodian.Name = $"{processingCustodian.LastName}, {processingCustodian.FirstName}";
//Update the ProcessingCustodian object. The service returns the Artifact ID of the object.
int artifactId = await proxy.SaveAsync(processingCustodian, WorkspaceId);
if (artifactId != 0)
{
success = true;
}
else
{
Logger.LogMessage(LogLevel.Error, nameof(ProcessingCustodianManager_Update_SaveAsync), "Update failed", this.GetType().Name);
}
}
catch (Exception exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingCustodianManager_Update_SaveAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
The Processing Profile represents a collection of settings used to process documents. Processing profiles are associated with processing sets, so you must provide the Artifact ID of a processing profile when creating or updating a processing set, see Processing Set Manager for more details. The Processing Profile can be updated using the Object Manager API, use the Create endpoint for creating a new profile, the Update endpoint for updating a profile, the Query endpoint for retrieving a profile, and the Delete endpoint for removing a profile from Relativity. Sample methods are provided below for performing all of these actions with a Processing Profile.
The Processing Profile has multiple properties for specifying numbering; deNISTing, extraction, and deduplication settings.
You can find more information about processing profile fields on the following pages:
Before you can create or update fields within a Processing Profile, the ArtifactID’s will need to be queried. Use the ReadMultipleArtifactIdsAsync endpoint from the Artifact Guid Manager to retrieve the field ArtifactID's that are needed. Once the ArtifactID’s are collected using the corresponding Guid from the list below, they can be used to identify which field values are being set.
1
<host>/Relativity.REST/api/Relativity.Services.ArtifactGuid.IArtifactGuidModule/Artifact%20Guid%20Manager/ReadMultipleArtifactIdsAsync
1
{"workspaceId":10636370,"guids":["7161a505-54ed-4eb1-94fe-004bcdc3e988","5f300c10-4660-4a4d-bfa9-e32c9846c3fa"]}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
public async Task<Dictionary<Guid, int>> ReadMultipleArtifactIdsAsync(HttpClient httpClient, int workspaceId, List<Guid> guids)
{
var apiUrl = "/Relativity.Rest/API/Relativity.Services.ArtifactGuid.IArtifactGuidModule/Artifact%20Guid%20Manager/ReadMultipleArtifactIdsAsync";
var payloadObject = new
{
workspaceId = workspaceId,
guids = guids,
};
StringContent payload = new StringContent(JsonConvert.SerializeObject(payloadObject), Encoding.UTF8, "application/json");
HttpResponseMessage response = await httpClient.PostAsync(apiUrl, payload);
string resultString = await response.Content.ReadAsStringAsync();
var artifactIDs = new Dictionary<Guid, int>();
if (response.IsSuccessStatusCode)
{
dynamic result = JArray.Parse(resultString) as JArray;
foreach (var obj in result)
{
int artifactID = obj.ArtifactID;
Guid guid = obj.Guid;
artifactIDs.Add(guid, artifactID);
}
}
return artifactIDs;
}
To access Processing Profile fields via the Relativity API, enter the following IDs:
To create a processing profile in a workspace, set the required fields using their ArtifactID’s queried from the Guid list above and the value. Call the Object Manager Create endpoint by passing it the new Processing Profile values and the Artifact ID of a Workspace object.
1
<host>/Relativity.REST/api/Relativity.Objects/Workspace/{workspaceId}/Object/Create
1
{"request":{"ObjectType":{"ArtifactTypeID":1000041},"FieldValues":[{"Field":{"ArtifactID":1039245},"Value":"Processing Profile Name"},{"Field":{"ArtifactID":1039459},"Value":[{"ArtifactID":1039609,"Name":"Afrikaans","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null},{"ArtifactID":1039610,"Name":"Albanian","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}]},{"Field":{"ArtifactID":1039460},"Value":{"ArtifactID":1037893,"Name":"(UTC-06:00) Central Time (US & Canada)","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1039461},"Value":{"ArtifactID":1039463,"Name":"Global","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1039465},"Value":true},{"Field":{"ArtifactID":1039466},"Value":"000001"},{"Field":{"ArtifactID":1039467},"Value":true},{"Field":{"ArtifactID":1039468},"Value":true},{"Field":{"ArtifactID":1039469},"Value":[{"ArtifactID":1039472,"Name":null,"Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}]},{"Field":{"ArtifactID":1039473},"Value":false},{"Field":{"ArtifactID":1039474},"Value":{"ArtifactID":1346192,"Name":"Ring L0001 (201010)","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1039475},"Value":{"ArtifactID":1039476,"Name":"DeNIST all files","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1039478},"Value":true},{"Field":{"ArtifactID":1039479},"Value":{"ArtifactID":1039480,"Name":"High (Slowest Speed)","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1039483},"Value":true},{"Field":{"ArtifactID":1039484},"Value":{"ArtifactID":1039486,"Name":"Extract and place at end","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1039488},"Value":{"ArtifactID":1272519,"Name":"Relativity","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1042412},"Value":{"ArtifactID":1042414,"Name":". (period)","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1042416},"Value":{"ArtifactID":1042423,"Name":"7","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1042427},"Value":{"ArtifactID":1042428,"Name":"Auto Number","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1042430},"Value":{"ArtifactID":1042431,"Name":null,"Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1043873},"Value":{"ArtifactID":1272521,"Name":null,"Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1043876},"Value":{"ArtifactID":1272522,"Name":null,"Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1043879},"Value":true},{"Field":{"ArtifactID":1046224},"Value":{"ArtifactID":1046225,"Name":"MSG","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1272523},"Value":true},{"Field":{"ArtifactID":1272524},"Value":{"ArtifactID":1272525,"Name":"All Files","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1272527},"Value":{"ArtifactID":1272529,"Name":"Exclusion","Guids":[],"FieldType":0,"FieldCategory":0,"SubObjectFields":[],"Value":null}},{"Field":{"ArtifactID":1272530},"Value":"txt pdf"}]}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
public async Task<int?> CreateProcessingProfile(HttpClient httpClient, int workspaceId)
{
var objType = new ObjectType() { ArtifactTypeID = 1000041 }; // ArtifactTypeID 1000041 is the Processing Profile ArtifactTypeID
var fieldList = new List<FieldValue>() {
new FieldValue() { ArtifactID = 1039245, Value = "Processing Profile Name" },
new FieldValue() { ArtifactID = 1039459, Value = new List<FieldValue>() { new FieldValue() { ArtifactID = 1039609, Name = "Afrikaans" }, new FieldValue() { ArtifactID = 1039610, Name = "Albanian" } } },
new FieldValue() { ArtifactID = 1039460, Value = new FieldValue() { ArtifactID = 1037893, Name = "(UTC-06:00) Central Time (US & Canada)" } },
new FieldValue() { ArtifactID = 1039461, Value = new FieldValue() { ArtifactID = 1039463, Name = "Global" } },
new FieldValue() { ArtifactID = 1039465, Value = true },
new FieldValue() { ArtifactID = 1039466, Value = "000001" },
new FieldValue() { ArtifactID = 1039467, Value = true },
new FieldValue() { ArtifactID = 1039468, Value = true },
new FieldValue() { ArtifactID = 1039469, Value = new List<FieldValue>() { new FieldValue() { ArtifactID = 1039472 } } },
new FieldValue() { ArtifactID = 1039473, Value = false },
new FieldValue() { ArtifactID = 1039474, Value = new FieldValue() { ArtifactID = 1346192, Name = "Ring L0001 (201010)" } },
new FieldValue() { ArtifactID = 1039475, Value = new FieldValue() { ArtifactID = 1039476, Name = "DeNIST all files" } },
new FieldValue() { ArtifactID = 1039478, Value = true },
new FieldValue() { ArtifactID = 1039479, Value = new FieldValue() { ArtifactID = 1039480, Name = "High (Slowest Speed)" } },
new FieldValue() { ArtifactID = 1039483, Value = true },
new FieldValue() { ArtifactID = 1039484, Value = new FieldValue() { ArtifactID = 1039486, Name = "Extract and place at end" } },
new FieldValue() { ArtifactID = 1039488, Value = new FieldValue() { ArtifactID = 1272519, Name = "Relativity" } },
new FieldValue() { ArtifactID = 1042412, Value = new FieldValue() { ArtifactID = 1042414, Name = ". (period)" } },
new FieldValue() { ArtifactID = 1042416, Value = new FieldValue() { ArtifactID = 1042423, Name = "7" } },
new FieldValue() { ArtifactID = 1042427, Value = new FieldValue() { ArtifactID = 1042428, Name = "Auto Number" } },
new FieldValue() { ArtifactID = 1042430, Value = new FieldValue() { ArtifactID = 1042431 } },
new FieldValue() { ArtifactID = 1043873, Value = new FieldValue() { ArtifactID = 1272521 } },
new FieldValue() { ArtifactID = 1043876, Value = new FieldValue() { ArtifactID = 1272522 } },
new FieldValue() { ArtifactID = 1043879, Value = true },
new FieldValue() { ArtifactID = 1046224, Value = new FieldValue() { ArtifactID = 1046225, Name = "MSG" } },
new FieldValue() { ArtifactID = 1272523, Value = true },
new FieldValue() { ArtifactID = 1272524, Value = new FieldValue() { ArtifactID = 1272525, Name = "All Files" } },
new FieldValue() { ArtifactID = 1272527, Value = new FieldValue() { ArtifactID = 1272529, Name = "Exclusion" } },
new FieldValue() { ArtifactID = 1272530, Value = "txt pdf" },
};
var APIUrl = "/Relativity.Rest/API/Relativity.Objects/workspace";
var payloadObject = new
{
request = new
{
ObjectType = new
{
ArtifactTypeID = objType?.ArtifactTypeID
},
FieldValues = fieldList?.Select(fv => new
{
Field = new
{
ArtifactID = fv.ArtifactID,
},
Value = fv.Value
}),
},
};
StringContent payload = new StringContent(JsonConvert.SerializeObject(payloadObject), Encoding.UTF8, "application/json");
HttpResponseMessage response = await httpClient.PostAsync($"{APIUrl}/{workspaceId}/object/create", payload);
string resultString = await response.Content.ReadAsStringAsync();
int? outId = null;
if (response.IsSuccessStatusCode)
{
dynamic result = JObject.Parse(resultString) as JObject;
int.TryParse((string)result["Object"]["ArtifactID"], out int id);
outId = id;
}
return outId;
}
Use the Object Manager Query endpoint to retrieve a list of processing profiles from Relativity if passing in the ArtifactTypeId or pass in the ArtifactId of the specific Processing Profile to retrieve child FieldValues.
1
<host>/Relativity.REST/api/Relativity.ObjectManager/v1/Workspace/{workspaceId}/Object/Query
1
2
3
4
5
6
{"request":
{"ObjectType":
{"ArtifactTypeID":1000041},"Condition":"","Sorts":"","Fields":""},
"start":0,
"length":10
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public async Task<string> QueryProcessingProfile(HttpClient httpClient, int workspaceId)
{
var artifactTypeId = 1000041;
var APIUrl = "/Relativity.Rest/API/Relativity.ObjectManager/v1";
var payloadObject = new
{
request = new
{
ObjectType = new
{
ArtifactTypeID = artifactTypeId
},
Condition = "",
Sorts = "",
Fields = "",
},
start = 0,
length = 10,
};
StringContent payload = new StringContent(JsonConvert.SerializeObject(payloadObject), Encoding.UTF8, "application/json");
HttpResponseMessage response = await httpClient.PostAsync($"{APIUrl}/workspace/{workspaceId}/object/query", payload);
return await response.Content.ReadAsStringAsync();
}
To update a processing profile, modify the profile fields as necessary by passing in the ArtifactID and Value of the field along with the Processing Profile ArtifactID and then pass this object to the Object Manager Update endpoint.
1
<host>/Relativity.REST/api/Relativity.Objects/Workspace/{workspaceId}/Object/Update
1
2
3
4
5
{"request":
{"Object":
{"ArtifactID":1395130},"FieldValues":[{"Field":{"ArtifactID":1039245},"Value":"NewProfileName"}]
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public async Task<string> UpdateProcessingProfile(HttpClient httpClient, int workspaceId)
{
int artifactId = 1395130; // Processing Profile ArtifactId
var fieldList = new List<FieldValue>() {
new FieldValue() { ArtifactID = 1039245, Value = "New Profile Name" } // Name field ArtifactId and Value
};
var APIUrl = "/Relativity.Rest/API/Relativity.Objects/workspace";
var payloadObject = new
{
request = new
{
Object = new
{
ArtifactID = artifactId
},
FieldValues = fieldList?.Select(fv => new
{
Field = new
{
ArtifactID = fv.ArtifactID,
},
Value = fv.Value
}),
},
};
StringContent payload = new StringContent(JsonConvert.SerializeObject(payloadObject), Encoding.UTF8, "application/json");
HttpResponseMessage response = await httpClient.PostAsync($"{APIUrl}/{workspaceId}/object/update", payload);
return await response.Content.ReadAsStringAsync();
}
Use the Object Manager Delete endpoint to remove a processing profile from Relativity by passing in the Processing Profile ArtifactId and WorkspaceId.
1
<host>/Relativity.REST/api/Relativity.Objects/Workspace/{workspaceId}/Object/Delete
1
2
3
4
5
{"request":
{"Object":
{"ArtifactID":1395122}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public async Task<string> DeleteProcessingProfile(HttpClient httpClient, int workspaceId)
{
int artifactId = 1395122; // Processing Profile ArtifactId
string APIUrl = "/Relativity.Rest/API/Relativity.Objects/Workspace";
var payloadObject = new
{
request = new
{
Object = new
{
ArtifactID = artifactId
},
},
};
StringContent payload = new StringContent(JsonConvert.SerializeObject(payloadObject), Encoding.UTF8, "application/json");
HttpResponseMessage response = await httpClient.PostAsync($"{APIUrl}/{workspaceId}/object/delete", payload);
return await response.Content.ReadAsStringAsync();
}
The Processing Data Source Manager service supports read and save operations on data source objects. The ProcessingDataSource class represents a data source that contains the location of the files for discovery during processing. For more information, see
To create a ProcessingDataSource instance, invoke the constructor and initialize the following properties:
You can set this property to null. When it is null, Relativity uses auto-numbering. For more information about numbering type options, see
Call the SaveAsync() method on the proxy created with the IProcessingDataSourceManager interface. You must then pass this method the initialized ProcessingDataSource instance and the workspace Artifact ID as illustrated in the following code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
public async Task<bool> ProcessingDataSourceManager_Create_SaveAsync(IHelper helper, int custodianArtifactId, int destinationFolderArtifactId, int timeZoneArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingDataSourceManager proxy = helper.GetServicesManager().CreateProxy<IProcessingDataSourceManager>(ExecutionIdentity.User))
{
try
{
//Build the processing ProcessingDataSource object.
ProcessingDataSource processingDataSource = new ProcessingDataSource
{
ArtifactID = 0, // Indicates a new ProcessingDataSource object.
ProcessingSet = new ProcessingSetRef { ArtifactID = ProcessingSetId },
Custodian = custodianArtifactId,
DestinationFolder = destinationFolderArtifactId,
DocumentNumberingPrefix = "REL",
InputPath = "@Some/Path",
Name = "Data Source 1",
OcrLanguages = new[] { OcrLanguage.English },
Order = 200,
TimeZone = timeZoneArtifactId,
StartNumber = 8,
IsStartNumberVisible = true,
};
//Create the ProcessingDataSource object. The service returns the Artifact ID for the object.
int artifactId = await proxy.SaveAsync(processingDataSource, WorkspaceId);
if (artifactId != 0)
{
success = true;
}
else
{
Logger.LogMessage(LogLevel.Error, nameof(ProcessingDataSourceManager_Create_SaveAsync), "Create failed", this.GetType().Name);
}
}
catch (ServiceException exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingDataSourceManager_Create_SaveAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
Read the values for the properties on a ProcessingDataSource object by calling the ReadAsync() method on the proxy created with the IProcessingDataSourceManager interface. The ReadAsync() method requires that you pass the Artifact IDs of the ProcessingDataSource object and the workspace as arguments.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public async Task<bool> ProcessingDataSourceManager_ReadAsync(IHelper helper, int processingDataSourceArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingDataSourceManager proxy = helper.GetServicesManager().CreateProxy<IProcessingDataSourceManager>(ExecutionIdentity.User))
{
try
{
//Read the ProcessingSet object.
ProcessingDataSource processingDataSource = await proxy.ReadAsync(processingDataSourceArtifactId, WorkspaceId);
//Display the input path.
Logger.LogMessage(LogLevel.Debug, nameof(ProcessingDataSourceManager_ReadAsync), processingDataSource.InputPath, this.GetType().Name);
success = true;
}
catch (ServiceException exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingDataSourceManager_ReadAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
When updating a ProcessingDataSource instance, you call the AsyncRead() method on the proxy created with the IProcessingDataSourceManager interface. Next, set the properties on the instance to their new values, and then call the SaveAsync() method. You must call the SaveAsync() method in order for your changes to be added to the database.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
public async Task<bool> ProcessingDataSourceManager_Update_SaveAsync(IHelper helper, int processingDataSourceArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingDataSourceManager proxy = helper.GetServicesManager().CreateProxy<IProcessingDataSourceManager>(ExecutionIdentity.User))
{
try
{
//Read the ProcessingDataSource object.
ProcessingDataSource processingDataSource = await proxy.ReadAsync(processingDataSourceArtifactId, WorkspaceId);
//Modify the input path and destination folder.
processingDataSource.InputPath = "@Some/Other/Path";
processingDataSource.DestinationFolder = 99; // Artifact Id of the destination folder
//Update the processing data source object. The service returns the Artifact ID of the object.
int artifactId = await proxy.SaveAsync(processingDataSource, WorkspaceId);
if (artifactId != 0)
{
success = true;
}
else
{
Logger.LogMessage(LogLevel.Error, nameof(ProcessingDataSourceManager_Update_SaveAsync), "Update failed", this.GetType().Name);
}
}
catch (ServiceException exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingDataSourceManager_Update_SaveAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
The Processing Set Manager service supports read and save operations on processing set objects. The ProcessingSet class represents a processing set object that links a processing profile to one or more data sources. For more information, see
To create a ProcessingSet instance, invoke the constructor and then initialize the following properties:
Call the SaveAsync() method on the proxy created with the IProcessingSetManager interface. You must then pass the initialized ProcessingSet object and workspace Artifact ID to this method.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
public async Task<bool> ProcessingSetManager_Create_SaveAsync(IHelper helper, int processingProfileArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingSetManager proxy = helper.GetServicesManager().CreateProxy<IProcessingSetManager>(ExecutionIdentity.User))
{
try
{
//Build the ProcessingSet object.
ProcessingSet processingSet = new ProcessingSet
{
ArtifactID = 0, // Indicates a new ProcessingSet object.
EmailNotificationRecipients = new[] { "johnSmith@domain.com", "adamJohnson@domain.com" },
Name = "Test Set",
Profile = new ProcessingProfileRef(processingProfileArtifactId) // The Artifact ID of the processing profile.
};
//Create the ProcessingSet object. The service returns the Artifact ID of the object.
int artifactId = await proxy.SaveAsync(processingSet, WorkspaceId);
if (artifactId != 0)
{
success = true;
}
else
{
Logger.LogMessage(LogLevel.Error, nameof(ProcessingSetManager_Create_SaveAsync), "Create failed", this.GetType().Name);
}
}
catch (ServiceException exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingSetManager_Create_SaveAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
Read the values for the properties on a ProcessingSet object by calling the ReadAsync() method on the IProcessingSetManager. The ReadAsync() method requires that you pass the Artifact IDs of the ProcessingSet object and the workspace as arguments.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public async Task<bool> ProcessingSetManager_ReadAsync(IHelper helper, int processingSetArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingSetManager proxy = helper.GetServicesManager().CreateProxy<IProcessingSetManager>(ExecutionIdentity.User))
{
try
{
//Read the ProcessingSet object.
ProcessingSet processingSet = await proxy.ReadAsync(processingSetArtifactId, WorkspaceId);
//Display the Artifact ID of the processing profile.
string profileId = $"{processingSet.Profile.ArtifactID}";
Logger.LogMessage(LogLevel.Debug, nameof(ProcessingSetManager_ReadAsync), profileId, this.GetType().Name);
success = true;
}
catch (ServiceException exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingSetManager_ReadAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
When updating a ProcessingSet instance, you call the AsyncRead() method on the proxy created with the IProcessingSetManager interface. Next, set the properties on the instance to their new values, and then call the SaveAsync() method. You must call the SaveAsync() method in order for your changes to be added to the database.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
public async Task<bool> ProcessingSetManager_Update_SaveAsync(IHelper helper, int processingSetArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingSetManager proxy = helper.GetServicesManager().CreateProxy<IProcessingSetManager>(ExecutionIdentity.User))
{
try
{
//Read the ProcessingSet object.
ProcessingSet processingSet = await proxy.ReadAsync(processingSetArtifactId, WorkspaceId);
//Modify the list of email recipients list and the name of the processing set.
processingSet.EmailNotificationRecipients = new[] { "johnSmith@domain.com" };
processingSet.Name = "Test Set";
//Update the ProcessingSet object. The service returns the Artifact ID of the object.
int artifactId = await proxy.SaveAsync(processingSet, WorkspaceId);
if (artifactId != 0)
{
success = true;
}
else
{
Logger.LogMessage(LogLevel.Error, nameof(ProcessingSetManager_Update_SaveAsync), "Update failed", this.GetType().Name);
}
}
catch (ServiceException exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingSetManager_Update_SaveAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
You can use the GetDocumentAggregates() method to retrieve document totals and other information about processing sets in a specific workspace. To retrieve this information, the process sets must have the statuses of Completed or Completed with errors. If you wanted to create a custom dashboard for reporting purposes, use this method to populate it with information about completed processing sets. For example, Relativity uses the GetDocumentAggregates() method to populate the Early Case Assessment dashboard with processing set data.
Use the following classes in conjunction with the GetDocumentAggregates() method. For additional reference information, see Processing API.
When calling the GetDocumentAggregates() method, pass a GetDocumentAggregatesRequest object as an argument. The GetDocumentAggregatesRequest class is a request object. It contains criteria for retrieving processing sets available in a specific workspace. It has the following properties:
The following code sample uses "ProcessingSetName" as the setting for SortColumnName property.
The GetDocumentAggregates() method returns a ProcessingSetDocumentInfoSummary object, which contains information about processing sets retrieved from a specific workspace. This class has the following properties:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public async Task<ProcessingSetDocumentInfoSummary> ProcessingSetManager_GetDocumentAggregatesAsync(IHelper helper, int workspaceArtifactId)
{
// Get a connection to the API using the Relativity API Helper classes, available on event handlers,
// agents, and custom Pages. They are mocked in these samples.
// This sample code executes under the context of the current user.
using (IProcessingSetManager proxy = helper.GetServicesManager().CreateProxy<IProcessingSetManager>(ExecutionIdentity.User))
{
try
{
// Build the GetDocumentAggregatesRequest object.
GetDocumentAggregatesRequest request = new GetDocumentAggregatesRequest
{
Page = 0,
PageSize = 15,
SortColumnName = "ProcessingSetName",
SortDescending = true,
WorkspaceArtifactId = workspaceArtifactId
};
// Submit the request. The service returns information for all 'Completed' and 'Completed with Errors'
// Processing Sets in the given workspace.
ProcessingSetDocumentInfoSummary processingSetDocumentInfoSummary = await proxy.GetDocumentAggregates(request);
return processingSetDocumentInfoSummary;
}
catch (ServiceException serviceException)
{
Logger.LogMessage(LogLevel.Error, nameof(ProcessingSetManager_GetDocumentAggregatesAsync), serviceException.Message, this.GetType().Name);
throw;
}
}
}
The Processing Job Manager service includes methods for executing inventory, discovery, and publishing jobs. It also includes a method for canceling any of these jobs for a processing set. This service is available through the IProcessingJobManager interface. For more information, see Common processing workflows.
The following code illustrates how to run an inventory job by calling the SubmitInventoryJobsAsync() method on the proxy created with the IProcessingJobManager interface. You must pass an initialized InventoryJob instance to this method. This instance has the Artifact ID of the processing set that you want to use for the job, and the Artifact ID of the workspace where it resides.
If you want to use filtering on your inventory job, apply filters through Relativity after you programmatically run your inventory job. For more information, see
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public async Task<bool> ProcessingJobManager_InventoryAsync(IHelper helper, int processingSetArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingJobManager proxy = helper.GetServicesManager().CreateProxy<IProcessingJobManager>(ExecutionIdentity.User))
{
try
{
//Create an inventory job object.
InventoryJob inventoryJob = new InventoryJob
{
ProcessingSetId = processingSetArtifactId,
WorkspaceArtifactId = WorkspaceId
};
//Submit the job for inventory.
await proxy.SubmitInventoryJobsAsync(inventoryJob);
success = true;
}
catch (ServiceException exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingJobManager_InventoryAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
The following code illustrates how to run a discovery job by calling the SubmitDiscoveryJobsAsync() method on the proxy created with the IProcessingJobManager interface. You must pass an initialized DiscoveryJob instance to this method. The DiscoveryJob instance represents a processing job that you want to run. This instance has the Artifact ID of the processing set that you want to use for the job, and the Artifact ID of the workspace where it resides. For more information, see
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public async Task<bool> ProcessingJobManager_DiscoveryAsync(IHelper helper, int processingSetArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user. For more information, see the documentation for Relativity API Helpers.
using (IProcessingJobManager proxy = helper.GetServicesManager().CreateProxy<IProcessingJobManager>(ExecutionIdentity.User))
{
try
{
//Create a discovery job object.
DiscoveryJob discoveryJob = new DiscoveryJob
{
ProcessingSetId = processingSetArtifactId,
WorkspaceArtifactId = WorkspaceId
};
//Submit the job for discovery.
await proxy.SubmitDiscoveryJobsAsync(discoveryJob);
success = true;
}
catch (ServiceException exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingJobManager_DiscoveryAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
The following code illustrates how to execute a publishing job by calling the SubmitPublishJobsAsync() method on the proxy created with the IProcessingJobManager interface. You must pass an initialized PublishJob instance to this method. This instance has the Artifact ID of the processing set that you want to use for the job, and the Artifact ID of the workspace where it resides.
Similar to the Relativity UI, you can resubmit a publishing job with processing errors by calling the SubmitPublishJobsAsync() method again. For more information, see Publishing files on the Relativity
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public async Task<bool> ProcessingJobManager_PublishAsync(IHelper helper, int processingSetArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingJobManager proxy = helper.GetServicesManager().CreateProxy<IProcessingJobManager>(ExecutionIdentity.User))
{
try
{
//Create a publish job object.
PublishJob publishJob = new PublishJob
{
ProcessingSetId = processingSetArtifactId,
WorkspaceArtifactId = WorkspaceId
};
//Submit the job for discovery.
await proxy.SubmitPublishJobsAsync(publishJob);
success = true;
}
catch (ServiceException exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingJobManager_PublishAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
You can use the SubmitCancelJobAsync() method to cancel inventory, discovery, and publishing jobs for a specific processing set. The following code illustrates how to execute a cancel job by calling this method on the proxy created with the IProcessingJobManager interface. You must pass an initialized CancelJob instance to this method. This instance has the Artifact ID of the processing set associated with the job that you want to cancel, and the Artifact ID of the workspace where it resides.
This sample code returns a Boolean value called success after the cancel job has been successfully submitted. However, this return value doesn't indicate that the job has been canceled. Multiple factors influence when a worker picks up a cancel job and how long the job takes to execute. For example, the amount of data and system state can affect this outcome.
The submission of cancel job returns successfully when the job associated with a processing set has already been canceled.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public async Task<bool> ProcessingJobManager_CancelAsync(IHelper helper, int processingSetArtifactId)
{
bool success = false;
//Get a connection to the API using the Relativity API Helper classes, available on event handlers,
//agents, and custom Pages. They are mocked in these samples.
//This sample code executes under the context of the current user.
using (IProcessingJobManager proxy = helper.GetServicesManager().CreateProxy<IProcessingJobManager>(ExecutionIdentity.User))
{
try
{
//Create a cancel job object.
CancelJob cancelJob = new CancelJob
{
ProcessingSetId = processingSetArtifactId,
WorkspaceArtifactId = WorkspaceId
};
//Submit a job to cancel a processing set.
await proxy.SubmitCancelJobAsync(cancelJob);
success = true;
}
catch (Exception exception)
{
//The service returns exceptions of type ServiceException.
Logger.LogMessage(LogLevel.Error, nameof(ProcessingJobManager_CancelAsync), exception.Message, this.GetType().Name);
}
}
return success;
}
Why was this not helpful?
Check one that applies.
Thank you for your feedback.
Want to tell us more?
Great!
Additional Resources |
|||
DevHelp Community | GitHub | Release Notes | NuGet |