WorkflowPath

摘要

WorkflowPath 对象可用于访问作业 Workflow 中包含的路径的属性。

说明

WorkflowPath 对象支持通过工作流描述路径并导航。

属性

属性说明数据类型
description
(只读)

路径描述,也称为路径名称。

String
fromStep
(只读)

作为路径起始点的 WorkflowStep 对象 ID。

Integer
toStep
(只读)

作为路径终点的目的地 WorkflowStep 对象 ID。

Integer

代码示例

WorkflowPath 示例

以下脚本将获取工作流路径的描述以及进入与离开路径步骤的步骤 ID。

import arcpy

#Establish a connection to a Workflow database
conn = arcpy.wmx.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]

#Access the paths following the first step in the workflow
paths = step.nextSteps

#Access the first path and print the ID of the step it leads to
path = paths[0]

print('The ID of the step that follows the first step is ' + path.toStep)