This manages the assignments in the project. It can be accessed from the project as assignments
Parameter
Description
project
Required Project
. The project to manage.
# Add / get assignments using assignment manager import arcgis gis = arcgis.gis.GIS("https://arcgis.com", "<username>", "<password>") item = gis.content.get("<item-id>") project = arcgis.apps.workforce.Project(item) assignment = project.assignments.add(assignment_type=type_1, location="100 Commercial St", geometry={'x': -7820308, 'y': 5412450}, status=0, priority=0) assignment_2 = project.assignments.get(object_id=2)
Creates and adds a new assignment to the project
Parameter
Description
feature
Optional Feature
. A feature containing the assignments attributes. If this is provided the other parameters are all ignored.
geometry
Optional Dict
. A dictionary containing the assignment geometry
assignment_type
Optional AssignmentType
. The assignment type that represents this assignment.
assigned_date
Optional Date
The date and time the assignment was assigned
assignment_read
Optional Bool
. A flag indicating that the mobile worker has seen the assignment
completed_date
Optional Date
. The date the assignment was completed
declined_comment
Optional String
. The comment submitted by the mobile worker.
declined_date
Optional Date
. The date the assignment was declined.
description
Optional Description
. The description associated with the assignment.
dispatcher
Optional Dispatcher
. The dispatcher that assigned/created the assignment.
due_date
Optional Date
. The date the assignment is due.
in_progress_date
Optional Date
. The date the assignment was started.
location
Optional String
. The location or address of the assignment.
notes
Optional String
. The notes associated with the assignment.
paused_date
Optional Date
. The date and time the assignment was paused.
priority
Optional String
. The priority of the assignment
status
Optional String
. The status of the assignment.
work_order_id
Optional String
. The work order id associated with the assignment.
worker
Optional Worker
. The worker assigned to the assignment
Adds the list of assignments to the project.
Parameter
Description
assignments
Required List
of Assignment
. The list of assignments to add.
List
of Assignment
Removes the list of assignments from the project.
Parameter
Description
assignments
Required List
of Assignment
. The list of assignments to remove.
Updates the list of assignments in the project.
Parameter
Description
assignments
Required List
of Assignment
. The list of assignments to update.
List
of Assignment
Gets the identified assignment by either an object id or global id.
Parameter
Description
object_id
Optional integer
. The object id of the assignment to get
global_id
Optional string
. The global id of the assignment to get.
Searches the assignments in the project.
Parameter
Description
where
Optional string
. The where clause to use to query assignments. Defaults to â1=1â
List
of Assignment
This manages the attachments associated with an assignment. It can be accessed from the assignment as attachments
Parameter
Description
assignment
Required Assignment
. The assignment to manage.
Adds the file as an attachment to the assignment.
Parameter
Description
file_path
Required string
The file to upload.
Removes the list of attachments from the assignment.
Parameter
Description
attachments
Required List
of Attachment
. The list of attachments to delete.
Downloads all of an assignments attachments.
Parameter
Description
out_folder
Required string
. The folder to download the attachments to.
A List
of file path strings
This gets all of the Attachments belonging to the assignment.
List
of Attachment
This manages the assignment integrations in the project It can be accessed from the project as integrations
For a version 2 (offline-enabled project), an integration is represented by an object Integration
object and can be updated in the same fashion as Assignment, AssignmentType, Dispatcher, Project, and Worker objects.
For a version 1 project, an integration in Workforce consists of a formatted dictionary. Two examples are shown below:
navigator_integration = { "id": "default-navigator", "prompt": "Navigate to Assignment", "urlTemplate": "arcgis-navigator://?stop=${assignment.latitude},${assignment.longitude}&stopname=${assignment.location}&callback=arcgis-workforce://&callbackprompt=Workforce" } explorer_integration = { "id": "default-explorer", "prompt": "Explore at Assignment", "assignmentTypes": { "1": { "urlTemplate": "arcgis-explorer://?itemID=651324c8661b42c897657f8afbe846qe¢er=${assignment.latitude},${assignment.longitude}&scale=9000" } }
The urlTemplate can be generated by using the integrations
module
Parameter
Description
project
Required Project
. The project to manage.
This adds an integration to the project
Parameter
Description
integration_id
Required string
. The id of the integration
prompt
Required: string
. The prompt to display.
url_template
Required for version 2 Workforce projects. Optional for version 1. string
. The url template that is used for app linking.
assignment_types
Optional: string
or list
Version 2 Projects: String which is a globalid representing an assignment type. This is stored at assignment_type.code. If you pass a list for this object, it will add multiple integrations, with identical integration_id, prompt, and url_template values, with differring assignment_types values.
Version 1 Projects: dict
. A dictionary containing assignment type codes as keys and a dictionaries that contains a âurlTemplateâ for each code as values. If provided, this will override any general url_template specified.
dict
Version 1: dict representing the integration, Version 2: Integration
Parameter
Description
integrations
Required List
of dict
. The integrations to add
List
The list of integrations that were added
Parameter
Description
integrations
Required List
of dict
. The integrations to delete
This gets an integration dictionary by its id
Parameter
Description
integration_id
Required string
. The id of the integration. This is field âappidâ for a Version 2 Workforce project.
Version 1: dict
or None
, Version 2: Integration
This returns all of the assignment integrations for the project
Parameter
Description
where
Optional string
. ArcGIS where clause - version 2 projects only. Defaults to â1=1â
List
A list of the integrations.
This manages the assignment types in the project. It can be accessed from the project as assignment_types
Parameter
Description
project
Required Project
. The project to manage.
# Add / get assignment types using assignment type manager import arcgis gis = arcgis.gis.GIS("https://arcgis.com", "<username>", "<password>") item = gis.content.get("<item-id>") project = arcgis.apps.workforce.Project(item) assignment_type = project.assignment_types.add(name="Tree Inspection") assignment_type_2 = project.assignment_types.get(name="Fix Sign")
Adds an assignment type to the project.
Parameter
Description
coded_value
Optional dict
. The dictionary storing the code and name of the type. Only works for v1 projects.
name
Optional String
. The name of the assignment type.
Adds the list of assignment types to the project.
Parameter
Description
assignment_types
Required List
of AssignmentTypes
. The list of assignment types to add.
List
of AssignmentTypes
Removes the list of assignment types to the project.
Parameter
Description
assignment_types
Required List
of AssignmentTypes
. The list of assignment types to remove.
Updates the list of assignment types to the project.
Parameter
Description
assignment_types
Required List
of AssignmentTypes
. The list of assignment types to update.
List
of AssignmentType
Gets the identified assignment type by either the name or code.
Parameter
Description
code
Optional integer
. The code of the assignment type.
name
Optional string
. The name of the assignment type.
Gets all of the assignment types in the project.
List
of AssignmentType
This manages the dispatchers in the project. It can be accessed from the project as
dispatchers
Parameter
Description
project
Required
Project
. The project to manage.
# Add / get dispatchers using dispatcher manager import arcgis gis = arcgis.gis.GIS("https://arcgis.com", "<username>", "<password>") item = gis.content.get("<item-id>") project = arcgis.apps.workforce.Project(item) dispatcher = project.dispatchers.add(name="New Dispatcher",user_id="dispatcher_username") dispatcher_2 = project.dispatchers.get(user_id="dispatcher2_username")
Creates and adds a dispatcher to the project.
Parameter
Description
project
Required Project
. The project that the dispatcher belongs to.
feature
Optional Feature
. The feature representing the dispatcher.
contact_number
Optional String
. The contact number of the dispatcher
name
Optional String
. The name of the dispatcher
user_id
Optional String
. The user id of the dispatcher
Adds the list of dispatchers to the project.
Parameter
Description
dispatchers
Required List
of Dispatcher
. The list of dispatchers to add.
List
of Dispatcher
Removes the list of dispatchers to remove from the project.
Parameter
Description
dispatchers
Required List
of Dispatcher
. The list of dispatchers to remove.
Adds the list of dispatchers to update in the project.
Parameter
Description
dispatchers
Required List
of Dispatcher
. The list of dispatchers to update.
List
of Dispatcher
This gets a dispatcher by their object id, global id, or user id.
Parameter
Description
object_id
Optional integer
. The object id of the dispatcher to get
global_id
Optional string
. The global id of the dispatcher to get.
user_id
Optional string
. The user id of the dispatcher to get.
Searches the dispatchers in the project.
Parameter
Description
where
Optional string
. The where clause to use to query dispatchers. Defaults to â1=1â
List
of Dispatcher
This manages the tracks in the project. It can be accessed from the project as tracks
Parameter
Description
project
Required Project
. The project to manage.
Adds a track to the project.
Parameter
Description
feature
Optional Feature
. The feature to use.
geometry
Optional Dict
. A dictionary containing the assignment geometry
accuracy
Optional Float
. The accuracy to use.
Adds the list of tracks to the project.
Parameter
Description
tracks
Required List
of Track
. The list of tracks to add.
List
of Track
Removes the list of tracks to remove from the project.
Parameter
Description
tracks
Required List
of Track
. The list of tracks to remove.
Updates the list of tracks in the project.
Parameter
Description
tracks
Required List
of Track
. The list of tracks to update.
List
of Track
Gets/sets if tracking is enabled for the project
This gets a track by their object id or global id.
Parameter
Description
object_id
Optional integer
. The object id of the track to get
global_id
Optional string
. The global id of the track to get.
Gets/sets the tracking interval for the project (in seconds)
Searches the tracks in the project.
Parameter
Description
where
Optional string
. The where clause to use to query tracks. Defaults to â1=1â
List
of Track
This manages the workers in the project It can be accessed from the project as
workers
Parameter
Description
project
Required
Project
. The project to manage.
# Add / get workers using worker manager import arcgis gis = arcgis.gis.GIS("https://arcgis.com", "<username>", "<password>") item = gis.content.get("<item-id>") project = arcgis.apps.workforce.Project(item) worker = project.workers.add(user_id="worker_username", name="Worker One", status=0)
Creates and adds a new worker to the project.
Parameter
Description
feature
Optional Feature
. The feature representing the worker.
geometry
Optional Dict
. The geometry of the worker.
contact_number
Optional String
. The contact number of the worker.
name
Optional String
. The name of the worker.
notes
Optional String
. The notes about the worker.
status
Optional String
. The status of the worker.
title
Optional String
. The title of the worker.
user_id
Optional String
. The user id of the worker
Adds the list of workers to the project.
Parameter
Description
workers
Required List
of Worker
. The list of workers to add.
List
of Worker
Adds the list of workers to remove from the project.
Parameter
Description
workers
Required List
of Worker
. The list of workers to remove.
Adds the list of workers to update in the project.
Parameter
Description
workers
Required List
of Worker
. The list of workers to update.
List
of Worker
This gets a worker by their object id, global id, or user id.
Parameter
Description
object_id
Optional integer
. The object id of the worker to get
global_id
Optional string
. The global id of the worker to get.
user_id
Optional string
. The user id of the worker to get.
Searches the workers in the project.
Parameter
Description
where
Optional string
. The where clause to use to query workers. Defaults to â1=1â
List
of Worker
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4