ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Workflow.Models.JobModels Namespace / Job Class / CanExecuteStep Method
The ID of the step to execute. If no step is specified, the current step will be used
Example

In This Topic
    CanExecuteStep Method
    In This Topic
    Determines whether a step can be executed by the current user
    Syntax
    public Tuple<bool,string> CanExecuteStep( 
       string stepID
    )
    Public Function CanExecuteStep( _
       Optional ByVal stepID As String _
    ) As Tuple(Of Boolean,String)

    Parameters

    stepID
    The ID of the step to execute. If no step is specified, the current step will be used

    Return Value

    Tuple containing whether it can be executed and if not the reason why the step cannot be executed*
    Remarks
    A step can be executed if the job is assigned to the current user, it doesn't have an active hold, and it isn't closed.
    Example
    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, Windows 8.1

    See Also