IProductionManagerRerunProductionAsync Method

Relativity.Productions.API
Queues up a job to retry a production in Error state.

Namespace:  Relativity.Productions.Services
Assembly:  Relativity.Productions.Services.Interfaces (in Relativity.Productions.Services.Interfaces.dll) Version: 11.1.0.1 9c084404c128f715df772c7792aa49f21535523c
Syntax

Task RerunProductionAsync(
	int workspaceArtifactID,
	int productionArtifactID
)

Parameters

workspaceArtifactID
Type: SystemInt32
Workspace artifact ID.
productionArtifactID
Type: SystemInt32
Production artifact ID.

Return Value

Type: Task
Examples

ReRun production example
using Relativity.Productions.Services;
using Relativity.Services.ServiceProxy;
using Relativity.Services.Exceptions;

public partial class Example
{
    public async Task ReRunProduction_Example()
    {
        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 (IProductionManager productionManager = serviceFactory.CreateProxy<IProductionManager>())
        {
            try
            {
                // Maybe you have run some productions nightly and get email notification said it got error already
                // Now you have made your fix and decide to rerun it again

                Production prod = await productionManager.ReadSingleAsync(workspaceId, productionId);

                if (prod.ProductionMetadata.Status == ProductionStatus.Error)
                {
                    await productionManager.RerunProductionAsync(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);
            }
        }
    }
}
See Also

Reference