Defines public exports for the workforce module.
The Project
is the main entry point into the Workforce module. It can be used as shown in the following code example.
# Get a Project and search the assignments and workers, create new Workforce project import arcgis gis = arcgis.gis.GIS("https://arcgis.com", "<username>", "<password>") item = gis.content.get("<item-id>") project = arcgis.apps.workforce.Project(item) assignments = project.assignments.search() workers = project.workers.search() project2 = arcgis.apps.workforce.create_project('new_project', summary='This project was created by Python')create_project
Creates a new Workforce Project
Parameter
Description
title
String
. The title of the Project to create (must be unique to the organization)
summary
String
. The summary of the Project
major_version
Optional Int
The version of the Project to create. 1 represents the original Workforce Project which does not support offline. 2 represents the newer Workforce Project which supports offline among other things. Defaults to 2 in GIS 8.2 and higher
gis
Optional GIS
. The authenticated GIS to use. Defaults to the active GIS if None is provided.
Returns a Project
Represents an assignment
Parameter
Description
project
Required Project
. The project that this assignment belongs to.
feature
Optional Feature
. A feature containing the assignments attributes. Mostly intended for internal usage. If supplied, other parameters are 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. Version 1 Projects Only
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
none, low, medium, high, critical
status
Optional String
. The status of the assignment.
unassigned, assigned, in_progress, completed, declined, paused, canceled
work_order_id
Optional String
. The work order id associated with the assignment.
worker
Optional Worker
. The worker assigned to the assignment
# Get an assignment and update it 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.search()[0] assignment.update(priority="high",description="new assignment",location="100 Commercial Street, Portland, ME") assignment.delete()
Gets/Sets the assigned datetime
of the assignment
Gets/Sets the assignment read field
Gets/Sets the AssignmentType
Gets the AssignmentAttachmentManager
of the assignment
Gets/Sets the completed datetime
of the assignment
The datetime
at which the Feature was created.
The named user that created the Feature.
Gets/Sets the declined comment of the assignment
Gets/Sets the declined datetime
of the assignment
Deletes the assignment from the server
Gets/Sets the description for the assignment
Gets/Sets the Dispatcher
of the assignment
Gets the dispatcher id of the assignment
Gets/Sets the due datetime
of the assignment
The datetime
at which the Feature was last edited.
The named user that last edited the Feature.
The Feature
Gets/Sets the geometry for the Feature.
The global id of the feature
The object (version 1) or global id (version 2) of the feature
Gets/Sets the in progress datetime
for the assignment
Gets/Sets the location of the assignment
Gets/Sets the notes of the assignment
The object id of the feature
Gets/Sets the paused datetime
for the assignment
Gets/Sets the String
priority of the assignment
none, low, medium, high, critical
Gets/Sets the
String
status of the assignment
unassigned, assigned, in_progress, completed, declined, paused, canceled
Updates the assignment on the server
Parameter
Description
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. Version 1 Projects Only
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
none, low, medium, high, critical
status
Optional String
. The status of the assignment.
unassigned, assigned, in_progress, completed, declined, paused, canceled
work_order_id
Optional String
. The work order id associated with the assignment.
worker
Optional Worker
. The worker assigned to the assignment
Returns a link to the assignment in the Workforce web app
Gets/Sets the work order id of the assignment
Gets the Worker
of the assignment
Gets the worker id of the assignment
Defines the acceptable values for AssignmentType
types.
Parameter
Description
project
Required Project
. The project that this assignment belongs to.
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.
# Get an assignment type, update it, delete it 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.search()[0] assignment_type.update(name="Manhole Inspection") assignment_type.delete()
Gets the internal code that uniquely identifies the assignment type
Gets the coded value
The datetime
at which the Feature was created.
The named user that created the Feature.
Deletes the assignment type from the server
The datetime
at which the Feature was last edited.
The named user that last edited the Feature.
The Feature
Gets/Sets the geometry for the Feature.
The global id of the feature
Gets the id of the assignment type
Gets/Sets The name of the assignment type
The object id of the feature
Updates the assignment type on the server
Parameter
Description
name
Optional String
. The name of the assignment type
Represents a file attachment for an Assignment
Parameter
Description
assignment
Required Assignment
. The assignment object that this attachment belongs to
attachment_info
Required dict
. The attachment info dictionary representing the attachment.
Gets the attachment info of the attachment
Gets the attachment content type
Downloads the attachment to the specified path. If the path is omitted, the Attachment will be saved to the current working directory, using the name property as the filename. :param out_folder: The folder in which the attachment should be saved. Defaults to the current working directory.
The absolute path to the downloaded file.
Gets the attachment global id
Gets the attachment id
Gets the attachment name
Gets the project that the attachment belongs to
Gets the attachment size
Represents a dispatcher in a project.
Parameter
Description
project
Required Project
. The project that the dispatcher belongs to.
feature
Optional Feature
. The feature representing the dispatcher. Mostly intended for internal usage. If supplied, other parameters are ignored.
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
# Get a dispatcher, update it, delete it 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.search()[0] dispatcher.update(name="Dispatcher Name", contact_number="1234567890") dispatcher.delete()
Gets/Sets the contact number of the dispatcher
The datetime
at which the Feature was created.
The named user that created the Feature.
Deletes the dispatcher from the server
The datetime
at which the Feature was last edited.
The named user that last edited the Feature.
The Feature
Gets/Sets the geometry for the Feature.
The global id of the feature
The object (version 1) or global id (version 2) of the feature
Gets/Sets the name of the dispatcher
The object id of the feature
Updates the dispatcher on the server
Parameter
Description
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
Gets/Sets the user id of the dispatcher
Represents an integration in a project. Version 2 Workforce projects only.
Parameter
Description
project
Required Project
. The project that the dispatcher belongs to.
feature
Optional Feature
. The feature representing the dispatcher. Mostly intended for internal usage. If supplied, other parameters are ignored.
integration_id
Optional String
. The id for the integration
prompt
Optional String
. The prompt in the mobile app for the integration
url_template
Optional String
. The url that the prompt links to
assignment_type
Optional String
. The assignment type for the integration
# Get an integration, update it, delete it import arcgis gis = arcgis.gis.GIS("https://arcgis.com", "<username>", "<password>") item = gis.content.get("<item-id>") project = arcgis.apps.workforce.Project(item) integration = project.integrations.search()[0] integration.update(integration_id="arcgis-navigator",prompt="Navigate to Assignment") integration.delete()
Gets/Sets the assignment type of the integration
The datetime
at which the Feature was created.
The named user that created the Feature.
Deletes the integration from the server
The datetime
at which the Feature was last edited.
The named user that last edited the Feature.
The Feature
Gets/Sets the geometry for the Feature.
The global id of the feature
The object (version 1) or global id (version 2) of the feature
Gets/Sets the id of the integration
The object id of the feature
Gets/Sets the prompt of the integration
Updates the dispatcher on the server
Parameter
Description
integration_id
Optional String
. The id for the integration
prompt
Optional String
. The prompt in the mobile app for the integration
url_template
Optional String
. The url that the prompt links to
assignment_type
Optional String
. The assignment type for the integration
Gets/Sets the url template of the integration
A Workforce Project
Parameter
Description
item
Required Item
. The item that the contains the project.
For a version 1 Workforce project, this is an item of type Workforce Project. For a version 2 Workforce project, this is an item of type Feature Service with typeKeyword Workforce Project
# Get a Project and search the assignments and workers. import arcgis gis = arcgis.gis.GIS("https://arcgis.com", "<username>", "<password>") item = gis.content.get("<item-id>") project = arcgis.apps.workforce.Project(item) assignments = project.assignments.search() workers = project.workers.search() # Create v1 "Classic" Workforce project and v2 "offline-enabled" project v1_project = arcgis.apps.workforce.create_project('v1_project', major_version=1) v2_project = arcgis.apps.workforce.create_project('v2_project', major_version=2)
The AssignmentTypeManager
for the project
The assignment types Item
The assignment types Table
The assignment types table url
The AssignmentManager
for the project
The assignments Item
The assignments FeatureLayer
The assignments feature layer url
Deletes the project, group, folder, layers, and webmaps. Assumes the currently signed in user owns the project or is an admin.
The dispatcher webmap item id
The dispatcher Map
for the project
The DispatcherManager
for the project
The dispatchers Item
The dispatchers FeatureLayer
The dispatchers layer url
The Group
that the project resources are part of
The group id that all project items are part of
The item id of the project
The AssignmentIntegrationManager
for the project
The integrations Table
The integrations table url Table
The owner User
of the project
The user id of the project owner.
The title of the project
Gets the title of the project
The TrackManager
for the project
The tracks Item
The tracks FeatureLayer
The tracks feature layer url
Updates the project on the server
Parameter
Description
summary
Optional String
. The summary of the project.
The version of the project
The worker webmap item id
The worker Map
for the project
The WorkerManager
for the project
The workers Item
The workers FeatureLayer
The workers feature layer url
Represents a track feature, which describes the historical location of a worker. V1 Projects only.
Parameter
Description
feature
Optional Feature
. A feature containing the assignments attributes. Mostly intended for internal usage. If supplied, other parameters are ignored.
geometry
Optional Dict
. A dictionary containing the assignment geometry
accuracy
Optional Float
. The accuracy of the point
The horizontal accuracy of the location measurement, in meters.
The datetime
at which the Feature was created.
The named user that created the Feature.
Deletes the track point on the server
The datetime
at which the Feature was last edited.
The named user that last edited the Feature.
The Feature
Gets/Sets the geometry for the Feature.
The global id of the feature
The object (version 1) or global id (version 2) of the feature
The object id of the feature
Updates the track point on the server
Parameter
Description
geometry
Optional Dict
. A dictionary containing the assignment geometry
accuracy
Optional Float
. The accuracy of the point
Represents a worker in a Workforce Project
Parameter
Description
project
Required Project
. The project that the worker belongs to.
feature
Optional Feature
. The feature representing the worker. Mostly intended for internal usage. If supplied, other parameters are ignored.
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.
not_working, working, on_break
title
Optional String
. The title of the worker.
user_id
Optional String
. The user id of the worker
# Get a worker, update it, delete it 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.search()[0] worker.update(title="Inspector",status="not_working")
Gets/Sets the contact number of the worker
The datetime
at which the Feature was created.
The named user that created the Feature.
Deletes the worker from the server
The datetime
at which the Feature was last edited.
The named user that last edited the Feature.
The Feature
Gets/Sets the geometry for the Feature.
The global id of the feature
The object (version 1) or global id (version 2) of the feature
Gets/Sets the name of the worker
Gets/Sets the notes of the worker
The object id of the feature
Gets/Sets the String
status of the worker
not_working, working, on_break
Gets/Sets the title of the worker
Updates the worker on the server
Parameter
Description
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.
not_working, working, on_break
title
Optional String
. The title of the worker.
user_id
Optional String
. The user id of the worker
Gets/Sets the user id of the 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