JobTypeDescription

摘要

JobTypeDescription用于访问创建作业前可进行自定义的作业类型属性。

说明

可进行自定义并分配给正在创建的新作业的作业类型属性。

属性

属性说明数据类型
AOI
(可读写)

用作作业 AOI 的面对象。可提供面对象列表以创建多个作业。为所提供的每个面对象创建一个作业,然后该面将用于创建作业的 AOI。

旧版本:

该属性已弃用。使用 LOI 代替。

Polygon
assignedTo
(可读写)

作业分配到的用户名或组名。

String
assignedType
(可读写)

作业分配类型。下面是设置作业分配时会用到的有效字符串列表。

  • User工作流数据库中的用户
  • Group工作流数据库中的组
  • Unassigned无作业分配
String
autoCommitWorkflow
(可读写)

指示工作流是否在创建作业后自动做好执行准备。

  • True工作流将在创建作业后自动做好执行准备。
  • False工作流必须在创建作业后提交至数据库。
Boolean
autoExecuteOnCreate
(可读写)

指示作业是否将在创建后自动执行。

  • True作业将在创建后自动开始执行。
  • False作业不会在创建后自动开始执行。
Boolean
createdBy
(可读写)

将设置为作业创建者的用户名。

String
dataWorkspaceID
(可读写)

将设置为作业数据工作空间的数据工作空间的 ID。

String
description
(可读写)

有关作业类型的描述信息。

String
dueDate
(可读写)

要分配给作业的截止日期。

DateTime
extendedProperties
(可读写)

包含作业类型扩展属性表的字典。所有单个表均可通过表名作为各自的字典进行获取,并且新值将被添加至该表并在作业创建前保存回作业类型。以下是一个示例。

Dictionary
jobName
(可读写)

作业名称模板。

String
jobTypeName
(可读写)

用于创建作业的作业类型的名称。

String
LOI
(可读写)

用作作业 LOI 的几何对象。可提供面或点对象列表以创建多个作业。为所提供的每个点或面对象创建一个作业,然后使用几何创建作业的 LOI。

Geometry
ownedBy
(可读写)

身为作业所有者的用户。

String
parentJobID
(可读写)

将作为所创建作业父版本的作业的 ID。

Integer
parentJobName
(可读写)

将作为所创建作业父版本的作业的名称。

String
parentVersionName
(可读写)

将作为针对作业创建的父版本的版本名称。

String
prefix
(可读写)

添加至作业名称的前缀。

String
priority
(可读写)

创建作业后为其分配的优先级。

Integer
startDate
(可读写)

作业开始日期。

DateTime
suffix
(可读写)

添加至作业名称的后缀。

String
unionAOI
(可读写)

指示是否在合并 AOI 以创建一个或多个作业时传递面对象列表。

  • True工作流将在创建作业后自动做好执行准备。
  • False工作流必须在创建作业后提交至数据库。
旧版本:

该属性已弃用。使用 unionLOI 代替。

Boolean
unionLOI
(可读写)

指示是否在合并 LOI 以创建一个或多个作业时传递面或点对象列表。

  • True工作流将在创建作业后自动做好执行准备。
  • False工作流必须在创建作业后提交至数据库。
Boolean
versionName
(可读写)

将作为与作业关联的版本的版本名称。

String

代码示例

以下脚本可在作业创建之前获取作业类型描述并更新两个扩展属性表值。

import arcpy

#Establish a connection to a Workflow database
conn = arcpy.wmx.Connect(r'c:\test\Workflow.jtc')

#Get the Job Type description 
desc = conn.config.getJobTypeDescription(job_type_name="Extended Example")

#Get the Extended Properties dictionary for the Job Type
ext_prop = desc.extendedProperties

#Define new values to use for Extended Property's Name and Address
ext_prop_dict = {'NAME' : 'John Smith', 'ADDRESS' : '106 Everdale Drive' }

#Set the new values in the appropriate Extended Property table
ext_prop['TestDB.ExtendedTable'] = ext_prop_dict

#Apply the ext_prop dictionary back to the Job Type's desc object
desc.extendedProperties = ext_prop

#Create a Job using the new Job Type description
job = conn.createJob(job_type_description = desc)

#Get the Job's properties
job_props = job.getExtendedPropertyTable('TestDB.ExtendedTable')

#Print the new extended property Name value for the Job
print(str(job_props['NAME']))