Summary
The WorkflowStep object provides access to the attributes of a step contained within a job Workflow.
Discussion
The WorkflowStep supports describing a step and navigating through the workflow.
Properties
Property | Explanation | Data Type |
ID (Read Only) | The ID of the WorkflowStep. | Integer |
name (Read Only) | The name of the WorkflowStep. | String |
nextSteps (Read Only) | A list of the WorkflowStep IDs that follow this step in the workflow. | Integer |
Code sample
WorkflowStep example 1
The following script searches a job's workflow for the step IDs corresponding to a specific step name, and also the step name corresponding to a specific step ID.
import arcpy
import arcpywmx
#Establish a connection to a Workflow database
conn = arcpywmx.Connect(r'c:\test\Workflow.jtc')
#Access a Job
job = conn.getJob(99999)
#Access a the job's workflow
workflow = job.getWorkflow()
#Access the first step in the workflow
step = workflow.steps[0]
#Print the name of the first step
print(step.name)
#Find the step IDs of all the steps named "Clean Up" in the workflow
stepIDs = [x.ID for x in workflow.steps if x.name == "Clean Up"]
#Print the step IDs of the steps named "Clean Up"
print(stepIDs)
#Find the step name of the step with the ID of 123
stepName = [y.name for y in workflow.steps if y.ID == 123]
#Print the name of the step with an ID of 123
print("The step name for ID 123 is " + stepName[0])