Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Esri Developer

ArcGIS API for PythonAPI Reference

arcgis.apps.workforce module

Defines public exports for the workforce module.

TheProject 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 projectimportarcgisgis=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

arcgis.apps.workforce.create_project(title,summary=None,major_version=None,gis=None)

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

OptionalIntThe version of the Project to create. 1 represents the originalWorkforce Project which does not support offline. 2 represents the newerWorkforce Project which supports offline among other things. Defaultsto 2 in GIS 8.2 and higher

gis

OptionalGIS.The authenticated GIS to use.Defaults to the active GIS if None is provided.

Returns aProject

Assignment

classarcgis.apps.workforce.Assignment(project,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)

Represents an assignment

Parameter

Description

project

RequiredProject. The project thatthis assignment belongs to.

feature

OptionalFeature.A feature containing the assignments attributes. Mostly intended forinternal usage. If supplied, other parameters are ignored.

geometry

OptionalDict.A dictionary containing the assignment geometry

assignment_type

OptionalAssignmentType.The assignment type that represents this assignment.

assigned_date

OptionalDateThe date and time the assignment was assigned

assignment_read

OptionalBool.A flag indicating that the mobile worker has seen the assignment.Version 1 Projects Only

completed_date

OptionalDate.The date the assignment was completed

declined_comment

OptionalString.The comment submitted by the mobile worker.

declined_date

OptionalDate.The date the assignment was declined.

description

OptionalDescription.The description associated with the assignment.

dispatcher

OptionalDispatcher.The dispatcher that assigned/created the assignment.

due_date

OptionalDate.The date the assignment is due.

in_progress_date

OptionalDate.The date the assignment was started.

location

OptionalString.The location or address of the assignment.

notes

OptionalString.The notes associated with the assignment.

paused_date

OptionalDate.The date and time the assignment was paused.

priority

OptionalString.The priority of the assignment

none,low,medium,high,critical

status

OptionalString.The status of the assignment.

unassigned,assigned,in_progress,completed,declined,paused,canceled

work_order_id

OptionalString.The work order id associated with the assignment.

worker

OptionalWorker.The worker assigned to the assignment

# Get an assignment and update itimportarcgisgis=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()
propertyassigned_date

Gets/Sets the assigneddatetime of the assignment

propertyassignment_read

Gets/Sets the assignment read field

propertyassignment_type

Gets/Sets theAssignmentType

propertyassignment_type_code
propertyattachments

Gets theAssignmentAttachmentManager of the assignment

propertycompleted_date

Gets/Sets the completeddatetime of the assignment

propertycreation_date

Thedatetime at which the Feature was created.

propertycreator

The named user that created the Feature.

propertydeclined_comment

Gets/Sets the declined comment of the assignment

propertydeclined_date

Gets/Sets the declineddatetime of the assignment

delete()

Deletes the assignment from the server

propertydescription

Gets/Sets the description for the assignment

propertydispatcher

Gets/Sets theDispatcher of the assignment

propertydispatcher_id

Gets the dispatcher id of the assignment

propertydue_date

Gets/Sets the duedatetime of the assignment

propertyedit_date

Thedatetime at which the Feature was last edited.

propertyeditor

The named user that last edited the Feature.

propertyfeature

TheFeature

propertygeometry

Gets/Sets the geometry for the Feature.

propertyglobal_id

The global id of the feature

propertyid

The object (version 1) or global id (version 2) of the feature

propertyin_progress_date

Gets/Sets the in progressdatetime for the assignment

propertylocation

Gets/Sets the location of the assignment

propertynotes

Gets/Sets the notes of the assignment

propertyobject_id

The object id of the feature

propertypaused_date

Gets/Sets the pauseddatetime for the assignment

propertypriority

Gets/Sets theString priority of the assignment

none,low,medium,high,critical

propertystatus

Gets/Sets theString status of the assignment

unassigned,assigned,in_progress,completed,declined,paused,canceled

update(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)

Updates the assignment on the server

Parameter

Description

geometry

OptionalDict.A dictionary containing the assignment geometry

assignment_type

OptionalAssignmentType.The assignment type that represents this assignment.

assigned_date

OptionalDateThe date and time the assignment was assigned

assignment_read

OptionalBool.A flag indicating that the mobile worker has seen the assignment.Version 1 Projects Only

completed_date

OptionalDate.The date the assignment was completed

declined_comment

OptionalString.The comment submitted by the mobile worker.

declined_date

OptionalDate.The date the assignment was declined.

description

OptionalDescription.The description associated with the assignment.

dispatcher

OptionalDispatcher.The dispatcher that assigned/created the assignment.

due_date

OptionalDate.The date the assignment is due.

in_progress_date

OptionalDate.The date the assignment was started.

location

OptionalString.The location or address of the assignment.

notes

OptionalString.The notes associated with the assignment.

paused_date

OptionalDate.The date and time the assignment was paused.

priority

OptionalString.The priority of the assignment

none,low,medium,high,critical

status

OptionalString.The status of the assignment.

unassigned,assigned,in_progress,completed,declined,paused,canceled

work_order_id

OptionalString.The work order id associated with the assignment.

worker

OptionalWorker.The worker assigned to the assignment

propertyweb_app_link

Returns a link to the assignment in the Workforce web app

propertywork_order_id

Gets/Sets the work order id of the assignment

propertyworker

Gets theWorker of the assignment

propertyworker_id

Gets the worker id of the assignment

AssignmentType

classarcgis.apps.workforce.AssignmentType(project,feature=None,coded_value=None,name=None)

Defines the acceptable values forAssignmentType types.

Parameter

Description

project

RequiredProject. The project thatthis assignment belongs to.

coded_value

Optionaldict. The dictionary storing the code andname of the type. Only works for v1 projects.

name

OptionalString. The name of the assignment type.

# Get an assignment type, update it, delete itimportarcgisgis=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()
propertycode

Gets the internal code that uniquely identifies the assignment type

propertycoded_value

Gets the coded value

propertycreation_date

Thedatetime at which the Feature was created.

propertycreator

The named user that created the Feature.

delete()

Deletes the assignment type from the server

propertyedit_date

Thedatetime at which the Feature was last edited.

propertyeditor

The named user that last edited the Feature.

propertyfeature

TheFeature

propertygeometry

Gets/Sets the geometry for the Feature.

propertyglobal_id

The global id of the feature

propertyid

Gets the id of the assignment type

propertyname

Gets/Sets The name of the assignment type

propertyobject_id

The object id of the feature

update(name=None)

Updates the assignment type on the server

Parameter

Description

name

OptionalString.The name of the assignment type

Attachment

classarcgis.apps.workforce.Attachment(assignment,attachment_info)

Represents a file attachment for an Assignment

Parameter

Description

assignment

RequiredAssignment. The assignment object that this attachment belongsto

attachment_info

Requireddict. The attachment info dictionary representing theattachment.

propertyattachment_info

Gets the attachment info of the attachment

propertycontent_type

Gets the attachment content type

download(out_folder=None)

Downloads the attachment to the specified path. If the path is omitted, the Attachmentwill 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 thecurrent working directory.

Returns:

The absolute path to the downloaded file.

propertyglobal_id

Gets the attachment global id

propertyid

Gets the attachment id

propertyname

Gets the attachment name

propertyproject

Gets the project that the attachment belongs to

propertysize

Gets the attachment size

Dispatcher

classarcgis.apps.workforce.Dispatcher(project,feature=None,contact_number=None,name=None,user_id=None)

Represents a dispatcher in a project.

Parameter

Description

project

RequiredProject. The project thatthe dispatcher belongs to.

feature

OptionalFeature. The feature representingthe dispatcher. Mostly intended forinternal usage. If supplied, other parameters are ignored.

contact_number

OptionalString. The contact number of the dispatcher

name

OptionalString. The name of the dispatcher

user_id

OptionalString. The user id of the dispatcher

# Get a dispatcher, update it, delete itimportarcgisgis=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()
propertycontact_number

Gets/Sets the contact number of the dispatcher

propertycreation_date

Thedatetime at which the Feature was created.

propertycreator

The named user that created the Feature.

delete()

Deletes the dispatcher from the server

propertyedit_date

Thedatetime at which the Feature was last edited.

propertyeditor

The named user that last edited the Feature.

propertyfeature

TheFeature

propertygeometry

Gets/Sets the geometry for the Feature.

propertyglobal_id

The global id of the feature

propertyid

The object (version 1) or global id (version 2) of the feature

propertyname

Gets/Sets the name of the dispatcher

propertyobject_id

The object id of the feature

update(contact_number=None,name=None,user_id=None)

Updates the dispatcher on the server

Parameter

Description

contact_number

OptionalString. The contact number of the dispatcher

name

OptionalString. The name of the dispatcher

user_id

OptionalString. The user id of the dispatcher

propertyuser_id

Gets/Sets the user id of the dispatcher

Integration

classarcgis.apps.workforce.Integration(project,feature=None,integration_id=None,prompt=None,url_template=None,assignment_type=None)

Represents an integration in a project. Version 2 Workforce projects only.

Parameter

Description

project

RequiredProject. The project thatthe dispatcher belongs to.

feature

OptionalFeature. The feature representingthe dispatcher. Mostly intended forinternal usage. If supplied, other parameters are ignored.

integration_id

OptionalString. The id for the integration

prompt

OptionalString. The prompt in the mobile app for theintegration

url_template

OptionalString. The url that the prompt links to

assignment_type

OptionalString. The assignment type for the integration

# Get an integration, update it, delete itimportarcgisgis=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()
propertyassignment_type

Gets/Sets the assignment type of the integration

propertycreation_date

Thedatetime at which the Feature was created.

propertycreator

The named user that created the Feature.

delete()

Deletes the integration from the server

propertyedit_date

Thedatetime at which the Feature was last edited.

propertyeditor

The named user that last edited the Feature.

propertyfeature

TheFeature

propertygeometry

Gets/Sets the geometry for the Feature.

propertyglobal_id

The global id of the feature

propertyid

The object (version 1) or global id (version 2) of the feature

propertyintegration_id

Gets/Sets the id of the integration

propertyobject_id

The object id of the feature

propertyprompt

Gets/Sets the prompt of the integration

update(integration_id=None,prompt=None,url_template=None,assignment_type=None)

Updates the dispatcher on the server

Parameter

Description

integration_id

OptionalString. The id for the integration

prompt

OptionalString. The prompt in the mobile app for theintegration

url_template

OptionalString. The url that the prompt links to

assignment_type

OptionalString. The assignment type for the integration

propertyurl_template

Gets/Sets the url template of the integration

Project

classarcgis.apps.workforce.Project(item)

A Workforce Project

Parameter

Description

item

RequiredItem. The item thatthe contains the project.

For a version 1 Workforce project, this is an item of typeWorkforce Project. For a version 2 Workforce project, this is anitem of typeFeature Service with typeKeywordWorkforce Project

# Get a Project and search the assignments and workers.importarcgisgis=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" projectv1_project=arcgis.apps.workforce.create_project('v1_project',major_version=1)v2_project=arcgis.apps.workforce.create_project('v2_project',major_version=2)
propertyassignment_types

TheAssignmentTypeManager for the project

propertyassignment_types_item

The assignment typesItem

propertyassignment_types_table

The assignment typesTable

propertyassignment_types_table_url

The assignment types table url

propertyassignments

TheAssignmentManager for the project

propertyassignments_item

The assignmentsItem

propertyassignments_layer

The assignmentsFeatureLayer

propertyassignments_layer_url

The assignments feature layer url

delete()

Deletes the project, group, folder, layers, and webmaps.Assumes the currently signed in user owns the project or is an admin.

propertydispatcher_web_map_id

The dispatcher webmap item id

propertydispatcher_webmap

The dispatcherMap for the project

propertydispatchers

TheDispatcherManager for the project

propertydispatchers_item

The dispatchersItem

propertydispatchers_layer

The dispatchersFeatureLayer

propertydispatchers_layer_url

The dispatchers layer url

propertygroup

TheGroup that the project resources are part of

propertygroup_id

The group id that all project items are part of

propertyid

The item id of the project

propertyintegrations

TheAssignmentIntegrationManager for the project

propertyintegrations_table

The integrationsTable

propertyintegrations_table_url

The integrations table urlTable

propertyowner

The ownerUser of the project

propertyowner_user_id

The user id of the project owner.

propertysummary

The title of the project

propertytitle

Gets the title of the project

propertytracks

TheTrackManager for the project

propertytracks_item

The tracksItem

propertytracks_layer

The tracksFeatureLayer

propertytracks_layer_url

The tracks feature layer url

update(summary=None)

Updates the project on the server

Parameter

Description

summary

OptionalString. The summary of the project.

propertyversion

The version of the project

propertyworker_web_map_id

The worker webmap item id

propertyworker_webmap

The workerMap for the project

propertyworkers

TheWorkerManager for the project

propertyworkers_item

The workersItem

propertyworkers_layer

The workersFeatureLayer

propertyworkers_layer_url

The workers feature layer url

Track

classarcgis.apps.workforce.Track(project,feature=None,geometry=None,accuracy=None)

Represents a track feature, which describes the historical location of a worker. V1 Projectsonly.

Parameter

Description

feature

OptionalFeature.A feature containing the assignments attributes. Mostly intended forinternal usage. If supplied, other parameters are ignored.

geometry

OptionalDict.A dictionary containing the assignment geometry

accuracy

OptionalFloat. The accuracy of the point

propertyaccuracy

The horizontal accuracy of the location measurement, in meters.

propertycreation_date

Thedatetime at which the Feature was created.

propertycreator

The named user that created the Feature.

delete()

Deletes the track point on the server

propertyedit_date

Thedatetime at which the Feature was last edited.

propertyeditor

The named user that last edited the Feature.

propertyfeature

TheFeature

propertygeometry

Gets/Sets the geometry for the Feature.

propertyglobal_id

The global id of the feature

propertyid

The object (version 1) or global id (version 2) of the feature

propertyobject_id

The object id of the feature

update(geometry=None,accuracy=None)

Updates the track point on the server

Parameter

Description

geometry

OptionalDict.A dictionary containing the assignment geometry

accuracy

OptionalFloat. The accuracy of the point

Worker

classarcgis.apps.workforce.Worker(project,feature=None,geometry=None,contact_number=None,name=None,notes=None,status='not_working',title=None,user_id=None)

Represents a worker in a Workforce Project

Parameter

Description

project

RequiredProject. The project thatthe worker belongs to.

feature

OptionalFeature. The feature representingthe worker. Mostly intended forinternal usage. If supplied, other parameters are ignored.

geometry

OptionalDict. The geometry of the worker.

contact_number

OptionalString. The contact number of the worker.

name

OptionalString. The name of the worker.

notes

OptionalString. The notes about the worker.

status

OptionalString. The status of the worker.

not_working,working,on_break

title

OptionalString. The title of the worker.

user_id

OptionalString. The user id of the worker

# Get a worker, update it, delete itimportarcgisgis=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")
propertycontact_number

Gets/Sets the contact number of the worker

propertycreation_date

Thedatetime at which the Feature was created.

propertycreator

The named user that created the Feature.

delete()

Deletes the worker from the server

propertyedit_date

Thedatetime at which the Feature was last edited.

propertyeditor

The named user that last edited the Feature.

propertyfeature

TheFeature

propertygeometry

Gets/Sets the geometry for the Feature.

propertyglobal_id

The global id of the feature

propertyid

The object (version 1) or global id (version 2) of the feature

propertyname

Gets/Sets the name of the worker

propertynotes

Gets/Sets the notes of the worker

propertyobject_id

The object id of the feature

propertystatus

Gets/Sets theString status of the worker

not_working,working,on_break

propertytitle

Gets/Sets the title of the worker

update(geometry=None,contact_number=None,name=None,notes=None,status=None,title=None,user_id=None)

Updates the worker on the server

Parameter

Description

geometry

OptionalDict. The geometry of the worker.

contact_number

OptionalString. The contact number of the worker.

name

OptionalString. The name of the worker.

notes

OptionalString. The notes about the worker.

status

OptionalString. The status of the worker.

not_working,working,on_break

title

OptionalString. The title of the worker.

user_id

OptionalString. The user id of the worker

propertyuser_id

Gets/Sets the user id of the worker

Submodules

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