IProductionManagerRunProductionAsync Method

Relativity.Productions.API
Queues up the job that will kick off the run production step.

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

Task<ProductionJobResult> RunProductionAsync(
	int workspaceArtifactID,
	int productionArtifactID,
	bool suppressWarnings = false,
	bool overrideConflicts = false
)

Parameters

workspaceArtifactID
Type: SystemInt32
Workspace artifact ID.
productionArtifactID
Type: SystemInt32
Production artifact ID.
suppressWarnings (Optional)
Type: SystemBoolean
Indicates whether or not to automatically suppress warning messages.
overrideConflicts (Optional)
Type: SystemBoolean
Indicates whether or not to automatically override production conflicts.

Return Value

Type: TaskProductionJobResult
Examples

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

public partial class Example
{
    public async Task RunProduction_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
            {
                ProductionJobResult result = await productionManager.RunProductionAsync(workspaceId, productionId, false);

                bool wasJobCreated    = result.WasJobCreated;
                int productionJobId   = result.JobID;

                if (!wasJobCreated)
                {
                    Console.WriteLine(result.Errors);
                    Console.WriteLine(result.Warnings);
                    Console.WriteLine(result.Messages);

                    // Okay, so maybe you've looked at the errors and found some document conflicts
                    // and you want to override it anyway.

                    bool overrideConfilcts = true;
                    bool suppressWarnings = true;

                    result = await productionManager.RunProductionAsync(workspaceId, productionJobId, suppressWarnings, overrideConfilcts);
                }
            }
            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