arcgis.apps.workforce.managers module¶
AssignmentManager¶
-
class
arcgis.apps.workforce.managers.AssignmentManager(project)¶ This manages the assignments in the project. It can be accessed from the project as
assignmentsArgument
Description
project
Required
Project. The project to manage.-
add(feature=None, geometry=None, assignment_type=None, assigned_date=None, assignment_read=None, completed_date=None, declined_comment=None, declined_date=None, description=None, dispatcher=None, due_date=None, in_progress_date=None, location=None, notes=None, paused_date=None, priority='none', status=None, work_order_id=None, worker=None)¶ Creates and adds a new assignment to the project
Argument
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 geometryassignment_type
Optional
AssignmentType. The assignment type that represents this assignment.assigned_date
Optional
DateThe date and time the assignment was assignedassignment_read
Optional
Bool. A flag indicating that the mobile worker has seen the assignmentcompleted_date
Optional
Date. The date the assignment was completeddeclined_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 assignmentstatus
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- Returns
-
batch_add(assignments)¶ Adds the list of assignments to the project.
Argument
Description
assignments
Required
ListofAssignment. The list of assignments to add.- Returns
ListofAssignment
-
batch_delete(assignments)¶ Removes the list of assignments from the project.
Argument
Description
assignments
Required
ListofAssignment. The list of assignments to remove.
-
batch_update(assignments)¶ Updates the list of assignments in the project.
Argument
Description
assignments
Required
ListofAssignment. The list of assignments to update.- Returns
ListofAssignment
-
get(object_id=None, global_id=None)¶ Gets the identified assignment by either an object id or global id.
Argument
Description
object_id
Optional
integer. The object id of the assignment to getglobal_id
Optional
string. The global id of the assignment to get.- Returns
-
search(where='1=1')¶ Searches the assignments in the project.
Argument
Description
where
Optional
string. The where clause to use to query assignments. Defaults to ‘1=1’- Returns
ListofAssignment
-
AssignmentAttachmentManager¶
-
class
arcgis.apps.workforce.managers.AssignmentAttachmentManager(assignment)¶ This manages the attachments associated with an assignment. It can be accessed from the assignment as
attachmentsArgument
Description
assignment
Required
Assignment. The assignment to manage.-
add(file_path)¶ Adds the file as an attachment to the assignment.
Argument
Description
file_path
Required
stringThe file to upload.
-
batch_delete(attachments)¶ Removes the list of attachments from the assignment.
Argument
Description
attachments
Required
ListofAttachment. The list of attachments to delete.
-
download(out_folder=None)¶ Downloads all of an assignments attachments.
Argument
Description
out_folder
Required
string. The folder to download the attachments to.- Returns
A
Listof file path strings
-
get()¶ This gets all of the Attachments belonging to the assignment.
- Returns
ListofAttachment
-
AssignmentIntegrationManager¶
-
class
arcgis.apps.workforce.managers.AssignmentIntegrationManager(project)¶ This manages the assignment integrations in the project It can be accessed from the project as
integrationsAn 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
integrationsmoduleArgument
Description
project
Required
Project. The project to manage.-
add(integration_id, prompt, url_template=None, assignment_types=None)¶ This adds an integration to the project/
Argument
Description
integration_id
Required
string. The id of the integrationprompt
Required:
string. The prompt to display.url_template
Optional:
string. The url template that is used for app linking.assignment_types
Optional:
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.- Returns
dictA dictionary representing the assignment integration
-
batch_add(integrations)¶ Argument
Description
integrations
Required
Listofdict. The integrations to add- Returns
ListThe list of integrations that were added
-
batch_delete(integrations)¶ Argument
Description
integrations
Required
Listofdict. The integrations to delete
-
get(integration_id)¶ This gets an integration dictionary by its id
Argument
Description
integration_id
Required
string. The id of the integration- Returns
dictorNone
-
search()¶ This returns all of the assignment integrations for the project
- Returns
ListA list of the integrations.
-
AssignmentTypeManager¶
-
class
arcgis.apps.workforce.managers.AssignmentTypeManager(project)¶ This manages the assignment types in the project. It can be accessed from the project as
assignment_typesArgument
Description
project
Required
Project. The project to manage.-
add(coded_value=None, name=None)¶ Adds an assignment type to the project.
Argument
Description
coded_value
Optional
dict. The dictionary storing the code and name of the type.name
Optional
String. The name of the assignment type.- Returns
-
batch_add(assignment_types)¶ Adds the list of assignment types to the project.
Argument
Description
assignment_types
Required
ListofAssignmentTypes. The list of assignment types to add.- Returns
ListofAssignmentTypes
-
batch_delete(assignment_types)¶ Removes the list of assignment types to the project.
Argument
Description
assignment_types
Required
ListofAssignmentTypes. The list of assignment types to remove.
-
batch_update(assignment_types)¶ Updates the list of assignment types to the project.
Argument
Description
assignment_types
Required
ListofAssignmentTypes. The list of assignment types to update.- Returns
ListofAssignmentType
-
get(code=None, name=None)¶ Gets the identified assignment type by either the name or code.
Argument
Description
code
Optional
integer. The code of the assignment type.name
Optional
string. The name of the assignment type.- Returns
-
search()¶ Gets all of the assignment types in the project.
- Returns
ListofAssignmentType
-
DispatcherManager¶
-
class
arcgis.apps.workforce.managers.DispatcherManager(project)¶ This manages the dispatchers in the project. It can be accessed from the project as
dispatchersArgument
Description
project
Required
Project. The project to manage.-
add(feature=None, contact_number=None, name=None, user_id=None)¶ Creates and adds a dispatcher to the project.
Argument
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 dispatchername
Optional
String. The name of the dispatcheruser_id
Optional
String. The user id of the dispatcher- Returns
-
batch_add(dispatchers)¶ Adds the list of dispatchers to the project.
Argument
Description
dispatchers
Required
ListofDispatcher. The list of dispatchers to add.- Returns
ListofDispatcher
-
batch_delete(dispatchers)¶ Removes the list of dispatchers to remove from the project.
Argument
Description
dispatchers
Required
ListofDispatcher. The list of dispatchers to remove.
-
batch_update(dispatchers)¶ Adds the list of dispatchers to update in the project.
Argument
Description
dispatchers
Required
ListofDispatcher. The list of dispatchers to update.- Returns
ListofDispatcher
-
get(object_id=None, global_id=None, user_id=None)¶ This gets a dispatcher by their object id, global id, or user id.
Argument
Description
object_id
Optional
integer. The object id of the dispatcher to getglobal_id
Optional
string. The global id of the dispatcher to get.user_id
Optional
string. The user id of the dispatcher to get.- Returns
-
search(where='1=1')¶ Searches the dispatchers in the project.
Argument
Description
where
Optional
string. The where clause to use to query dispatchers. Defaults to ‘1=1’- Returns
ListofDispatcher
-
TrackManager¶
-
class
arcgis.apps.workforce.managers.TrackManager(project)¶ This manages the tracks in the project. It can be accessed from the project as
tracksArgument
Description
project
Required
Project. The project to manage.-
add(feature=None, geometry=None, accuracy=None)¶ Adds a track to the project.
Argument
Description
feature
Optional
Feature. The feature to use.geometry
Optional
Dict. A dictionary containing the assignment geometryaccuracy
Optional
Float. The accuracy to use.- Returns
-
batch_add(tracks)¶ Adds the list of tracks to the project.
Argument
Description
tracks
Required
ListofTrack. The list of tracks to add.- Returns
ListofTrack
-
batch_delete(tracks)¶ Removes the list of tracks to remove from the project.
Argument
Description
tracks
Required
ListofTrack. The list of tracks to remove.
-
batch_update(tracks)¶ Updates the list of tracks in the project.
Argument
Description
tracks
Required
ListofTrack. The list of tracks to update.- Returns
ListofTrack
-
property
enabled¶ Gets/sets if tracking is enabled for the project
-
get(object_id=None, global_id=None)¶ This gets a track by their object id or global id.
Argument
Description
object_id
Optional
integer. The object id of the track to getglobal_id
Optional
string. The global id of the track to get.- Returns
-
property
interval¶ Gets/sets the tracking interval for the project (in seconds)
-
WorkerManager¶
-
class
arcgis.apps.workforce.managers.WorkerManager(project)¶ This manages the workers in the project It can be accessed from the project as
workersArgument
Description
project
Required
Project. The project to manage.-
add(feature=None, geometry=None, contact_number=None, name=None, notes=None, status='not_working', title=None, user_id=None)¶ Creates and adds a new worker to the project.
Argument
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- Returns
-
batch_add(workers)¶ Adds the list of dispatchers to the project.
Argument
Description
workers
Required
ListofWorker. The list of workers to add.- Returns
ListofWorker
-
batch_delete(workers)¶ Adds the list of workers to remove from the project.
Argument
Description
workers
Required
ListofWorker. The list of workers to remove.
-
batch_update(workers)¶ Adds the list of dispatchers to update in the project.
Argument
Description
workers
Required
ListofWorker. The list of workers to update.- Returns
ListofWorker
-
get(object_id=None, global_id=None, user_id=None)¶ This gets a worker by their object id, global id, or user id.
Argument
Description
object_id
Optional
integer. The object id of the worker to getglobal_id
Optional
string. The global id of the worker to get.user_id
Optional
string. The user id of the worker to get.- Returns
-