ExecuteStep(String) Method
Parameters
- stepID
- The ID of the step to execute. If no step is specified, the current step will be executed
Return Value
Information on the return code and errors during execution
Execute the current step and check for an exception
WorkflowExecutionResult result = job.ExecuteStep();
// Check if the step threw an exception
if (result.Exception != null)
{
// Throw it for a higher level to deal with
throw result.Exception;
}
if (result.HasReturnCode)
{
return result.ReturnCode;
}
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);
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.