ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Workflow.Models Namespace / JobsManager Class / GetJob Method / GetJob(String) Method
The ID of the job to get properties
Example

In This Topic
    GetJob(String) Method
    In This Topic
    Gets the properties of a job. This method must be called on the MCT. Use QueuedTask.Run
    Syntax
    public Job GetJob( 
       string jobID
    )
    Public Overloads Function GetJob( _
       ByVal jobID As String _
    ) As Job

    Parameters

    jobID
    The ID of the job to get properties

    Return Value

    The properties of a job
    Example
    How to get a job
    // GetJob returns an existing job
    // it is passed a valid job ID as an integer
    var wfCon = await WorkflowModule.ConnectAsync();
    var jobManager = wfCon.GetManager<JobsManager>();
    var job = jobManager.GetJob(jobID);
    How to access job info and change it
    // You can change many of the exposed properties of a job and then save them
    var wfCon = await WorkflowModule.ConnectAsync();
    var jobManager = wfCon.GetManager<JobsManager>();
    var job = jobManager.GetJob(jobID);
    job.Description = "This is a test";
    job.Save();
    How to Execute a step on a job
    // Gets the current step
    // checks to see if it can execute it
    // proceeds to do so if it can
    var wfCon = await WorkflowModule.ConnectAsync();
    var jobManager = wfCon.GetManager<JobsManager>();
    var job = jobManager.GetJob(jobID);
    string stepID = job.GetCurrentSteps().First();
    if (job.CanExecuteStep(stepID).Item1)
      job.ExecuteStep(stepID);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also