Job

サマリー

The Job object provides access to properties and methods to interact with a Workflow Manager (Classic) job.

説明

A Job is a single unit of work that is carried out within an organization. It may have one or many people working on it. It can work with a single dataset, multiple datasets, or no data at all. A Job is created based on a template known as a Job Type, which is configured with the desired properties and components (such as the Workflow and Maps) that will be used in the job.

プロパティ

プロパティ説明データ タイプ
assignedTo
(読み書き)

The user name or group to which the job is assigned.

String
assignedType
(読み書き)

The type of assignment for the job. Below is a list of valid strings to use when setting the job assignment. If an invalid string is used, the job will default to unassigned.

  • UserA user in the workflow database
  • GroupA group in the workflow database
  • UnassignedNo job assignment
String
createdBy
(読み書き)

The user name of the user who created the job.

String
createdDate
(読み取り専用)

Returns the date the job was created.

DateTime
currentSteps
(読み取り専用)

Returns a list of step IDs representing the steps that are active in the workflow.

List
description
(読み書き)

The description of the job.

String
dueDate
(読み書き)

The date the job was scheduled to end.

DateTime
endDate
(読み取り専用)

Returns the date the job ended.

DateTime
hasAOI
(読み取り専用)

Returns True when the job has an area of interest defined.

レガシー:

This method has been deprecated. Use hasLOI instead.

Boolean
hasLOI
(読み取り専用)

Returns True when the job has a location of interest (point or polygon) defined.

Boolean
ID
(読み取り専用)

Returns the job ID.

Integer
jobTypeID
(読み取り専用)

Gets the ID of the job type for the job.

Integer
name
(読み書き)

The job's name.

String
notes
(読み書き)

The notes associated with the job to share information with other users.

String
owner
(読み書き)

The user name of the user who owns the job.

String
parent
(読み書き)

The ID of the parent job for the current job.

Integer
parentVersion
(読み書き)

The name of the parent version of the job.

String
percentComplete
(読み取り専用)

Returns the percent completion for the job.

Double
priority
(読み書き)

The priority of the job.

Integer
startDate
(読み書き)

The date the job was scheduled to start.

DateTime
startedDate
(読み取り専用)

Returns the date the job was started.

DateTime
status
(読み書き)

The status name for the job. The statuses available for use are those defined as status types in the database.

String
versionExists
(読み取り専用)

Returns True when a version exists for a job.

Boolean
versionName
(読み書き)

The name of the version for the job.

String

方法の概要

方法説明
addAttachment (storage_type, source_location)

Adds an attachment to the job.

addDependency (depends_on_job_id, {held_on_type}, {held_on_value}, {dependent_on_type}, {dependent_on_value})

Adds a dependency to a job to restrict progression of the job past a certain point until another job has progressed past a given point.

addHold (hold_type_id, {comment})

Adds a hold to a job to suspend job activity.

deleteAttachment (attachment_id)

Deletes an attachment associated with the job.

deleteJobMap ()

Deletes the job map associated with the job.

executeStep ({step_id}, {callback})

Executes a step in the workflow.

getAttachments ()

Returns all attachments associated with the job as a list of Attachment objects.

getExtendedPropertyTable (tableName)

Returns a single extended property table based on its fully qualified table name.

getHolds ()

Returns the holds associated with the job as a list of Hold objects.

getPendingDays (consider_hold)

Returns the number of days that the job has been pending. This can also optionally consider the holds and subtract them from the number of days the job was pending.

getWorkflow (jobID)

Returns a job's Workflow using the job ID.

listExtendedProperties ()

Lists the fully qualified name of all extended property and linked property tables associated with the job.

logActivity (activity_type, {message})

Logs an activity in the job history to describe an action on the job.

markStepAsComplete ({step_id}, {callback})

Marks a step in the workflow as complete.

releaseHold (hold, {comment})

Releases the hold associated with a job and marks it as an inactive hold.

retrieveAttachment (attachment_id, destination_location)

Retrieves the file attachments associated with the job to a location on disk.

retrieveJobMap (destination_location)

Retrieves the job map to a location on disk.

save ()

Saves any changes made to the job back to the Workflow Manager (従来版) database.

sendNotification (notification_type)

Sends a notification based on an event in the job life cycle.

setAOI (aoi)

Sets the area of interest (AOI) polygon for the job.

レガシー:

This method has been deprecated. Use setLOI instead.

setDataWorkspace (data_workspace_id)

Sets the data workspace for the job.

setLOI (loi)

Sets the location of interest (LOI) for the job. The LOI can be either a point (POI) or polygon (AOI).

setStepAsCurrent (step_id)

Sets a step in the workflow as the current active step.

storeJobMap (source_location)

Saves a map in the Workflow Manager (Classic) database and associates it to the job as the job map to be used for editing.

方法

addAttachment (storage_type, source_location)
パラメーター説明データ タイプ
storage_type

The type of attachment to be added.

  • EMBEDDEDThe file is stored in the Workflow Manager (Classic) database.
  • LINKEDThe link to the file path is stored in the Workflow Manager (Classic) database.
  • URLThe URL link is stored in the database.
String
source_location

The file path or URL for the attachment to be added.

String

The attachments provide a way to add information to the job. The following types of attachments can be added to a job:

  • Embedded—The file is stored in the Workflow Manager (Classic) database.
  • Linked—The link to the file path is stored in the Workflow Manager (Classic) database.
  • URL—The URL link is stored in the database.

addDependency (depends_on_job_id, {held_on_type}, {held_on_value}, {dependent_on_type}, {dependent_on_value})
パラメーター説明データ タイプ
depends_on_job_id

ID of the job on which the current job will depend.

Integer
held_on_type

Indicates whether the current job (to which the dependency is being added) will be held at a step or status. When the job is held at a step, the step cannot be executed until the dependency is released. When the job is held at a status, the job's status cannot change until the dependency is released. The dependency is released when the other job reaches the step or status as defined in the dependency criteria.

(デフォルト値は次のとおりです STEP)

String
held_on_value

The value of the step or status at which the current job will be held. This value can be the ID of a step as an integer or job status as a string.

Variant
dependent_on_type

Indicates whether the current job (to which the dependency is being added) will be dependent on a step or status of the other job. When the dependent job is held at a step or status of the other job, the dependent job cannot progress until the other job reaches the step or status defined in the dependency. Once the other job reaches step or status as defined in the dependency criteria the dependency is released and the dependent job can progress.

(デフォルト値は次のとおりです STATUS)

String
dependent_on_value

The value of the step or status of the other job on which the current job will be dependent. This value can be the ID of a step as an integer or job status as a string.

(デフォルト値は次のとおりです CLOSED)

Variant

Job dependencies allow you to model relationships between jobs, allowing you to restrict progress of a job until another job has progressed past a certain point. Restrictions can be placed on the following parts of a job: Status or Step.

When the job that is restricting the workflow of another reaches the point defined in the dependency, the restricted job is automatically released and is able to work.

addHold (hold_type_id, {comment})
パラメーター説明データ タイプ
hold_type_id

The ID of the hold type template to be used to create the job hold.

Integer
comment

The comment to be stored as a reason for adding the hold.

String

Holds suspend the job activity for an indefinite amount of time until it is released. A hold can be applied to a job for reasons including the following:

  • Insufficient funding
  • Technical problems
  • Missing data
  • Lack of resources

deleteAttachment (attachment_id)
パラメーター説明データ タイプ
attachment_id

The ID of the attachment to be deleted.

Integer

The attachments provide a way to add information to the job.

deleteJobMap ()

The job map has the layers used for editing required as part of the job.

executeStep ({step_id}, {callback})
パラメーター説明データ タイプ
step_id

The ID of the step to be executed. The step ID is optional; if a step ID is not provided, the current step will be executed.

Integer
callback

The callback argument passes a function that prompts the user for a response based on input from the step type. When executing a question step, for example, the callback takes the possible step response options and allows the user to choose the next step. It is also used when the next step in the workflow cannot be determined so a user can select the path to follow.

Function
戻り値
データ タイプ説明
WorkflowExecutionResult

Returns a WorkflowExecutionResult object, which stores the step's return code.

Provides a way to execute a step in the workflow.

getAttachments ()
戻り値
データ タイプ説明
Attachment

The attachments associated with the job are returned as a list of Attachment objects.

The attachments provide a way to add information to the job. The following types of attachments can be added to a job:

  • Embedded—The file is stored in the Workflow Manager (Classic) database.
  • Linked—The link to the file path is stored in the Workflow Manager (Classic) database.
  • URL—The URL link is stored in the database.

getExtendedPropertyTable (tableName)
パラメーター説明データ タイプ
tableName

The fully qualified table name of the extended property table to be returned.

String
戻り値
データ タイプ説明
ExtendedProperty

Returns the extended property table as the ExtendedProperty object.

The business-specific information stored as part of the job as extended properties are returned as the ExtendedProperty object.

getHolds ()
戻り値
データ タイプ説明
Hold

The job holds returned as a list of Hold objects.

Holds suspend the job activity for an indefinite amount of time until it is released. A hold may be applied to a job for reasons including the following:

  • Insufficient funding
  • Technical problems
  • Missing data
  • Lack of resources
The information about a Hold is never deleted from the system and can be queried.

getPendingDays (consider_hold)
パラメーター説明データ タイプ
consider_hold

Flag to determine whether to consider the holds when calculating the number of pending days.

Boolean
戻り値
データ タイプ説明
Integer

Returns the number of days the job has been pending.

Pending days refers to the number of days the job has been worked on or the number of days the job has been pending before being completed. The start date used for the calculation is either the Start Date if it was set or the Created Date otherwise. The end date for the calculation is either the current date or the End Date if the job is closed.

getWorkflow (jobID)
パラメーター説明データ タイプ
jobID

The ID of the job.

Integer
戻り値
データ タイプ説明
Object

Returns the workflow as a Workflow object.

Provides an easy way to retrieve a job's workflow.

listExtendedProperties ()
戻り値
データ タイプ説明
String

List of fully qualified names of all extended property and linked property tables associated with the job.

The names of tables that store business-specific information with the job as extended properties and linked properties can be retrieved.

logActivity (activity_type, {message})
パラメーター説明データ タイプ
activity_type

The ID or the name of an ActivityType.

String
message

The custom message to be appended to the existing message in the ActivityType.

String

The Job history contains a log of everything that has happened throughout the life of the job. Each of the items in the log are time stamped with the time of entry and stamped with the current user at that time. A message is also stored along with the record, explaining what happened at that point in time.

markStepAsComplete ({step_id}, {callback})
パラメーター説明データ タイプ
step_id

The ID of the step to be marked as complete. The step ID is optional; if a step ID is not provided, the current step will be executed.

Integer
callback

The callback argument passes a function that prompts the user for a response based on input from the step type. When marking a question step complete, for example, the callback takes the possible step response options and allows the user to choose the next step. It is also used when the next step in the workflow cannot be determined so a user can select the path to follow.

Function

Provides a way to mark a step as complete.

releaseHold (hold, {comment})
パラメーター説明データ タイプ
hold

The hold to be released provided as a Hold object.

Hold
comment

The comment to be stored as a reason for releasing the hold.

String

The hold suspends the job activity for an indefinite amount of time until it is released. Once a hold is released, the information about it is never deleted from the system and can be queried.

retrieveAttachment (attachment_id, destination_location)
パラメーター説明データ タイプ
attachment_id

The ID of the attachment to be retrieved.

Integer
destination_location

The folder location where the attachment will be stored. A name for the file to be saved with or without the file extension can also be provided. If no name is provided, the attachment is saved with the default name stored with the job.

String

The attachments provide a way to add information to the job. The following types of attachments can be retrieved from a job:

  • Embedded—The file is stored in the Workflow Manager (Classic) database.
  • Linked—The link to the file path is stored in the Workflow Manager (Classic) database. It can be retrieved only if you have access to the file path.

retrieveJobMap (destination_location)
パラメーター説明データ タイプ
destination_location

The folder location where the job map will be stored. A name for the map to be saved can also be provided. If no name is provided the job map is saved with the default naming scheme defined for the job map.

String

The job map has the layers used for editing required as part of the job.

save ()
sendNotification (notification_type)
パラメーター説明データ タイプ
notification_type

The name of the notification type template to be used to send the email notification associated with the job.

String

Email notification can be triggered during the life cycle of a job to provide information about an event related to the job. Examples of sending notifications include the following:

  • Job assigned or reassigned
  • Job created
  • Job closed

setAOI (aoi)
パラメーター説明データ タイプ
aoi

The AOI polygon to be assigned to the job.

Geometry

Define's an area of interest for a job. To get a job's area of interest polygon, use the Get Job AOI tool.

setDataWorkspace (data_workspace_id)
パラメーター説明データ タイプ
data_workspace_id

The GUID of the data workspace to be made active for the job.

String

Set the data workspace for a job. To get a job's data workspace, use the Get Job Data Workspace tool.

setLOI (loi)
パラメーター説明データ タイプ
loi

The point or polygon to be assigned as the location of interest for the job.

Geometry

Defines the location of interest for a job. To get a job's location of interest, use the Get Job AOItool.

setStepAsCurrent (step_id)
パラメーター説明データ タイプ
step_id

The ID of the step to be set as the current step.

Integer

Provides a way to set a step in the workflow as the current active step.

storeJobMap (source_location)
パラメーター説明データ タイプ
source_location

The file path that has the map to be stored in the Workflow Manager (Classic) database.

String

The job map has the layers used for editing required as part of the job.