IProductionManagerMassCancelAsync Method (ListProductionJobRef)

Relativity.Productions.API
Makes a request to cancel multiple production jobs.

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

Task<MassCancelResult> MassCancelAsync(
	List<ProductionJobRef> jobsToBeCanceled
)

Parameters

jobsToBeCanceled
Type: System.Collections.GenericListProductionJobRef
A list of ProductionJobRef objects representing the production jobs to cancel.

Return Value

Type: TaskMassCancelResult
The results of a cancel operation on multiple production jobs.
Examples

Mass cancel productions example
using Relativity.Services.ServiceProxy;
using Relativity.Productions.Services;
using Relativity.Services.Exceptions;

public partial class Example
{
    public async Task MassCancelProductions_Example()
    {
        int workspaceIdJob1 = 12345;         // Workspace Production Job 1 exists in
        int productionIdJob1 = 11111;        // Production Job 1's ArtifactID

        int workspaceIdJob2 = 23456;         // Workspace Production Job 2 exists in
        int productionIdJob2 = 22222;        // Production Job 2's ArtifactID

        int productionJobId3 = 111;            // JobID of Production Job 3

        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);

        List<ProductionJobRef> jobsToBeCanceled = new List<ProductionJobRef>()
        {
            new ProductionJobRef()
            {
                WorkspaceID = workspaceIdJob1,
                ProductionID = productionIdJob1
            },
            new ProductionJobRef()
            {
                WorkspaceID = workspaceIdJob2,
                ProductionID = productionIdJob2
            },
            new ProductionJobRef()
            {
                JobID = productionJobId3
            }
        };

        using (IProductionManager productionManager = serviceFactory.CreateProxy<IProductionManager>())
        {
            try
            {
                await productionManager.MassCancelAsync(jobsToBeCanceled);
            }
            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