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 various roles, users, groups, and searches can be view, modified or created.
WorkflowManager¶
-
class
arcgis.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 jobs or 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 item from arcgis.gis.workflowmanager import WorkflowManager from arcgis.gis import GIS # connect to your GIS and get the web map item gis = GIS(url, username, password) wf_item = gis.content.get('1234abcd_workflow item id') # create a WorkflowManager object from the workflow item wm = WorkflowManager(wf_item) type(wm) >> arcgis.gis.workflowmanager.WorkflowManager # explore the users in this workflow using the 'users' property wm.users >> [{}...{}] # returns a list of dictionaries representing each user
-
property
assignable_groups
¶ Get portal groups associated with Workflow Manager roles, to which the current user can assign work based on their Workflow Manager assignment privileges.
-
property
assignable_users
¶ Get all assignable users for a user in the workflow system
- Returns
A list of the assignable
user
objects
-
create_diagram
(name, steps, display_grid, description='', active=False, annotations=[], data_sources=[], diagram_id=None)¶ 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 the Diagram
description
Optional string. Diagram description
active
Optional Boolean. Indicates whether the Diagram is active
annotations
Optinal list. List of Annotation objects associated with the Diagram
data_sources
Optional list. List of Data Source objects associated with the Diagram
diagram_id
Optional string. The unique ID of the diagram to be created.
- Returns
-
create_job_template
(name, priority, id=None, category='', job_duration=0, assigned_to='', default_due_date=None, default_start_date=None, start_date_type='CreationDate', diagram_id='', diagram_name='', assigned_type='Unassigned', description='', default_description='', state='Draft', last_updated_by='', last_updated_date=None, extended_property_table_definitions=[])¶ 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 Manager
JobTemplate
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 item wm = WorkflowManager(wf_item) # create the lookups object lookups = [{"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_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 Manager
WMRole
Object
-
delete_diagram
(id)¶ Deletes a diagram object by ID
Parameter
Description
id
Required string. Diagram id
- Returns
-
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)¶ 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
-
diagram
(id)¶ Returns the
diagram
with the given IDParameter
Description
id
Required string. Diagram ID
- Returns
Workflow Manager
JobDiagram
Object
-
diagram_version
(diagram_id, version_id)¶ Returns the
diagram
with the given version IDParameter
Description
diagram_id
Required string. Diagram ID
version_id
Required string. Diagram Version ID
- Returns
Specified version of the Workflow Manager
JobDiagram
object
-
property
diagrams
¶ Gets the workflow diagrams within the workflow item.
-
evaluate_arcade
(expression, context=None, context_type='BaseContext', mode='Standard')¶ Evaluates an arcade expression
Parameter
Description
expression
Required String.
context
Optional String.
context_type
Optional String.
mode
Optional String.
- Returns
String
-
group
(group_id)¶ Returns group information with the given group ID
Parameter
Description
group_id
Required string. Workflow Manager Group ID
- Returns
Workflow Manager
Group
Object
-
job_template
(id)¶ Returns a job template with the given ID
Parameter
Description
id
Required string. Job Template ID
- Returns
Workflow Manager
JobTemplate
Object
-
property
job_templates
¶ Gets all the job templates in a workflow item.
- Returns
List of all current
job templates
in the Workflow Manager (required information for create_job call).
-
property
jobs
¶ 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 Manager
LookUpTable
Object
-
property
saved_searches
¶ The Saved Searches manager for a workflow item.
- Returns
-
searches
(search_type=None)¶ Returns a list of all saved searches.
Parameter
Description
search_type
Optional string. The search type for returned saved searches. The accepted values are Standard, Chart, and All. If not defined, the Standard searches are returned.
- Returns
-
property
table_definitions
¶ Get the definitions of each extended properties table in a workflow item. The response will consist of a list of table definitions. If the extended properties table is a feature service, its definition will include a dictionary of feature service properties. Each table definition will also include definitions of the properties it contains and list the associated job templates. This requires the adminBasic or adminAdvanced privileges.
- Returns
-
update_diagram
(body, delete_draft=True)¶ Updates a diagram object by ID
Parameter
Description
body
Required object. Diagram body - existing Diagram object that inherits required/optional fields.
delete_draft
Optional Boolean - option to delete the Diagram draft (optional)
- Returns
success object
-
update_group
(group_id, 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.
Workflow Manager Group
IDupdate_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.
Job Template
body. Existing Job Template object that inherits required/optional fields.- Returns
success object
-
update_settings
(props)¶ 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
-
user
(username)¶ Returns a user profile with the given username
Parameter
Description
username
Required string. Workflow Manager Username
- Returns
Workflow Manager user profile
-
property
users
¶ Returns an list of all user profiles stored in Workflow Manager
- Returns
List of
user
profiles
-
property
WorkflowManagerAdmin¶
-
class
arcgis.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)¶ Creates a Workflow Manager schema that stores all the configuration information and location data in the data store on Portal. This can be run by any user assigned to the administrator role in Portal.
For users that do not belong to the administrator role, the following 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=None, diagram_ids=None, include_other_configs=True, passphrase=None)¶ Exports a new Workflow Manager configuration (.wmc) file based on the indicated item. This configuration file includes the version, job templates, diagrams, roles, role-group associations, lookup tables, charts and queries, templates, and user settings of the indicated item. This file can be used with the import endpoint to update other item configurations. Configurations from Workflow items with a server that is on a more recent version will not import due to incompatability.
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 be exported without their values.
- Returns
success object
-
property
health_check
¶ Checks the health of Workflow Manager Server and if the cluster is active (if applicable).
- Returns
Boolean
-
import_item
(item, config_file, passphrase=None)¶ Imports a new Workflow Manager configuration from the selected .wmc file. Configurations from Workflow items with a server that is on a more recent version will not import due to incompatability. This will completely 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 back up configurations before importing. Any encrypted settings included will only have their key imported and 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 passphrase used when exporting the configuration file. If no passphrase is specified, the keys for encrypted user defined settings will be imported without their values.
- Returns
success object
-
property
server_status
¶ Gets the current status of the Workflow Manager Server
- Returns
Boolean
-
upgrade_item
(item)¶ Upgrades an outdated Workflow Manager schema. Requires the Workflow Manager Advanced 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¶
-
class
arcgis.gis.workflowmanager.
JobManager
(item)¶ Bases:
object
Represents a helper class for workflow manager jobs. Accessible as the
jobs
property of theWorkflowManager
.Parameter
Description
item
The Workflow Manager Item
-
close
(job_ids)¶ 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, count=1, name=None, start=None, end=None, priority=None, description=None, owner=None, group=None, assigned=None, complete=None, notes=None, parent=None, location=None, extended_properties=None, related_properties=None, job_id=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 be created. 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 Manager
JobLocation
Define an area of location for your job.extended_properties
Optional Dict. Define additional properties on a job template specific to your business needs.
related_properties
Optional Dict. Define additional 1-M properties on a job template specific 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)¶ 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, attachment_id)¶ 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)¶ Returns the job diagram for the user-defined job
Parameter
Description
id
Required string. Job ID
- Returns
Workflow Manager
Job Diagram
object
-
get
(id, get_ext_props=True, get_holds=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 Manager
Job
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=None, search_string=None, fields=None, display_names=[], sort_by=[], num=10, start_num=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 Manager
JobLocation
that describes a Job’s Location. Must be a Polygon, Polyline, or Multipoint geometry type- Returns
success object
-
statistics
(query=None, search_str=None, group_by=None, spatial_extent=None, has_location=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 item workflow_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, update_object, allow_running_step_id=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 new values to add to the job.
allow_running_step_id
Optional string. Allow updating job properties when the specified step is running
- Returns
success object
# USAGE EXAMPLE: Updating a Job's properties # create a WorkflowManager object from the workflow item workflow_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)¶ 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¶
-
class
arcgis.gis.workflowmanager.
Job
(init_data, gis=None, url=None)¶ Bases:
object
Helper class for managing Workflow Manager jobs in a workflow item. This class is not created by users directly. An instance of this class, can be created by calling the
get
method of theJobManager
with the appropriate job ID. TheJobManager
is accessible as thejobs
property of theWorkflowManager
.-
add_attachment
(attachment, alias=None, folder=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)¶ 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, dependent_job_id=None, dependent_step_id=None, hold_scheduled_release=None)¶ Applies a hold or a dependency to a step. The Run and Finish actions cannot be performed on the step until the dependent step is resolved, the ReleaseHold action is run or the holdScheduledReleased has expired. If there is not a holdScheduledReleased timestamp, the ReleaseHold action is required to remove the hold or dependency. If there are multiple holds or dependencies, they must all be released or expired for the Run 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 actions including Run and Finish
dependent_step_id
Optional. The step in the job that the current job is dependent on from being performed step actions including Run and Finish.
hold_scheduled_release
Optional. The release timestamp for a scheduled hold. Once the current date and time has passed the scheduled release timestamp, the hold will automatically release without requiring the ReleaseHold action.
- Returns
success object
-
add_linked_attachment
(attachments)¶ 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
-
get_attachment
(attachment_id)¶ Returns an embedded job attachment given an attachment ID
Parameter
Description
attachment_id
Attachment ID
- Returns
Job Attachment
-
property
history
¶ Gets the history of a job given job ID
- Returns
success object
-
property
location
¶ Get/Set the job location for the user-defined job
- Returns
Workflow Manager
JobLocation
object
-
release_hold
(step_ids, dependent_job_id=None, dependent_step_id=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 release is applied to all the steps on hold.
dependent_job_id
Optional. A job that the current job is dependent on from being performed step actions including Run and Finish.
dependent_step_id
Optional. The step in the job that the current job is dependent on from being performed step actions including Run and Finish.
- Returns
success object
-
set_current_step
(step_id)¶ Sets a single step to be the active step on the job. The ability to set a step as current is controlled by the workflowSetStepCurrent privilege.
Parameter
Description
step_id
Active Step ID
- Returns
success object
-
set_job_version
(data_source_name, version_guid=None, version_name=None, administered=False)¶ Sets the version of the job.
Argument
Description
data_source_name
Required. The name of the data source for the job version to be set.
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 better performance.
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.
- Returns
success object
-
update_attachment
(attachment_id, alias)¶ 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, assigned_type, assigned_to)¶ 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 designated Values: “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 item wm = WorkflowManager(wf_item) job = wm.jobs.get('job_id') job.update_step(step_id='123456', assigned_type='User', assigned_to='my_user')
-
JobDiagram¶
-
class
arcgis.gis.workflowmanager.
JobDiagram
(init_data, gis=None, url=None)¶ Bases:
object
Helper class for managing Workflow Manager
job diagrams
in a workflowitem
. This class is not created directly. An instance can be created by calling thediagrams
property of theWorkflowManager
to retrieve a list of diagrams. Then thediagram()
method can be used with the appropriate ID of the digram to retrieve thejob diagram
.
JobLocation¶
-
class
arcgis.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¶
-
class
arcgis.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.
-
property
automated_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
Shares a job template with the list of groups
Parameter
Description
group_ids
Required list. List of Workflow Group Ids
- Returns
boolean
Returns the list of groups that the job_template is shared with by template_id.
- Returns
list of
Group
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 item wm = WorkflowManager(wf_item) # create the props object with the required automation properties adds = [{ "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¶
-
class
arcgis.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¶
-
class
arcgis.gis.workflowmanager.
SavedSearchesManager
(item)¶ Bases:
object
Represents a helper class for workflow manager saved searches. Accessible as the
saved_searches
property.Parameter
Description
item
The Workflow Manager Item
-
create
(name, search_type, folder=None, definition=None, color_ramp=None, sort_index=None, search_id=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)¶ Deletes a saved search by ID
Parameter
Description
id
Required string. Saved Search id
- Returns
Boolean
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
Returns the list of groups that the saved search is shared with by searchId.
Parameter
Description
search_id
Search ID
- Returns
List of
Group
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 body to 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 item workflow_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 = [x for x in search_lst if x["searchId"] == searchid][0] search["colorRamp"] = "Default" search["name"] = "Updated search" actual = workflow_manager.update_saved_search(search)
-
LookUpTable¶
-
class
arcgis.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