Productions (.NET)

The Productions API manages productions in a workspace.

You can also interact with the Productions API through the REST API. See Productions service.

This page contains the following information:

Endpoints

The Productions API includes the following endpoints.

Get StagingErrorsAsync

Get StagingErrors API retrieves staging errors and duplicate documents for a given production.

  public async Task GetStagingErrors_Example()
    {
        int workspaceId = 12345; // Workspace containing the Production
        int productionId = 11111; // Production ArtifactID
 
        var userEmail = "user@test.com"; // User login
        var password = "yourpassword"; // User password
 
        var relativityServicesUri = "http://localhost/relativity.services";
        var relativityRestUri = "http://localhost/relativity.rest/api";
 
        var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
        ServiceFactorySettings settings = new ServiceFactorySettings(
            new Uri(relativityServicesUri),
            new Uri(relativityRestUri),
            usernamePasswordCredentials);
        ServiceFactory serviceFactory = new ServiceFactory(settings);
 
        using (Services.V1.IProductionManager productionManager = serviceFactory.CreateProxy<Services.V1.IProductionManager>())
        {
            try
            {
                StagingErrors stagingErrors = await productionManager.StagingErrorsAsync(workspaceId, productionId);
 
                // Do something, like display staging errors for the production
                Console.WriteLine("Found {0} documents with staging errors.",
                    stagingErrors.ErroredDocumentCount);
                Console.WriteLine("Production failed during staging with the following error message: {0}",
                    stagingErrors.ErrorMessage);
                Console.WriteLine("Found duplicate documents {0} across multiple data sources {1}",
                    string.Join(", ", stagingErrors.DuplicateDocuments.Select(x => x.Name).ToList()),
                    string.Join(", ", stagingErrors.DuplicateDocuments.Select(x => x.DataSourceNames).ToList()));
            }
            catch (ValidationException e)
            {
                // Log validation exception details
                Console.WriteLine("There were validation errors: {0}", e.Message);
            }
            catch (ServiceException es)
            {
                // Log service exception details
                Console.WriteLine("There were errors: {0}", es.Message);
            }
        }
    }
}

Get DocumentConflictsAsync

Get DocumentConflicts API illustrate how to retrieve documents that conflict with the workspace's Production Restriction search and Production Restriction itself.

  public async Task DocumentConflictsAsync_Example()
        {
            int workspaceId = 12345;            // Workspace Production exists in
            int productionId = 11111;            // Production's ArtifactID
 
            var userEmail = "user@test.com";  // User's login
            var password = "yourpassword";     // User's password
 
            var relativityServicesUri = "http://localhost/relativity.services";
            var relativityRestUri = "http://localhost/relativity.rest/api";
 
            var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
            ServiceFactorySettings settings = new ServiceFactorySettings(new Uri(relativityServicesUri), new Uri(relativityRestUri), usernamePasswordCredentials);
            ServiceFactory serviceFactory = new ServiceFactory(settings);
 
            using (Services.V1.IProductionManager productionManager = serviceFactory.CreateProxy<Services.V1.IProductionManager>())
            {
                try
                {
                    ProductionDocumentConflicts documentConflicts =
                        await productionManager.DocumentConflictsAsync(workspaceId, productionId);
 
                    // Do something, like display conflicts documents
                    Console.WriteLine("There are {0} document(s) have conflicts", documentConflicts.DocumentIDs);
                    foreach (var docID in documentConflicts.DocumentIDs)
                    {
                        Console.WriteLine("Document ArtifactID - {0}", docID);
                    }
 
                    // Do something, like display production restrictions information
                    Console.WriteLine("Current workspace has production restrictions name {0}", documentConflicts.ProductionRestrictions.SavedSearchName);
                }
                catch (ValidationException e)
                {
                    // Log validation exception details
                    Console.WriteLine("There were validation errors: {0}", e.Message);
                }
                catch (ServiceException es)
                {
                    // Log service exception details
                    Console.WriteLine("There were errors: {0}", es.Message);
                }
            }
        }
    }

Delete DocumentConflictsAsync

Delete DocumentConflictsAsync is an API that removes any documents conflicting with the production restriction of the workspace from the production. Only productions in a status of "Staged", or "ErrorStartingProduction" can have document conflicts deleted. The user must have edit permission to the production set.

public async Task DeleteDocumentConflictsAsync_Example()
{
    int workspaceId = 12345;            // Workspace Production exists in
    int productionId = 11111;            // Production's ArtifactID
 
    var userEmail = "user@test.com";  // User's login
    var password = "yourpassword";     // User's password
 
    var relativityServicesUri = "http://localhost/relativity.services";
    var relativityRestUri = "http://localhost/relativity.rest/api";
 
    var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
    ServiceFactorySettings settings = new ServiceFactorySettings(new Uri(relativityServicesUri), new Uri(relativityRestUri), usernamePasswordCredentials);
    ServiceFactory serviceFactory = new ServiceFactory(settings);
 
    using (Services.V1.IProductionManager productionManager = serviceFactory.CreateProxy<Services.V1.IProductionManager>())
    {
        try
        {
            await productionManager.DeleteDocumentConflictsAsync(workspaceId, productionId);
        }
        catch (ValidationException e)
        {
            // Log validation exception details
            Console.WriteLine("There were validation errors: {0}", e.Message);
        }
        catch (ServiceException es)
        {
            // Log service exception details
            Console.WriteLine("There were errors: {0}", es.Message);
        }
    }
}

Get BrandingErrorsAsync

The following code samples illustrate how to use the Get BrandingErrors API to retrieve the first X number of branding errors of a production. The API will return an empty list if the production is not in an errored state or if the user does not have permission to view the errored documents. X is defined by the MaxListItems instance setting.

public async Task GetBrandingErrors_Example()ta
    {
        int workspaceId = 12345;            // Workspace Production exists in
        int productionId = 11111;            // Production's ArtifactID
 
        var userEmail = "user@test.com";  // User's login
        var password = "abc123456!";     // User's password
 
        var relativityServicesUri = "http://localhost/relativity.services";
        var relativityRestUri = "http://localhost/relativity.rest/api";
 
        var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
        ServiceFactorySettings settings = new ServiceFactorySettings(new Uri(relativityServicesUri), new Uri(relativityRestUri), usernamePasswordCredentials);
        ServiceFactory serviceFactory = new ServiceFactory(settings);
 
        using (Services.V1.IProductionManager productionManager = serviceFactory.CreateProxy<Services.V1.IProductionManager>())
        {
            try
            {
                List<BrandingError> brandingErrors = await productionManager.GetBrandingErrorsAsync(workspaceId, productionId);
 
                Console.WriteLine("There are {0} branding errors.", brandingErrors.Count);
                foreach (BrandingError brandingError in brandingErrors)
                {
                    // Do something, like display information about the documents and its branding errors
 
                    Console.WriteLine("DocumentID {0} - {1} FileID {2} Error: {3}.", brandingError.DocumentID, brandingError.DocumentName, brandingError.FileID, brandingError.ErrorMessage);
 
                }
            }
            catch (ValidationException e)
            {
                // Log validation exception details
                Console.WriteLine("There were validation errors: {0}", e.Message);
            }
            catch (ServiceException es)
            {
                // Log service exception details
                Console.WriteLine("There were errors: {0}", es.Message);
            }
        }
    }

Get ReproductionsAsync

Get ReproductionsAsync retrieves all of the re-productions that have been performed on a production. Re-productions that have since been deleted will have an artifact ID of -1. The production view permission is required to use this API.

public async Task GetReproductions_Example()
{
    int workspaceID = 12345; // Workspace containing the Production
    int productionID = 11111; // Production ArtifactID
 
    var userEmail = "user@test.com"; // User login
    var password = "yourpassword"; // User password
 
    var relativityServicesUri = "http://localhost/relativity.services";
    var relativityRestUri = "http://localhost/relativity.rest/api";
 
    var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
    ServiceFactorySettings settings = new ServiceFactorySettings(
        new Uri(relativityServicesUri),
        new Uri(relativityRestUri),
        usernamePasswordCredentials);
    ServiceFactory serviceFactory = new ServiceFactory(settings);
 
    using (Services.V1.IProductionManager productionManager =
        serviceFactory.CreateProxy<Services.V1.IProductionManager>())
    {
        try
        {
            IEnumerable<ReproductionRef> reproductions = await productionManager.GetReproductionsAsync(workspaceID, productionID);
 
            foreach (ReproductionRef reproduction in reproductions)
            {
                Console.WriteLine($"This is the re-production name: {reproduction.Name}");
                Console.WriteLine($"This is the re-production artifact ID: {reproduction.ProductionID}");
                Console.WriteLine($"This is the re-production deletion status: {reproduction.IsDeleted}");
            }
        }
        catch (ValidationException e)
        {
            // Log validation exception details
            Console.WriteLine("There were validation errors: {0}", e.Message);
        }
        catch (ServiceException es)
        {
            // Log service exception details
            Console.WriteLine("There were errors: {0}", es.Message);
        }
    }
}

Get ProductionRunCheckAsync

Get ProductionRunCheckAsync API retrieves document conflicts, errors indicating potential issues with running a production and information on whether current production is able to proceed to run.

public async Task ProductionRunCheckAsync_Example()
{
    int workspaceId = 12345;            // Workspace Production exists in
    int productionId = 11111;            // Production's ArtifactID
 
    var userEmail = "user@test.com";  // User's login
    var password = "yourpassword";     // User's password
 
    var relativityServicesUri = "http://localhost/relativity.services";
    var relativityRestUri = "http://localhost/relativity.rest/api";
 
    var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
    ServiceFactorySettings settings = new ServiceFactorySettings(new Uri(relativityServicesUri), new Uri(relativityRestUri), usernamePasswordCredentials);
    ServiceFactory serviceFactory = new ServiceFactory(settings);
 
    using (Services.V1.IProductionManager productionManager = serviceFactory.CreateProxy<Services.V1.IProductionManager>())
    {
        try
        {
            ProductionRunCheckResult runCheckResult =
                await productionManager.ProductionRunCheckAsync(workspaceId, productionId);
 
            // Do something, like display check errors
            Console.WriteLine(runCheckResult.CanContinue
                ? "This production can continue to run"
                : "This production is not able to run with errors");
 
            if (runCheckResult.ProductionErrors.Count > 0)
            {
                Console.WriteLine("Production Errors:" + Environment.NewLine);
                foreach (var error in runCheckResult.ProductionErrors)
                {
                    Console.WriteLine(error + Environment.NewLine);
                }
            }
 
            if (runCheckResult.PlaceholderErrors.Count > 0)
            {
                Console.WriteLine("Placeholder Errors:" + Environment.NewLine);
                foreach (var error in runCheckResult.PlaceholderErrors)
                {
                    Console.WriteLine(error + Environment.NewLine);
                }
            }
 
            Console.WriteLine($"The production continue message is {runCheckResult.ContinueMessage}");
        }
        catch (ValidationException e)
        {
            // Log validation exception details
            Console.WriteLine("There were validation errors: {0}", e.Message);
        }
        catch (ServiceException es)
        {
            // Log service exception details
            Console.WriteLine("There were errors: {0}", es.Message);
        }
    }
}

Get ProductionDefaultFieldValues

Retrieves default field values for a new Production object. Empty or null fields are not included.

public async Task GetProductionDefaultFieldValues_Example()
{
    int workspaceId = 12345; // Workspace containing the Production
    var userEmail = "user@test.com"; // User login
    var password = "yourpassword"; // User password
 
 
    var relativityServicesUri = "http://localhost/relativity.services";
    var relativityRestUri = "http://localhost/relativity.rest/api";
 
    var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
    ServiceFactorySettings settings = new ServiceFactorySettings(
        new Uri(relativityServicesUri),
        new Uri(relativityRestUri),
        usernamePasswordCredentials);
    ServiceFactory serviceFactory = new ServiceFactory(settings);
 
    using (var productionManager = serviceFactory.CreateProxy<Services.V1.IProductionManager>())
    {
        try
        {
            ProductionDefaultFieldValues values = await productionManager.GetProductionDefaultFieldValues(workspaceId);
 
            Console.WriteLine("Found default choice Artifact ID for BrandingFont field: {0}.", values.BrandingFont.DefaultValue.ID);
            Console.WriteLine("Found default choice name for BrandingFont field: {0}.", values.BrandingFont.DefaultValue.Name);
            Console.WriteLine("Found BrandingFont field GUID: {0}.", values.BrandingFont.Guid);
            Console.WriteLine("Found BrandingFont field Artifact ID: {0}.", values.BrandingFont.ID);
 
            Console.WriteLine("Found default value for BrandingFontSize field: {0}.", values.BrandingFontSize.DefaultValue);
            Console.WriteLine("Found BrandingFont field GUID: {0}.", values.BrandingFontSize.Guid);
            Console.WriteLine("Found BrandingFont field Artifact ID: {0}.", values.BrandingFontSize.ID);   
        }
        catch (ValidationException ex)
        {
            // Log validation exception details
            Console.WriteLine("There were validation errors: {0}", ex.Message);
        }
        catch (ServiceException ex)
        {
            // Log service exception details
            Console.WriteLine("There were errors: {0}", ex.Message);
        }
    }
}

Get ProductionsEligibleForReproductionAsync

For selected productions in a workspace, returns productions that are eligible for reproduction given the reproduction type.

public async Task GetProductionsEligibleForReproductionAsync_Example()
{
    int workspaceId = 12345; // Workspace containing the Production
    string databaseToken = "1e51ae24-bbcb-4b61-aafb-1f91859d9891"; // GUID representing the database being used
    int reproductionType = 0; // Reproduction type (reproduce document = 0, replace document With placeholder = 1, replace placeholder with document = 2)
 
    var userEmail = "user@test.com"; // User login
    var password = "yourpassword"; // User password
 
    var relativityServicesUri = "http://localhost/relativity.services";
    var relativityRestUri = "http://localhost/relativity.rest/api";
 
    var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
    ServiceFactorySettings settings = new ServiceFactorySettings(
        new Uri(relativityServicesUri),
        new Uri(relativityRestUri),
        usernamePasswordCredentials);
    ServiceFactory serviceFactory = new ServiceFactory(settings);
 
    using (Services.V1.IProductionManager productionManager = serviceFactory.CreateProxy<Services.V1.IProductionManager>())
    {
        try
        {
            IEnumerable<ReproductionCandidate> reproductionCandidates = await productionManager.GetProductionsEligibleForReproductionAsync(workspaceId, databaseToken, reproductionType);
 
            // Do something, like display information about the eligible reproductions.
            Console.WriteLine("Found the following production(s) {0} with the following Production ID(s) {1} are eligible for reproduction.",
                string.Join(", ", reproductionCandidates.Select(x => x.Name).ToList()),
                string.Join(", ", reproductionCandidates.Select(x => x.ProductionID).ToList()));
            Console.WriteLine("Eligible production(s) have the starting bates number(s) {0} and the ending bates number(s) {1}",
                string.Join(", ", reproductionCandidates.Select(x => x.BeginBates).ToList()),
                string.Join(", ", reproductionCandidates.Select(x => x.EndBates).ToList()));
            Console.WriteLine("Eligible production(s) were produced on the following date(s): {0}",
                string.Join(", ", reproductionCandidates.Select(x => x.DateProduced).ToList()));
        }
        catch (ValidationException e)
        {
            // Log validation exception details
            Console.WriteLine("There were validation errors: {0}", e.Message);
        }
        catch (ServiceException es)
        {
            // Log service exception details
            Console.WriteLine("There were errors: {0}", es.Message);
        }
    }
}

Get ProgressAsync

The following code samples illustrate how to retrieve the progress details for a given production.

public async Task GetProgress_Example()
{
    int workspaceId = 12345;            // Workspace Production exists in
    int productionId = 11111;            // Production's ArtifactID
 
    var userEmail = "user@test.com";  // User's login
    var password = "yourpassword";     // User's password
 
    var relativityServicesUri = "http://localhost/relativity.services";
    var relativityRestUri = "http://localhost/relativity.rest/api";
 
    var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
    ServiceFactorySettings settings = new ServiceFactorySettings(new Uri(relativityServicesUri), new Uri(relativityRestUri), usernamePasswordCredentials);
    ServiceFactory serviceFactory = new ServiceFactory(settings);
 
    using (Services.V1.IProductionManager productionManager = serviceFactory.CreateProxy<Services.V1.IProductionManager>())
    {
        try
        {
            ProductionProgress productionProgress = await productionManager.ProgressAsync(workspaceId, productionId);
 
            var productionStatus = productionProgress.Status;
            var totalDocuments = productionProgress.TotalDocuments;
 
            // Do something, like display the metadata of the production
            Console.WriteLine("The current status of the production is: {0}.", productionStatus);
            Console.WriteLine("There are {0} documents total.", totalDocuments);
        }
        catch (ValidationException e)
        {
            // Log validation exception details
            Console.WriteLine("There were validation errors: {0}", e.Message);
        }
        catch (ServiceException es)
        {
            // Log service exception details
            Console.WriteLine("There were errors: {0}", es.Message);
        }
    }
}

Post CreateReproductionJobAsync

The following code samples illustrate how to create a reproduction job and retrieve details about it.

public async Task CreateReproductionJobAsync_Example()
 
{
    int workspaceId = 12345; // Workspace containing the Production
    string databaseToken = "1e51ae24-bbcb-4b61-aafb-1f91859d9891"; // GUID corresponding to the current re-produce mass operation
 
    var userEmail = "user@test.com"; // User login
    var password = "yourpassword"; // User password
 
    ReproductionOptions reproductionOptions = new ReproductionOptions() // options for the given reproduction
    {
        ReproductionType = (ReproductionType)2, // Reproduction type (reproduce document = 0, replace document With placeholder = 1, replace placeholder with document = 2)
        ReproduceDocumentOptions = null, // left null because this isn't the reproduction type selected
        ReplaceDocumentWithPlaceholderOptions = null, // left null because this isn't the reproduction type selected
        ReplacePlaceholderWithDocumentOptions = new ReplacePlaceholderWithDocumentOptions() // options for replacing the placeholder with a document
        {
            Delimiter = "_", // character after bates number ([Bates#]_0001)
            NumberOfDigits = 4, // number of digits after bates number ([Bates#]_0001)
            IncludeNatives = true, // option to include natives
            BurnRedactions = true, // option to burn redactions
            MarkupSetID = 6789 // ID of markup set for redactions, if chosen
        }
    };
    IEnumerable<ProductionRef> productions = new List<ProductionRef>() // productions to be reproduced
    {
        new ProductionRef()
        {
            ProductionID = 1 // production ID to be reproduced
        },
        new ProductionRef()
        {
            ProductionID = 2 // production ID to be reproduced
        }
    };
 
    var relativityServicesUri = "http://localhost/relativity.services";
    var relativityRestUri = "http://localhost/relativity.rest/api";
 
    var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
    ServiceFactorySettings settings = new ServiceFactorySettings(
        new Uri(relativityServicesUri),
        new Uri(relativityRestUri),
        usernamePasswordCredentials);
    ServiceFactory serviceFactory = new ServiceFactory(settings);
 
    using (Services.V1.IReproductionJobManager reproductionJobManager = serviceFactory.CreateProxy<Services.V1.IReproductionJobManager>())
    {
        try
        {
            ReproductionJobResult reproductionJobResult = await reproductionJobManager.CreateReproductionJobAsync(workspaceId, reproductionOptions, productions, databaseToken);
 
            // Do something, like display information about the created reproduction job.
            if(reproductionJobResult.WasJobCreated == true)
            {
                Console.WriteLine("A reproduction job with the ID {0} was created.", reproductionJobResult.ReproductionJobID);
                Console.WriteLine("The following productions were created: {0}.", string.Join(", ", reproductionJobResult.ProductionsCreated.ToList()));
            }
            else
            {
                Console.WriteLine("Failed to create reproduction job.");
            }
        }
        catch (ValidationException e)
        {
            // Log validation exception details
            Console.WriteLine("There were validation errors: {0}", e.Message);
        }
        catch (ServiceException es)
        {
            // Log service exception details
            Console.WriteLine("There were errors: {0}", es.Message);
        }
    }
}

Post MassStageAndRunProductionsAsync

The following code samples illustrate how to stage and run a reproduction job and retrieve details about it.

public async Task MassStageAndRunProductionsAsync_Example()
{
    int workspaceId = 12345; // Workspace containing the reproduction job
    int reproductionJobId = 2; // Reproduction job that points to created productions
 
    var userEmail = "user@test.com"; // User login
    var password = "yourpassword"; // User password
 
    var relativityServicesUri = "http://localhost/relativity.services";
    var relativityRestUri = "http://localhost/relativity.rest/api";
 
    var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
    ServiceFactorySettings settings = new ServiceFactorySettings(
        new Uri(relativityServicesUri),
        new Uri(relativityRestUri),
        usernamePasswordCredentials);
    ServiceFactory serviceFactory = new ServiceFactory(settings);
 
    using (Services.V1.IProductionManager productionManager = serviceFactory.CreateProxy<Services.V1.IProductionManager>())
    {
        try
        {
            IEnumerable<ProductionJobResult> jobResults = await productionManager.MassStageAndRunProductionsAsync(workspaceId, reproductionJobId);
 
            // Do something, like check if all reproductions were successful and display relevant information.
            bool wasSuccess = true;
            foreach (ProductionJobResult result in jobResults)
            {
                wasSuccess &= result.WasJobCreated;
            }
 
            if (wasSuccess)
            {
                Console.WriteLine("Found the following production(s) {0} were staged and ran.",
                    string.Join(", ", jobResults.Select(x => x.ProductionID).ToList()));
            }
            else
            {
                Console.WriteLine("Some or all productions failed with the following errors: {0}.",
                    string.Join(", ", jobResults.Select(x => x.Errors).ToList()));
            }
 
            Console.WriteLine("Reproduction finished with the following warnings: {0}",
                string.Join(", ", jobResults.Select(x => x.Warnings).ToList()));
            }
        catch (ValidationException e)
        {
            // Log validation exception details
            Console.WriteLine("There were validation errors: {0}", e.Message);
        }
        catch (ServiceException es)
        {
            // Log service exception details
            Console.WriteLine("There were errors: {0}", es.Message);
        }
    }
}

Post GetProductionRestrictionsAsync

The following code samples illustrate how to add production restriction on the workspace.

public partial class Example
    {
        public async Task SetProductionRestrictions_Example()
        {
            int workspaceId = 12345;            // Workspace production restriction exist in
            int searchId = 456;                 // Saved search to be used as production restriction
  
            var userEmail = "user@test.com";    // User's login
            var password = "yourpassword";        // User's password
  
            var relativityServicesUri = "http://localhost/relativity.services";
            var relativityRestUri = "http://localhost/relativity.rest/api";
  
            var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
            ServiceFactorySettings settings = new ServiceFactorySettings(new Uri(relativityServicesUri), new Uri(relativityRestUri), usernamePasswordCredentials);
            ServiceFactory serviceFactory = new ServiceFactory(settings);
  
            using (IProductionManager productionManager = serviceFactory.CreateProxy<IProductionManager>())
            {
                try
                {
                    await productionManager.SetProductionRestrictionsAsync(workspaceId, searchId);
                }
                catch (ValidationException e)
                {
                    // Log validation exception details
                    Console.WriteLine("There were validation errors: {0}", e.Message);
                }
                catch (ServiceException es)
                {
                    // Log service exception details
                    Console.WriteLine("There were errors: {0}", es.Message);
                }
            }
        }
    }

Get ProductionRestrictionAsync

The following code samples illustrate how to retrieve the artifact ID of the saved search currently using as production restriction in the workspace specified.

public partial class Example
    {
        public async Task GetProductionRestrictions_Example()
        {
            int workspaceId = 12345;            // Workspace production restriction exist in
  
            var userEmail = "user@test.com";    // User's login
            var password = "yourpassword";        // User's password
  
            var relativityServicesUri = "http://localhost/relativity.services";
            var relativityRestUri = "http://localhost/relativity.rest/api";
  
            var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
            ServiceFactorySettings settings = new ServiceFactorySettings(new Uri(relativityServicesUri), new Uri(relativityRestUri), usernamePasswordCredentials);
            ServiceFactory serviceFactory = new ServiceFactory(settings);
  
            using (IProductionManager productionManager = serviceFactory.CreateProxy<IProductionManager>())
            {
                try
                {
                    int savedSearchId = await productionManager.GetProductionRestrictionAsync(workspaceId);
  
                    if (savedSearchId > 0)
                    {
                        Console.WriteLine($"Production Restriction is using a saved search Id {savedSearchId}");
                    }
                }
                catch (ValidationException e)
                {
                    // Log validation exception details
                    Console.WriteLine("There were validation errors: {0}", e.Message);
                }
                catch (ServiceException es)
                {
                    // Log service exception details
                    Console.WriteLine("There were errors: {0}", es.Message);
                }
            }
        }
    }

Post GetJobStatus

The following code samples illustrate how to retrieve the job status of a given production.

    public async Task GetJobStatus_Example()
    {
        int workspaceId = 12345;            // Workspace Production(s) exist in
        int productionId = 11111;         // Production's ArtifactID
        bool includePercentages = false; // Include percentage of how complete the production is
        int maxNumberOfBrandingErrors = 10; // Returns the max number of branding errors if there are any.
 
        var userEmail = "user@test.com";  // User's login
        var password = "yourpassword";     // User's password
 
        var relativityServicesUri = "http://localhost/relativity.services";
        var relativityRestUri = "http://localhost/relativity.rest/api";
 
        var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
        ServiceFactorySettings settings = new ServiceFactorySettings(new Uri(relativityServicesUri), new Uri(relativityRestUri), usernamePasswordCredentials);
        ServiceFactory serviceFactory = new ServiceFactory(settings);
 
        using (IProductionManager productionManager = serviceFactory.CreateProxy<IProductionManager>())
        {
            try
            {
                // Get the job status of a given production
                var productionJobStatusResult = await productionManager.GetJobStatus(workspaceId, productionId, includePercentages, maxNumberOfBrandingErrors);
                Console.WriteLine("Production Status: {0}", productionJobStatusResult.Status);
                Console.WriteLine("Production Job Status: {0}", productionJobStatusResult.JobStatus);
                Console.WriteLine("Production Last Run Error: {0}", productionJobStatusResult.LastRunError);
                Console.WriteLine("Production Branding Complete: {0}%", productionJobStatusResult.PercentageImaging);
                Console.WriteLine("Production Producing Complete: {0}%", productionJobStatusResult.PercentageProducing);
                Console.WriteLine("Production Last Run Status message{0}", productionJobStatusResult.LastRunStatus);
                Console.WriteLine("Production Last Error message{0}", productionJobStatusResult.LastRunError);
                Console.WriteLine("There are {0} branding errors. They are", productionJobStatusResult.NumberOfBrandingErrors);
                 
                foreach (var brandingError in productionJobStatusResult.BrandingErrors)
                {
                    Console.WriteLine("Production Last Run Error: {0}", brandingError);
                }
            }
 
            catch (ValidationException e)
            {
                // Log validation exception details
                Console.WriteLine("There were validation errors: {0}", e.Message);
            }
            catch (ServiceException es)
            {
                // Log service exception details
                Console.WriteLine("There were errors: {0}", es.Message);
            }

GetProductionPlaceholderDefaultFieldValues

The following code samples illustrate how to retrieve default field values for a new Production Placeholder object. Empty or null fields are not included.

 public partial class Example
{
    public async Task GetProductionPlaceholderDefaultFieldValues_Example()
    {
        int workspaceId = 12345; // Workspace containing the Production Placeholder
 
        var userEmail = "user@test.com"; // User login
        var password = "abc123456!"; // User password
 
        var relativityServicesUri = "http://localhost/relativity.services";
        var relativityRestUri = "http://localhost/relativity.rest/api";
 
        var usernamePasswordCredentials = new UsernamePasswordCredentials(userEmail, password);
        ServiceFactorySettings settings = new ServiceFactorySettings(
            new Uri(relativityServicesUri),
            new Uri(relativityRestUri),
            usernamePasswordCredentials);
        ServiceFactory serviceFactory = new ServiceFactory(settings);
 
        using (Services.V1.IProductionPlaceholderManager productionPlaceholderManager = serviceFactory.CreateProxy<Services.V1.IProductionPlaceholderManager>())
        {
            try
            {
                ProductionPlaceholderDefaultFieldValues values = await productionPlaceholderManager.GetProductionPlaceholderDefaultFieldValues(workspaceId);
 
                Console.WriteLine("Found default Choice Artifact ID for Type field: {0}.", values.Type.DefaultValue.ID);
                Console.WriteLine("Found default Choice Name for Type field: {0}.", values.Type.DefaultValue.Name);
                Console.WriteLine("Found Type field GUID: {0}.", values.Type.Guid);
                Console.WriteLine("Found Type field Artifact ID: {0}.", values.Type.ID);
            }
            catch (ValidationException ex)
            {
                // Log validation exception details
                Console.WriteLine("There were validation errors: {0}", ex.Message);
            }
            catch (ServiceException ex)
            {
                // Log service exception details
                Console.WriteLine("There were errors: {0}", ex.Message);
            }
        }
    }
}

Community Updates

Aero Developer FAQ Evolving the Platform Most recent release notes
Learn more Learn more Learn more

Additional Resources

   
Access Third-Party Tools with GitHub     Create .NET Apps Faster with NuGet
Visit github     visit nuget