IProductionManagerReadSingleAsync Method

Relativity.Productions.API
Returns an instance of Production object.

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

Task<Production> ReadSingleAsync(
	int workspaceArtifactID,
	int productionArtifactID,
	DataSourceReadMode dataSourceReadMode = DataSourceReadMode.OnlyDataSources
)

Parameters

workspaceArtifactID
Type: SystemInt32
Workspace artifact ID.
productionArtifactID
Type: SystemInt32
Production artifact ID.
dataSourceReadMode (Optional)
Type: Relativity.Productions.ServicesDataSourceReadMode
Retrieve Data sources and placeholders mode. Placeholders will only be returned for productions in the Produced state.

Return Value

Type: TaskProduction
An instance of Production object.
Examples

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

public partial class Example
{
    public async Task ReadProduction_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
            {
                Production production = await productionManager.ReadSingleAsync(workspaceId, productionId);

                var productionStatus = production.ProductionMetadata.Status;
                if (productionStatus == ProductionStatus.New)
                {
                    // Do something, like stage this production
                }
            }
            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