Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Esri Developer

ArcGIS API for PythonAPI Reference

arcgis.gis.workflowmanager module

The arcgis.workflowmanager module contains classes and functions for working with a Workflow Manager installation.Workflow diagrams, job templates and jobs can be created, modified, or deleted. Information such as location,assignment, history and attachments for individual jobs can be accessed. Additionally, information about the variousroles, users, groups, and searches can be view, modified or created.

WorkflowManager

classarcgis.gis.workflowmanager.WorkflowManager(item)

Bases:object

Represents a connection to a Workflow Manager instance or item.

Users create, update, delete workflow diagrams, job templates and jobsor the various other properties with a workflow item.

Parameter

Description

item

Required string. The Workflow Manager Item

# USAGE EXAMPLE: Creating a WorkflowManager object from a workflow itemfromarcgis.gis.workflowmanagerimportWorkflowManagerfromarcgis.gisimportGIS# connect to your GIS and get the web map itemgis=GIS(url,username,password)wf_item=gis.content.get('1234abcd_workflow item id')# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)type(wm)>>arcgis.gis.workflowmanager.WorkflowManager# explore the users in this workflow using the 'users' propertywm.users>>[{}...{}]# returns a list of dictionaries representing each user
propertyassignable_groups

Get portal groups associated with Workflow Manager roles, to which the current usercan assign work based on their Workflow Manager assignment privileges.

Returns:

Alist ofthe assignableGroup objects

propertyassignable_users

Get all assignable users for a user in the workflow system

Returns:

Alist of the assignableuser objects

create_diagram(name:str,steps:list,display_grid:bool,description:str='',active:bool=False,annotations:list=[],data_sources:list=[],diagram_id:str|None=None,centralized_data_references:list=[],use_centralized_data_references:bool=False)

Adds a diagram to the Workflow Manager instance given a user-defined name and array of steps

Parameter

Description

name

Required string. Diagram Name

steps

Required list. List of Step objects associated with the Diagram

display_grid

Required boolean. Boolean indicating whether the grid will be displayed in theDiagram

description

Optional string. Diagram description

active

Optional Boolean. Indicates whether the Diagram is active

annotations

Optional list. List of Annotation objects associated with the Diagram

data_sources

Optional list. Spatial data that will be used in the steps of the diagram.Note: It is recommended to use centralizedDataReferences for new diagrams.Data sources are not supported in ArcGIS Online.

diagram_id

Optional string. The unique ID of the diagram to be created.

centralized_data_references

Optional list. The Centralized references to data and other content that will beused in the steps of the diagram. See details for CentralizedDataReference below

use_centralized_data_references

Optional boolean. Indicates that the diagram’s step configurations make use ofCentralizedDataReferences. Defaults to false. Note: It is recommended that thisis set to True for new diagrams

Returns:

WorkflowManagerDiagram ID

CentralizedDataReference Dictionary

Parameter

Description

id

Required string. The unique identifier of the data reference to be stored in the diagram.

alias

Required string. The unique name of the data reference to be stored in the diagram.

isValidated

Required boolean. Indicates whether the data reference has been validated.Note: Pro Items and Pro Commands are not validated.

referenceType

Required string. The type of data reference. Accepted values include FeatureService,Survey, GeoprocessingService, WebMap, ProProject, ProMapItem, ProSceneItem,ProTaskItem, ProLayoutItem, ProSystemToolboxItem, or ProCommand. Note: Geoprocessingservices must use either standaloneGPUrl or portalItem.

capabilities

Optional list. The capabilities of a branch versioned feature service. Valid valuesinclude SupportsBranchVersioning, SupportsCreateReplica, and SupportsDataQuality.

portalItem

Optional portalItem dict. The item information for the reference. Required forreferencesTypes set to FeatureService, Survey, WebMap, or ProProject. For moredetails, see PortalItem below.

proItemName

Optional string. The name of the Pro item. Required when the referenceType is setto ProMapItem, ProSceneItem, ProTaskItem, ProLayoutItem, or ProSystemToolboxItem

command

Optional string. The Pro command DAML id. Required when the referenceType is ProCommand.

standaloneGPUrl

Optional string. The service URL for the Geoprocessing Service. Required when thereferenceType is GeoprocessingService and portalItem is not defined.

# CentralizedDataReference Object Example 1:{"id":"50c6a626-2e45-4cfa-b149-3add455f9d72","alias":"ParcelFabricDataQuality","portalItem":{"itemId":"a64fdcf5e7b44a27bd98d098ca02ca57","portalType":"Current","portalUrl":null},"isValidated":true,"referenceType":"FeatureService","capabilities":["SupportsBranchVersioning","SupportsDataQuality"]}
# CentralizedDataReference Object Example 2:{"id":"f9f002b0-ea3e-49a3-b40c-5e08687282f0","alias":"GeocodingTools","portalItem":{"itemId":"7eacbbfff9a24bc0a7fc0e9d7b805ccd","portalType":"Current","portalUrl":null},"isValidated":true,"referenceType":"GeoprocessingService"}
# CentralizedDataReference Object Example 3:{"id":"b09ae444-3400-49ca-9a1b-1f3795332139","alias":"Echo Tool","isValidated":true,"referenceType":"GeoprocessingService","standaloneGPUrl":"https://example.esri.com/arcgis/rest/services/ProcessingTool/GPServer/ProcessingTool"}
# CentralizedDataReference Object Example 4:{"id":"e8e5c963-a485-4f5f-a298-dcf430f72c28","proItemName":"MyProMap","referenceType":"ProMapItem"}

PortalItem Object

Parameter

Description

itemId

Required string. The unique item identifier of the Portal item.

portalType

Optional string. The hosting Portal location of the data reference relative to theworkflow item. Accepted values include Current, ArcGIS Online, and Other. This valueis set to Current by default.

portalUrl

Optional string. Required when portalType is set to Other, the full URL includingWeb Adaptor for the Portal hosting the item.

create_job_template(name:str,priority:str,id:str=None,category:str='',job_duration:int=0,assigned_to:str='',default_due_date:str|None=None,default_start_date:str|None=None,start_date_type:str='CreationDate',diagram_id:str='',diagram_name:str='',assigned_type:str='Unassigned',description:str='',default_description:str='',state:str='Draft',last_updated_by:str='',last_updated_date:str|None=None,extended_property_table_definitions:list=[])

Adds a job template to the Workflow Manager instance given a user-defined name and default priority level

Parameter

Description

name

Required string. Job Template Name

priority

Required string. Default Job Template Priority Level

id

Optional string. Job Template ID

category

Optional string. Job Template Category

job_duration

Optional int. Default Job Template Duration

assigned_to

Optional string. Job Owner

default_due_date

Optional string. Due Date for Job Template

default_start_date

Optional string. Start Date for Job Template

start_date_type

Optional string. Type of Start Date (e.g. creationDate)

diagram_id

Optional string. Job Template Diagram ID

diagram_name

Optional string. Job Template Diagram Name

assigned_type

Optional string. Type of Job Template Assignment

description

Optional string. Job Template Description

default_description

Optional string. Default Job Template Description

state

Optional string. Default Job Template State

last_updated_by

Optional string. User Who Last Updated Job Template

last_updated_date

Optional string. Date of Last Job Template Update

extended_property_table_definitions

Optional list. List of Extended Properties for Job Template

Returns:

Workflow ManagerJobTemplate ID

create_lookup(lookup_type,lookups)

Adds a diagram to the Workflow Manager instance given a user-defined name and array of steps

Parameter

Description

lookup_type

Required string. The type of lookup table stored in the workflow item.

lookups

Required list. List of lookups to be created / updated

Returns:

Boolean

# USAGE EXAMPLE: Creating a Lookup Table# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)# create the lookups objectlookups=[{"lookupName":"Low","value":0},{"lookupName":"Medium","value":5},{"lookupName":"High","value":10},{"lookupName":"EXTRA","value":15},{"lookupName":"TEST","value":110}]wm.create_lookup("priority",lookups)>>True# returns true if created successfully
create_template(template_type:str,template_name:str,template_details:dict,template_id:str|None=None)

Returns the newly created template id.

Parameter

Description

template_type

Required string. The type of template stored in the workflow item.Create an email template by entering ‘email’, a Web Request Template by entering‘webRequest’, or enter your own value to define a custom template.

template_name

Required string. The new name to be given to the template

template_details

Required dict. The new information to be stored in the template

template_id

Optional string. The id of the template to be created

Returns:

Workflow ManagerTemplate ID

# USAGE EXAMPLE: Creating a Template# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)# create the template objectdetails={"to":["user@esri.com"],"cc":["boss@esri.com"],"bcc":["supervisor@esri.com"],"subject":"Workflow Manager Templates","body":"Look how easy it is to make an email template!","attachmentSelection":"None"}wm.create_template(template_type="email",template_name="Email Template",template_details=details)>>Ef42tu_QQMS-IgZc7pOPnQ# returns Template ID if created successfully
create_wm_role(name,description='',privileges=[])

Adds a role to the Workflow Manager instance given a user-defined name

Parameter

Description

name

Required string. Role Name (required)

description

Required string. Role Description

privileges

Required list. List of privileges associated with the role

Returns:

Workflow ManagerWMRole Object

delete_diagram(id:str)

Deletes a diagram object by ID

Parameter

Description

id

Required string. Diagram id

Returns:

WorkflowManagerDiagram ID

delete_diagram_version(diagram_id,version_id)

Deletes a diagram version by ID

Parameter

Description

diagram_id

Required string. Diagram ID

version_id

Required string. Diagram Version ID

Returns:

Boolean

delete_job_template(id:str)

Deletes a job template with the given ID

Parameter

Description

id

Required string. Job Template ID

Returns:

status code

delete_lookup(lookup_type)

Deletes a job template with the given ID

Parameter

Description

lookup_type

Required string. The type of lookup table stored in the workflow item.

Returns:

status code

delete_template(template_type:str,template_id:str)

Returns a boolean indicating whether or not the template has been deleted.

Parameter

Description

template_type

Required string. The type of template stored in the workflow item.Delete an email template by entering ‘email’, a Web Request Template by entering‘webRequest’, or enter your own value to delete a custom template.

template_id

Required string. The id of the template to be deleted

Returns:

Boolean

delete_wm_role(name:str)

Returns boolean indicating whether or not the role was deleted.

Parameter

Description

name

Required string. Role Name

Returns:

Boolean

diagram(id:str)

Returns thediagram with the given ID

Parameter

Description

id

Required string. Diagram ID

Returns:

Workflow ManagerJobDiagram Object

diagram_upgraded_version(diagram_id:str,version_id:str)

Get an upgraded version of a workflow diagram that uses centralized data references. If the version number doesnot exist, an error saying the specific diagram version does not exist is returned. The adminBasic oradminAdvanced privilege is required to get an upgraded diagram.

Note: You can upgrade a diagram by placing the transformedDiagram dictionary in the diagramparameter of update_diagram.

Parameter

Description

diagram_id

Required string. Diagram ID

version_id

Required string. Diagram Version ID

Returns:

Success Object

# USAGE EXAMPLE: Using the transformedDiagram from the result object to update a diagram.# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)upgrade_obj=wm.diagram_upgraded_version("gb1GBilqT4yk68Hfs5ghxw",diagram_version=1)# update diagram draftwm.update_diagram(body=upgrade_obj['transformedDiagram'])
# Success Object Example:{"transformedDiagram":{"diagramId":"gb1GBilqT4yk68Hfs5ghxw","diagramVersion":1,"diagramName":"Test New Diagram123 2024_12_13_11_59_54_764959","description":"Test Description","initialStepId":"1640baf9-f934-fd12-2b62-af6bfc2d0e87","initialStepName":"Start/End","steps":[{"id":"1640baf9-f934-fd12-2b62-af6bfc2d0e87","name":"Start/End","description":"Start and end of a workflow","stepTemplateId":"AVw8d6MdyiKjHtuS9dJ6","automatic":false,"proceedNext":true,"canSkip":false,"position":"0,0,100,50","shape":3,"color":"130, 202, 237","outlineColor":"130, 202, 237","labelColor":"black","action":{"actionType":"Manual"},"paths":[{"nextStep":"21bff5ee-1586-a635-30ea-86769f01ac93","points":[{"x":0,"y":26},{"x":0,"y":74}],"ports":["BOTTOM","TOP"],"assignedType":"Unassigned","notifications":[],"lineColor":"black"}],"helpUrl":"Start/End help url","helpText":"Start/End help text"}],"centralizedDataReferences":[],"displayGrid":true,"useCentralizedDataReferences":true},"modifiedStepIds":[],"failedStepIds":[],"modifiedDataSourceNames":[],"failedDataSourceNames":[]}
diagram_version(diagram_id:str,version_id:str)

Returns thediagram with the given version ID

Parameter

Description

diagram_id

Required string. Diagram ID

version_id

Required string. Diagram Version ID

Returns:

Specified version of the Workflow ManagerJobDiagram object

propertydiagrams

Gets the workflow diagrams within the workflow item.

Returns:

List of all currentdiagrams in the Workflow Manager

evaluate_arcade(expression:str,context:str|None=None,context_type:str='BaseContext',mode:str='Standard')

Evaluates an arcade expression

Parameter

Description

expression

Required String.

context

Optional String.

context_type

Optional String.

mode

Optional String.

Returns:

String

get_template(template_type:str,template_id:str)

Returns a Template by the given type and id

Parameter

Description

template_type

Required string. The type of template stored in the workflow item.Get an email template by entering ‘email’, a Web Request Template by entering‘webRequest’, or enter your own value to get a custom template.

template_id

Required string. The id of the template to be retrieved

Returns:

Workflow ManagerTemplate Object

# USAGE EXAMPLE: Get a Template# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)# get a templatewm.get_template(template_type="email",template_id="Ef42tu_QQMS-IgZc7pOPnQ")>>{"template_name":"Email Template","template_id":"Ef42tu_QQMS-IgZc7pOPnQ","template_details":{"to":["user@esri.com"],"cc":["boss@esri.com"],"bcc":["supervisor@esri.com"],"subject":"Workflow Manager Templates","body":"Look how easy it is to make an email template!","attachmentSelection":"None","attachmentFolder":null}}
group(group_id:str)

Returns group information with the given group ID

Parameter

Description

group_id

Required string. Workflow Manager Group ID

Returns:

Workflow ManagerGroup Object

propertygroups

Returns an list of all usergroupsstored in Workflow Manager

Returns:

List

job_template(id:str)

Returns a job template with the given ID

Parameter

Description

id

Required string. Job Template ID

Returns:

Workflow ManagerJobTemplate Object

propertyjob_templates

Gets all the job templates in a workflow item.

Returns:

List of all currentjobtemplatesin the Workflow Manager (required information for create_job call).

propertyjobs

The job manager for a workflow item.

Returns:

JobManager object

lookups(lookup_type)

Returns LookUp Tables by given type

Parameter

Description

lookup_type

Required string. The type of lookup table stored in the workflow item.

Returns:

Workflow ManagerLookUpTable Object

propertysaved_searches

The Saved Searches manager for a workflow item.

Returns:

SavedSearchesManager

searches(search_type:str|None=None)

Returns a list of all saved searches.

Parameter

Description

search_type

Optional string. The search type for returned saved searches.The accepted values areStandard,Chart, andAll. If notdefined, the Standard searches are returned.

Returns:

List

propertysettings

Returns a list of all settings for the Workflow Manager instance

Returns:

List

propertytable_definitions

Get the definitions of each extended properties table in a workflow item. The response will consist of a listof table definitions. If the extended properties table is a feature service, its definition will include adictionary of feature service properties. Each table definition will also include definitions of the propertiesit contains and list the associated job templates. This requires the adminBasic or adminAdvanced privileges.

Returns:

List

templates(template_type)

Returns Templates by given type

Parameter

Description

template_type

Required string. The type of template stored in the workflow item.Get the email templates by entering ‘email’, the Web Request Templates by entering‘webRequest’, or, enter your own value to get the custom templates.

Returns:

Workflow ManagerTemplate List

update_diagram(body,delete_draft:bool=True)

Updates a diagram object by ID

Parameter

Description

body

Required object. Diagram body - existing Diagram object that inherits required/optionalfields.

delete_draft

Optional Boolean - option to delete the Diagram draft (optional)

Returns:

success object

# USAGE EXAMPLE: Updating a diagram with centralized data references# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)# The update body contains only those fields we wish to update.updated_diagram_body={"diagramName":"Updated Diagram Name","description":"Updated","centralizedDataReferences":[{"id":"f9f002b0-ea3e-49a3-b40c-5e08687282f0","alias":"GeocodingTools","isValidated":true,"portalItem":{"itemId":"7eacbbfff9a24bc0a7fc0e9d7b805ccd","portalType":"Current"},"acceptsToken":true,"referenceType":"GeoprocessingService"},{"id":"5a3aa2d1-06ed-49fc-9c38-e1576d9cc5d2","alias":"Example Feature Service","portalItem":{"itemId":"a64fdcf5e7b44a27bd98d098ca02ca57","portalType":"Current","portalUrl":null},"isValidated":true,"referenceType":"FeatureService","capabilities":["SupportsBranchVersioning","SupportsDataQuality"]}]"useCentralizedDataReferences":True}wm.update_diagram(update_diagram_body,delete_draft=True)
update_group(group_id:str,update_object)

Update the information to the portal group. The adminAdvanced privilege is required.New roles can be added to the portal group. Existing roles can be deleted from the portal group.

Parameter

Description

group_id

Required string.WorkflowManagerGroup ID

update_object

Required object. Object containing the updated actions of the information to be taken to the portal group.

Returns:

Boolean

update_job_template(template)

Updates a job template object by ID

Parameter

Description

template

Required object.JobTemplatebody. Existing Job Template object that inherits required/optional fields.

Returns:

success object

update_settings(props:list)

Returns an active job with the given ID

Parameter

Description

props

Required list. A list of Props objects to update(Prop object example: {‘propName’: ‘string’, ‘value’: ‘string’})

Returns:

success object

update_template(template_type:str,template_id:str,template_name:str,template_details:str)

Returns a boolean indicating whether or not the template was updated.

Parameter

Description

template_type

Required string. The type of template stored in the workflow item.Update an email template by entering ‘email’, a Web Request Template by entering‘webRequest’, or enter your own value to update a custom template.

template_id

Required string. The id of the template to be updated

template_name

Required string. The new name to be given to the template

template_details

Required dict. The new information to be stored in the template

Returns:

Boolean

# USAGE EXAMPLE: Update a Template# update a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)# update the template objectdetails={"to":["user@esri.com"],"cc":["boss@esri.com"],"bcc":["supervisor@esri.com"],"subject":"Workflow Manager Templates","body":"Look how easy it is to make an email template!","attachmentSelection":"None"}wm.update_template(template_type="email",template_id='Ef42tu_QQMS-IgZc7pOPnQ'template_name="Email Template",template_details=details)>>True# returns True if updated successfully
user(username:str)

Returns a user profile with the given username

Parameter

Description

username

Required string. Workflow Manager Username

Returns:

Workflow Manager user profile

propertyusers

Returns an list of all user profiles stored in Workflow Manager

Returns:

List ofuser profiles

wm_role(name:str)

Returns an active role with the given name

Parameter

Description

name

Required string. Role Name

Returns:

Workflow ManagerRole Object

propertywm_roles

Returns a list of userroles availablein the local Workflow Manager instance.

Returns:

List

WorkflowManagerAdmin

classarcgis.gis.workflowmanager.WorkflowManagerAdmin(gis)

Bases:object

Represents a series of CRUD functions for Workflow Manager Items

Parameter

Description

gis

Optional GIS. The connection to the Enterprise.

create_item(name:str)tuple

Creates aWorkflow Manager schema that stores all the configurationinformation and location data in the data store on Portal. This canbe run by any user assigned to the administrator role in Portal.

For users that do not belong to the administrator role, thefollowing privileges are required to run Create Workflow Item:

Parameter

Description

name

Required String. The name of the new schema.

Returns:

string (item_id)

delete_item(item)

Delete a Workflow Manager schema. Does not delete the Workflow Manager Admin group.Requires the administrator or publisher role. If the user has the publisher role,the user must also be the owner of the item to delete.

Parameter

Description

id

Required Item. The Workflow Manager Item to be deleted

Returns:

success object

export_item(item,job_template_ids:str|None=None,diagram_ids:str|None=None,include_other_configs:bool=True,passphrase:str|None=None)

Exports a new Workflow Manager configuration (.wmc) file based on the indicated item. This configuration fileincludes the version, job templates, diagrams, roles, role-group associations, lookup tables, charts andqueries, templates, and user settings of the indicated item. This file can be used with the import endpointto update other item configurations. Configurations from Workflow items with a server that is on a morerecent version will not import due to incompatibility.

Argument

Description

item

Required Item. The Workflow Manager Item to be exported

job_template_ids

Optional. The job template(s) to be exported. If job template is exported,the associated diagram must be included to be exported.

diagram_ids

Optional. The diagram(s) to be exported. If not defined, all diagrams are exported.If defined as empty, no diagram is exported

include_other_configs

Optional. If false other configurations are not exported including templates,User defined settings, shared searches, shared queries, email settings etc.

passphrase

Optional. If exporting encrypted user defined settings, define a passphrase.If no passphrase is specified, the keys for encrypted user defined settings will beexported without their values.

Returns:

success object

propertyhealth_check

Checks the health of Workflow Manager Server and if the cluster is active (if applicable).

Returns:

Boolean

import_item(item,config_file,passphrase:str|None=None)

Imports a new Workflow Manager configuration from the selected .wmc file. Configurations from Workflowitems with a server that is on a more recent version will not import due to incompatibility. This willcompletely replace the version, job templates, diagrams, roles, role-group associations, lookup tables,charts and queries, templates, and user settings of the indicated item, and it is recommended to backup configurations before importing. Any encrypted settings included will only have their key importedand will need the value updated. Importing will fail if any jobs exist in the destination item.Excess scheduled tasks will be dropped based on the portal limit.

Argument

Description

item

Required Item. The Workflow Manager Item that to import the configuration to.

config_file

Required. The file path to the workflow manager configuration file.

passphrase

Optional. If importing encrypted user defined settings, specify the same passphraseused when exporting the configuration file. If no passphrase is specified, the keys forencrypted user defined settings will be imported without their values.

Returns:

success object

propertyserver_status

Gets the current status of the Workflow Manager Server

Returns:

Boolean

upgrade_item(item)

Upgrades an outdated Workflow Manager schema. Requires the Workflow ManagerAdvanced Administrator privilege or the Portal Admin Update Content privilege.

Parameter

Description

item

Required Item. The Workflow Manager Item to be upgraded

Returns:

success object

JobManager

classarcgis.gis.workflowmanager.JobManager(item,workflow_manager)

Bases:object

Represents a helper class for workflow manager jobs. Accessible as thejobs property of theWorkflowManager.

close(job_ids:list)

Closes a single or multiple jobs with specific Job IDs

Parameter

Description

job_ids

Required list of job ID strings

Returns:

success object

create(template:str,count:int=1,name:str|None=None,start:str|None=None,end:str|None=None,priority:str|None=None,description:str|None=None,owner:str|None=None,group:str|None=None,assigned:str|None=None,complete:str|None=None,notes:str|None=None,parent:str|None=None,location:Optional=None,extended_properties:dict|None=None,related_properties:dict|None=None,job_id:str|None=None)

Adds a job to the Workflow Manager instance given a user-defined template

Parameter

Description

template

Required object. Workflow Manager Job Template ID

count

Optional Integer Number of jobs to create

name

Optional string. Job Name

start

Optional string. Job Start Date

end

Optional string. Job End Date

priority

Optional string. Job Priority Level

description

Optional string. Job Description

owner

Optional string. Job Owner

group

Optional string. Job Assignment Group. The Assignment type of the job to becreated. Type of assignment designated Values: “User” | “Group” | “Unassigned”

assigned

Optional string. Initial Job Assignee

complete

Optional Integer Percentage Complete

notes

Optional string. Job Notes

parent

Optional string Parent Job

location

Optional Geometry or Workflow ManagerJobLocationDefine an area of location for your job.

extended_properties

Optional Dict. Define additional properties on a job templatespecific to your business needs.

related_properties

Optional Dict. Define additional 1-M properties on a job templatespecific to your business needs.

job_id

Optional string. Define the unique jobId of the job to be created.Once defined, only one job can be created.

Returns:

List of newly created job ids

delete(job_ids:list)

Deletes a single or multiple jobs with specific JobIDs

Parameter

Description

job_ids

Required list. A list of job ID strings

Returns:

success object

delete_attachment(job_id:str,attachment_id:str)

Deletes a job attachment given a job ID and attachment ID

Parameter

Description

job_id

Required string. Job ID

attachment_id

Required string. Attachment ID

Returns:

status code

diagram(id:str)

Returns the job diagram for the user-defined job

Parameter

Description

id

Required string. Job ID

Returns:

Workflow ManagerJobDiagram object

get(id:str,get_ext_props:bool=True,get_holds:bool=True)

Returns an active job with the given ID

Parameter

Description

id

Required string. Job ID

get_ext_props

Optional Boolean. If set to false the object will not include the jobs extended properties.

get_holds

Optional Boolean. If set to false the object will not include the jobs holds.

Returns:

Workflow ManagerJob Object

reopen(job_ids)

Reopens a single or multiple jobs with specific Job IDs

Parameter

Description

job_ids

Required list of job ID strings

Returns:

success object

search(query:str|None=None,search_string:str|None=None,fields:str|None=None,display_names:str|None=[],sort_by:str|None=[],num:int=10,start_num:int=0)

Runs a search against the jobs stored inside the Workflow Manager instance

Parameter

Description

query

Required string. SQL query to search against (e.g. “priority=’High’”)

search_str

Optional string. Search string to search against (e.g. “High”)

fields

Optional string. Field list to return

display_names

Optional string. Display names for the return fields

sort_by

Optional string. Field to sort by (e.g. {‘field’: ‘priority’, ‘sortOrder’: ‘Asc’})

num

Optional Integer. Number of return results

start_num

Optional string. Index of first return value

Returns:

List of search results

set_job_location(job_id,geometry)

Set a location of work for an existing job. jobUpdateLocation privilege is required to set a location on a job.

Parameter

Description

job_id

Required string. ID for the job to update

geometry

Required ArcGIS.Geometry.Geometry or Workflow ManagerJobLocationthat describes a Job’s Location. Must be a Polygon, Polyline, or Multipoint geometry type

Returns:

success object

statistics(query:str|None=None,search_str:str|None=None,group_by:str|None=None,spatial_extent:str|None=None,has_location:bool|None=None)

Runs a search against the jobs stored inside the Workflow Manager instance

Parameter

Description

query

Optional string. The SQL query for the search you want total number of records for.(e.g. “priority=’High’”) Must specify either query or search_str as a parameter.

search_str

Optional string. The match criteria for a simple search. (e.g. “High”)Must specify either search_str or query as a parameter.

group_by

Optional string. The search field that is used to separate counts by value.

spatial_extent

Optional string. Spatial extent string to filter jobs by their locations

has_location

Optional boolean. If set to true jobs with defined location in jobLocation are returned

Returns:

An object representing Workflow Manager job statistics

# USAGE EXAMPLE# create a Workflow Manager object from the workflow itemworkflow_manager=WorkflowManager(wf_item)user_query="diagramId='99o2QTePTqq-BHRHK_Aeag' "workflow_manager.jobs.statistics(query=user_query,group_by="assignedTo")# Example returned Job Statistics Object:{"total":2,"groupBy":"assignedTo","groupedValues":[{"value":"assignedTo",count": 2 } ]}
update(job_id:str,update_object:dict,allow_running_step_id:str|None=None)

Updates a job object by ID

Parameter

Description

job_id

Required string. ID for the job to update

update_object

Required dictionary. A dictionary containing the fields and newvalues to add to the job.

allow_running_step_id

Optional string. Allow updating job properties when the specifiedstep is running

Returns:

success object

# USAGE EXAMPLE: Updating a Job's properties# create a WorkflowManager object from the workflow itemworkflow_manager=WorkflowManager(wf_item)updates={'priority':'High'}updates['extended_properties']:[{"identifier":"table_name.prop1","value":"updated_123"},{"identifier":"table_name.prop2","value":"updated_456"},]workflow_manager.jobs.update(job_id,updates,'stepid123')
upgrade(job_ids:list)

Upgrades a single or multiple jobs with specific JobIDs

Parameter

Description

job_ids

Required list. A list of job ID strings

Returns:

success object

Job

classarcgis.gis.workflowmanager.Job(init_data,gis=None,url=None,workflow_manager=None)

Bases:object

Helper class for managing Workflow Manager jobs in a workflow item. This class isnot created by users directly. An instance of this class, can be created by callingtheget method of theJobManager with the appropriate job ID. TheJobManager is accessible as thejobs property of theWorkflowManager.

add_attachment(attachment:str,alias:str|None=None,folder:str|None=None)

Adds an attachment to the job

Parameter

Description

attachment

Filepath to attachment

alias

Optional string. Alias for the attachment

folder

Optional string. Folder for the attachment

Returns:

Job Attachment

add_comment(comment:str)

Adds a comment to the job

Parameter

Description

comment

Required string. Comment to add to job

Returns:

Workflow Manager Comment Id

add_hold(step_ids:list|None,dependent_job_id:str|None=None,dependent_step_id:str|None=None,hold_scheduled_release:str|None=None)

Applies a hold or a dependency to a step. The Run and Finish actions cannot be performedon the step until the dependent step is resolved, the ReleaseHold action is run or the holdScheduledReleased hasexpired. If there is not a holdScheduledReleased timestamp, the ReleaseHold action is required to remove thehold or dependency. If there are multiple holds or dependencies, they must all be released or expired for theRun and Finish actions to be performed. Cannot be applied if the step is already running or job is closed.

Parameter

Description

step_ids

Optional. The array of steps put on hold when adding a dependency hold.If not specified, the dependency hold is applied to all the active steps in the job.

dependent_job_id

Optional. A job that the current job is dependent on from being performed step actionsincluding Run and Finish

dependent_step_id

Optional. The step in the job that the current job is dependent on from being performedstep actions including Run and Finish.

hold_scheduled_release

Optional. The release timestamp for a scheduled hold. Once the current date and timehas passed the scheduled release timestamp, the hold will automatically release withoutrequiring the ReleaseHold action.

Returns:

success object

add_linked_attachment(attachments:list)

Add linked attachments to a job to provide additional or support information related to the job.Linked attachments can be links to a file on a local or shared file system or a URL.jobUpdateAttachments privilege is required to add an attachment to a job.

Parameter

Description

attachments

List of linked attachments to associate with the job.Each attachment should define the url, alias and folder

Returns:

List list of job attachments

propertyattachments

Gets the attachments of a job given job ID

Returns:

List of attachments

propertycomments

Gets the comments of a job given job ID

Returns:

List of comments

finish(step_ids:list|None=None)

Finishes the current step(s).

The step will not be finished under the following conditions:

  • Not assigned to the current user

  • No active step is defined

  • The job is closed

  • A step that cannot be skipped and has not been started or has been cancelled, will not be finished

  • A step cannot be set current if the job is running.

  • A step that has one or more holds will not run nor finish.

Argument

Description

step_ids

Optional list. The job’s active step ID or active parallel step IDs.If a step ID isn’t provided, the action is performed on the job’s current, active step(s).

Returns:

JobExecution

# USAGE EXAMPLE: Finish the current active steps# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)job=wm.jobs.get('job_id')# Will finish the current active steps, if no param is givenfinish_execution=job.finish()print(f'Result ={finish_execution.result()}')print(f'Status ={finish_execution.status}')print(f'Elapsed Time ={finish_execution.elapse_time}')print(f'Messages: ')forminfinish_execution.messages:print(m.message)
get_attachment(attachment_id:str)

Returns an embedded job attachment given an attachment ID

Parameter

Description

attachment_id

Attachment ID

Returns:

Job Attachment

propertyhistory

Gets the history of a job given job ID

Returns:

success object

propertylocation

Get/Set the job location for the user-defined job

Returns:

Workflow ManagerJobLocation object

release_hold(step_ids:list|None,dependent_job_id:str|None=None,dependent_step_id:str|None=None)

Releases a hold from a step, allowing the Run and Finish actions to be once again performed on the step.

Parameter

Description

step_ids

Optional. The array of steps on hold to be released. If not specified the releaseis applied to all the steps on hold.

dependent_job_id

Optional. A job that the current job is dependent on from being performed step actionsincluding Run and Finish.

dependent_step_id

Optional. The step in the job that the current job is dependent on from being performedstep actions including Run and Finish.

Returns:

success object

run(step_ids:list|None=None)

Starts running the current step(s). Running a step marks it as finished, if the step is set to proceed to next.

The step will not be started under the following conditions:

  • Not assigned to the current user

  • No active step is defined

  • The job is closed

  • A step that cannot be skipped and has not been started or has been cancelled, will not be finished

  • A step cannot be set current if the job is running.

  • A step that has one or more holds will not run nor finish.

Argument

Description

step_ids

Optional list. The job’s active step ID or active parallel step IDs.If a step ID isn’t provided, the action is performed on the job’s current, active step(s).

Returns:

JobExecution

# USAGE EXAMPLE: Run the current active steps# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)job=wm.jobs.get('job_id')# Will run the current active steps, if no param is given, i.e job.run()run_execution=job.run(step_ids=['stepid'])print(f'Result ={run_execution.result()}')print(f'Status ={run_execution.status}')print(f'Elapsed Time ={run_execution.elapse_time}')print(f'Messages:')forminrun_execution.messages:print(m.message)
set_current_step(step_id:str)

Sets a single step to be the active step on the job. The ability to set a step as current is controlled by theworkflowSetStepCurrent privilege.

Parameter

Description

step_id

Active Step ID

Returns:

success object

set_job_version(data_source_name=None,version_guid=None,version_name=None,administered=False,data_reference_id=None)

Sets the version of the job.

Argument

Description

data_source_name

The name of the data source for the job version to be set. Required if the job diagram is using the data sources format.

version_guid

Optional. The guid of the version to be set. If the value is null or not defined,the versionName must be defined. versionGuid is preferred to be defined for betterperformance.

version_name

Optional. The name of the version to be set. If the value is null or not defined,the versionGuid must be defined.

administered

Optional. If true, the version can be claimed. If not defined, the default value is false.

data_reference_id

The id of the data reference for the job version to be set. Required if the job diagram is using the data references format.

Returns:

success object

stop(step_ids:list|None=None)

Stops the current running step(s). The step(s) can be Run again or Finish can be used to complete it. In case ofGP step and question step, the processing of the step is cancelled. In case of manual and open app step,the step is paused. The step can be forced to stop by a user not assigned to the step with thejobForceStop privilege.

The step will not be stopped under the following conditions:

  • Not assigned to the current user

  • No active step is defined

  • The job is closed

  • A step that cannot be skipped and has not been started or has been cancelled, will not be finished

  • A step cannot be set current if the job is running.

  • A step that has one or more holds will not run nor finish.

Argument

Description

step_ids

Optional list. The job’s active step ID or active parallel step IDs.If a step ID isn’t provided, the action is performed on the job’s current, active step(s).

Returns:

JobExecution

# USAGE EXAMPLE: Stop the current active steps# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)job=wm.jobs.get('job_id')# Will stop the current active steps, if no param is givenstop_execution=job.stop()print(f'Result ={stop_execution.result()}')print(f'Status ={stop_execution.status}')print(f'Elapsed Time ={stop_execution.elapse_time}')print(f'Messages: ')forminstop_execution.messages:print(m.message)
update_attachment(attachment_id:str,alias:str)

Updates an attachment alias given a Job ID and attachment ID

Parameter

Description

attachment_id

Attachment ID

alias

Alias

Returns:

success

update_step(step_id:str,assigned_type:str,assigned_to:str)

Update the assignment of the current step in a job based on the current user’s Workflow Manager assignment privileges

Parameter

Description

step_id

Required String. Active Step ID

assigned_type

Required String. Type of assignment designatedValues: “User” | “Group” | “Unassigned”

assigned_to

Required String. User id to which the active step is assigned

Returns:

success object

# USAGE EXAMPLE: Updating a step assignment# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)job=wm.jobs.get('job_id')job.update_step(step_id='123456',assigned_type='User',assigned_to='my_user')

JobDiagram

classarcgis.gis.workflowmanager.JobDiagram(init_data,gis=None,url=None)

Bases:object

Helper class for managing Workflow Managerjobdiagramsin a workflowitem. This class is not created directly. An instancecan be created by calling thediagrams propertyof theWorkflowManager to retrieve a list of diagrams. Thenthediagram() method can be used with the appropriateID of the diagram to retrieve thejobdiagram.

JobLocation

classarcgis.gis.workflowmanager.JobLocation(init_data)

Bases:object

Represents a Workflow Manager Job Location object with accompanying GET, POST, and DELETE methods

Parameter

Description

init_data

Required object. Represents. relevant parameters for GET or POST calls

JobTemplate

classarcgis.gis.workflowmanager.JobTemplate(init_data,gis=None,url=None)

Bases:object

Represents a Workflow Manager Job Template object with accompanying GET, POST, and DELETE methods

Parameter

Description

init_data

data object representing relevant parameters for GET or POST calls

automated_creation(automation_id)

Returns the specified automated creation

Parameter

Description

automation_id

Required string. Automation Creation Id

Returns:

automated creation object.

propertyautomated_creations

Retrieve the list of created automations for a job template, including scheduled job creation and webhook.

Returns:

list of automatedCreations associated with the JobTemplate

share(group_ids)

Shares a job template with the list of groups

Parameter

Description

group_ids

Required list. List of Workflow Group Ids

Returns:

boolean

propertyshare_details

Returns the list of groups that the job_template is shared with by template_id.

Returns:

list ofGroup ID

update_automated_creation(adds=None,updates=None,deletes=None)

Creates an automated creation

Parameter

Description

adds

Optional List. The list of automated creations to create.

updates

Optional List. The list of automated creations to update

deletes

Optional List. The list of automated creation ids to delete

Returns:

success object

# USAGE EXAMPLE: Creating an automated creation for a job template# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)# create the props object with the required automation propertiesadds=[{"automationName":"auto_mation","automationType":"Scheduled","enabled":True,"details":"{"timeType":"NumberOfDays","dayOfMonth":1,"hour":8,"minutes":0}"}]updates=[{"automationId":"abc123","automationName":"automation_updated"}]deletes=["def456"]wm.update_automated_creation(adds,updates,deletes)>>True# returns true if created successfully

Group

classarcgis.gis.workflowmanager.Group(init_data)

Bases:object

Represents a Workflow Manager Group object with accompanying GET, POST, and DELETE methods

Parameter

Description

init_data

data object representing relevant parameters for GET or POST calls

SavedSearchesManager

classarcgis.gis.workflowmanager.SavedSearchesManager(item)

Bases:object

Represents a helper class for workflow manager saved searches. Accessible as thesaved_searches property.

Parameter

Description

item

The Workflow Manager Item

create(name:str,search_type:str,folder:str|None=None,definition:str|None=None,color_ramp:str|None=None,sort_index:str|None=None,search_id:str|None=None)

Create a saved search or chart by specifying the search parameters in the json body.All search properties except for optional properties must be passed in the body to save the search or chart.The adminAdvanced or adminBasic privilege is required.

Parameter

Description

name

Required string. The display name for the saved search or chart.

search_type

Required string. The type for the saved search or chart. The accepted values are Standard, Chart and All.

folder

Optional string. The folder the saved search or chart will be categorized under.

definition

Required string. if the searchType is Standard. The search definition to be saved.

color_ramp

Required string. if the searchType is Chart. The color ramp for the saved chart.

sort_index

Optional string. The sorting order for the saved search or chart.

search_id

Optional string. The unique ID of the search or chart to be created.

Returns:

Saved Search ID

delete(id:str)

Deletes a saved search by ID

Parameter

Description

id

Required string. Saved Search id

Returns:

Boolean

share(search_id,group_ids)

Shares a saved search with the list of groups

Parameter

Description

search_id

Required string. Saved Search id

group_ids

Required list. List of Workflow Group Ids

Returns:

Boolean

share_details(search_id)

Returns the list of groups that the saved search is shared with by searchId.

Parameter

Description

search_id

Search ID

Returns:

List ofGroup ID

update(search)

Update a saved search or chart by specifying the update values in the json body.All the properties except for optional properties must be passed in the bodyto update the search or chart. The searchId cannot be updated once it is created.The adminAdvanced or adminBasic privilege is required.

Parameter

Description

search

Required object. An object defining the properties of the search to be updated.

Returns:

success object

# USAGE EXAMPLE: Updating a search's properties# create a WorkflowManager object from the workflow itemworkflow_manager=WorkflowManager(wf_item)workflow_manager.create_saved_search(name="name",definition={"start":0,"fields":["job_status"],"displayNames":["Status"],"sortFields":[{"field":"job_status","sortOrder":"Asc:}]},search_type='Chart',color_ramp='Flower Field Inverse',sort_index=2000)search_lst=workflow_manager.searches("All")search=[xforxinsearch_lstifx["searchId"]==searchid][0]search["colorRamp"]="Default"search["name"]="Updated search"actual=workflow_manager.update_saved_search(search)

LookUpTable

classarcgis.gis.workflowmanager.LookUpTable(init_data,gis=None,url=None)

Bases:object

Represents a Workflow Manager Look Up object with accompanying GET, POST, and DELETE methods.

Parameter

Description

init_data

data object containing the relevant properties for a LookUpTable to complete REST calls

Template

classarcgis.gis.workflowmanager.Template(template_name,template_id,template_details,gis=None,url=None)

Bases:object

Represents a Workflow Manager Template object with accompanying GET, POST, and DELETE methods.

Parameter

Description

template_name

The template name

template_details

The details of the template

template_id

The template ID

WMRole

classarcgis.gis.workflowmanager.WMRole(init_data)

Bases:object

Represents a Workflow Manager Role object with accompanying GET, POST, and DELETE methods

Parameter

Description

init_data

data object representing relevant parameters for GET or POST calls

Notification

classarcgis.gis.workflowmanager.Notification(init_data)

Bases:object

Represents a Workflow Manager Notification object. The Notification contains theMessageType, the message object and the timestamp the notification was received

Parameter

Description

init_data

data object representing relevant properties of a notification

# USAGE EXAMPLE: Print Notification Properties# create a WorkflowManager object from the workflow itemwm=WorkflowManager(wf_item)job=wm.jobs.get('job_id')run_execution=job.run(step_ids=['stepid'])print(f'Result ={run_execution.result()}')print(f'Messages:')forminrun_execution.messages:print(m.msg_type)print(m.message)print(m.timestamp)

JobExecution

classarcgis.gis.workflowmanager.JobExecution(job:Job,execution_type:ExecutionType)

Bases:object

Represents a single step executing in a workflow manager job. TheJobExecution class allows for the asynchronousoperation of an executing step. The status of the step execution can then be queried by the class properties,status, result, elapse_time and messages. This class is not intended for users to call directly.

Seerun,stop orfinish for examples.

Parameter

Description

job

RequiredJob The job to execute

execution_type

RequiredExecutionType. The execution type

done()

Returns a boolean indicating whether the execution is done.

Returns:

boolean

propertyelapse_time

Get the amount of time that passed while theJobExecution ran.

propertymessages

Gets the messages collected during execution

Returns:

List ofNotification

result(timeout:int|None=300)

Returns the lastNotification message received at the end of the execution

Parameter

Description

timeout

Optional integer. The timeout argument specifies a timeout for the operation in seconds.

Returns:

string

running()

Returns a boolean indicating whether the execution is running.

Returns:

boolean

propertystatus

Returns the execution status

Returns:

string

MessageType

classarcgis.gis.workflowmanager.MessageType(value,names=None,*,module=None,qualname=None,type=None,start=1,boundary=None)

Bases:Enum

The Workflow Manager Message Types

This enum class represents the list of all possible message types when sending or receiving messages.

CREATED='CREATED'
ERROR='ERROR'
JOB_ATTACHMENT_UPDATED='JOBATTACHMENTUPDATED'
JOB_COMMENT_UPDATED='JOBCOMMENTUPDATED'
JOB_LOCATION_UPDATED='JOBLOCATIONUPDATED'
JOB_STATE='JOBSTATE'
JOB_UPDATED='JOBUPDATED'
STEP_CANCELLED='STEPCANCELLED'
STEP_ERROR='STEPERROR'
STEP_FINISHED='STEPFINISHED'
STEP_HELD='STEPHELD'
STEP_HOLD_RELEASED='STEPHOLDRELEASED'
STEP_INFORMATION='STEPINFORMATION'
STEP_INFO_REQUIRED='STEPINFOREQUIRED'
STEP_PAUSED='STEPPAUSED'
STEP_PROGRESS='STEPPROGRESS'
STEP_REASSIGNED='STEPREASSIGNED'
STEP_STARTED='STEPSTARTED'
STEP_STOPPED='STEPSTOPPED'
STEP_STOPPING='STEPSTOPPING'
STEP_WARNING_STOPPED='STEPWARNINGSTOPPED'

ExecutionStatus

classarcgis.gis.workflowmanager.ExecutionStatus(value,names=None,*,module=None,qualname=None,type=None,start=1,boundary=None)

Bases:Enum

The Workflow Manager Execution Statuses

This enum class represents the possible step execution statuses.

COMPLETE='COMPLETE'
RUNNING='RUNNING'

Your browser is no longer supported. Please upgrade your browser for the best experience. See ourbrowser deprecation post for more details.


[8]ページ先頭

©2009-2025 Movatter.jp