スケジュールされたタスクとは
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このセクションのドキュメントでは、Google マップ モビリティのスケジュール設定されたタスク サービスを使用して、スケジュール設定されたタスクを作成して操作する方法について説明します。次の内容を理解していることを前提としています。
使用する Task
リソースは、gRPC と REST の両方で使用できます。
スケジュール設定されたタスクの Fleet Engine では、タスクは、消費者のスケジュール設定された配送またはサービスを実行するドライバー アクティビティを表します。タスクを完了する車両の停留所に割り当て、車両はその停留所まで移動します。
タスクの状態は、OPEN
または CLOSED
のいずれかです。これらの状態は、タスクがシステムでアクティブかどうかを示します。アクティブなタスクのルート変更が発生した場合は、タスクに関連付けられている車両の停車地(ENROUTE または ARRIVED)を更新して、Fleet Engine に報告します。ドライバーがタスクを完了して停留所を出たら、車両の停留所のリストから停留所を削除します。タスクとその停留所や車両との関係について詳しくは、Fleet Engine の基本のスケジュール設定されたタスクをご覧ください。
タスクのライフサイクル
Fleet Engine で各タスクを追跡するには、まず Task
エンティティを作成する必要があります。詳しくは、gRCP または REST をご覧ください。
次の表に、システムで作成されたタスクのエンドツーエンド フロー例と、Fleet Engine でのライフサイクル ステージを示します。Fleet Engine が設定され、タスク用の車両があり、ドライバー アプリで位置情報の更新が有効になっていることを前提としています。Driver SDK: スケジュールされたタスクをご覧ください。
1 |
タスクを作成する。 |
作業サイクルの開始時に、ディスパッチャまたはサービス管理者はまず、配信タスクまたはサービスのマニフェストを作成します。次に、システムは CreateTrip を使用して、タスクの種類やロケーションなどの必須フィールドを含むタスク エンティティを作成します。この時点で、ターゲット時間枠、タスクの進行状況の共有、カスタム属性などの他の構成も指定できます。配送タスクを作成すると関連するガイドをご覧ください。 |
2 |
タスクのスケジュールを設定する。 |
配送タスクをスケジュールすると、配送車両の更新リクエストが発行され、車両エンティティが更新されて、運行する停留所のリストが設定されます。各停留所に、その停留所で完了するタスクのリストを割り当てます。
配送車両のタスクを更新するをご覧ください。
|
3 |
タスクの進行状況を更新する。 |
タスクが配達ストップに割り当てられ、Fleet Engine で有効になると、車両がストップに近づき、到着し、完了するにつれて、車両の進行状況が Fleet Engine に通知されます。この情報により、フリート エンジンは、ルーティングとステータスの更新を、ルート上だけでなく、車両の 1 日を通して最適に実行できます。車両の停車ステータスを更新するをご覧ください。 |
4 |
ルートを共有する。 |
配達当日に車両がナビゲーションを開始すると同時に、関係するステークホルダーとルート情報を共有できます。Fleet Engine では、関心のあるステークホルダーがタスクの詳細と車両の位置情報の両方を以下の方法で利用できます。
- 購入者向けの配送情報。このソリューションを使用すると、消費者は、指定した車両の位置情報とともに荷物のステータスを確認できます。
スケジュールされたタスクの消費者共有をご覧ください。
- 管理者向けのフリート ステータス情報。このソリューションにより、フリート管理者はフリート内の配送車両の位置と停留所をニア リアルタイムで可視化できます。車両のルートがわかっている場合、地図ビュー コンポーネントは、予測されたパスに沿って移動する車両をアニメーション化します。
JavaScript フリート トラッキング ライブラリをご覧ください。
|
5 |
タスクを確定します。 |
Fleet Engine で配送タスクを確定するには、次の方法を使用します。
- タスクを閉じる: 配送タスクを閉じると、そのタスクはアクティブでなくなります。
- タスクの結果を設定する: タスクがクローズされたら、タスクが成功したか失敗したかを示すことで、配信が行われたか否かを指定します。これは、コンシューマー エクスペリエンスで配達結果を表示し、Fleet Engine サービスの正しい課金を保証するために、タスクを完了するうえで重要な部分です。
配送車両と同様に、タスク エンティティはステータスに関係なく Fleet Engine 内で 7 日間アクティブなままになり、その後削除されます。タスクをファイナライズするをご覧ください。
|
タスク シーケンス フロー
次の図は、タスクのライフサイクルの詳細なフローを示しています。

次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-31 UTC。
[null,null,["最終更新日 2025-08-31 UTC。"],[[["\u003cp\u003eThis documentation outlines how to create and manage scheduled tasks, representing driver activities, within the Google Maps Mobility scheduled tasks service.\u003c/p\u003e\n"],["\u003cp\u003eTasks, which can be either OPEN or CLOSED, are assigned to vehicle stops, and their progress is updated as the vehicle travels to and completes these stops.\u003c/p\u003e\n"],["\u003cp\u003eThe lifecycle of a task involves creation, scheduling by assigning to a vehicle stop, updating progress, sharing journey details with stakeholders, and finalization by closing and setting the outcome.\u003c/p\u003e\n"],["\u003cp\u003eFleet Engine provides tools for consumers to track shipment status and for administrators to monitor fleet locations and progress in near real-time.\u003c/p\u003e\n"],["\u003cp\u003eTo successfully use this service, prior familiarity with Fleet Engine, vehicle basics for on-demand services, and task basics for scheduled tasks is assumed.\u003c/p\u003e\n"]]],[],null,["# What is a scheduled task?\n\nThe documentation in this section shows how to create and work with scheduled\ntasks using the Google Maps Mobility scheduled tasks service. It assumes\nfamiliarity with the following:\n\n- **Fleet Engine** : You should be familiar with Fleet Engine implementation details, request mechanisms, and security. For that, see [What is the Fleet\n Engine service?](/maps/documentation/mobility/fleet-engine/essentials) and the security topics in [Set up Fleet Engine](/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet).\n- **Vehicles basics** for on-demand services. See [Introduction to vehicles](/maps/documentation/mobility/fleet-engine/essentials/vehicles-intro).\n- **Task basics** for scheduled task services. See [Scheduled tasks](/maps/documentation/mobility/fleet-engine/essentials/tasks-intro)\n\nThe `Task` resource that you'll use is available in both [gRPC](/maps/documentation/mobility/fleet-engine/reference/tasks/rpc/maps.fleetengine.delivery.v1#task) and\n[REST](/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks).\n\nIn Fleet Engine for scheduled tasks, a task represents a driver activity that\nfulfills a scheduled shipment or service for your consumers. You assign tasks to\nvehicle stop locations where they are to be completed, and the vehicle travels\nto those stops.\n\nA task has two possible states, `OPEN` or `CLOSED`. These states indicate\nwhether the task is active or not in the system. As the journey evolves for an\nactive task, you report this to Fleet Engine by updating the vehicle stop\nassociated with the task, which is either ENROUTE or ARRIVED. Once the driver\ncompletes tasks and leaves the stop, you remove the stop from the list of stops\non the vehicle. For more about\ntasks and their relationship to stops and vehicles, see\n[Scheduled tasks](/maps/documentation/mobility/fleet-engine/essentials/tasks-intro#basic_task_fields) in **Fleet Engine essentials** .\n\nLife of a task\n--------------\n\nIn order to track each task in Fleet Engine, you must first create a `Task`\nentity. See either [gRCP](/maps/documentation/mobility/fleet-engine/reference/tasks/rpc/maps.fleetengine.delivery.v1#task) or [REST](/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks) for reference.\n\nThe following table describes an example end-to-end flow of a task created in\nyour system and its lifecycle stages in Fleet Engine. It assumes you have set up\nFleet Engine and have a vehicle for the task, with location updates\nenabled in the driver app. See [Driver SDK: Scheduled tasks](/maps/documentation/mobility/driver-sdk/scheduled).\n\n|---|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1 | **Create tasks.** | At the beginning of the work cycle, the dispatcher or service administrator first creates a manifest for delivery tasks or services. From there, your system then creates the task entities using `CreateTrip` with required fields, such as the type of task and the location. It can also supply other configurations at this point, such as target time window, sharing task progress, and custom attributes. See [Create shipment tasks](/maps/documentation/mobility/fleet-engine/journeys/tasks/create-shipment-tasks) and the related guides. |\n| 2 | **Schedule tasks.** | When you schedule a task for delivery, you issue a delivery vehicle update request, which then updates the vehicle entity with a list of stops to travel. You assign each stop a list of tasks to be completed at the stop. See [Update delivery vehicle tasks](/maps/documentation/mobility/fleet-engine/journeys/tasks/update-tasks). |\n| 3 | **Update the task progress.** | Once the task is assigned to a delivery stop and active in Fleet Engine, your system notifies Fleet Engine about the vehicle progress as it approaches, arrives at, and completes the stop. With this information, Fleet Engine can best perform routing and status updates along the journey as well as throughout the day for the vehicle. See [Update vehicle stop status](/maps/documentation/mobility/fleet-engine/journeys/tasks/update-stops). |\n| 4 | **Share journeys.** | At the same time that the vehicle begins active navigation for the delivery day, you can share journey information with interested stakeholders. Fleet Engine makes both task details and vehicle location available to interested stakeholders in the following ways: - **Shipment information for consumers** . With this solution, consumers can see the status of their package along with the vehicle location information you permit them to view. See [Consumer sharing for scheduled tasks](/maps/documentation/mobility/journey-sharing/scheduled). - **Fleet status information for administrators** . With this solution, fleet administrators can visualize the locations of delivery vehicles and their stops in your fleets in near real time. If the route for a vehicle is known, the map view component animates that vehicle as it moves along its predicted path. See the [JavaScript Fleet Tracking library](/maps/documentation/mobility/operations/fleet-tracking). |\n| 5 | **Finalize the task.** | You finalize shipment tasks in Fleet engine in the following ways: - **Close the task**: Closing a shipment task indicates that that task is no longer active. - **Set the task outcome**: Once a task is closed, you indicate either a successful or failed task to indicate if the delivery took place or not. This is an important part of finalizing a task to show the delivery outcome in your consumer experience and to ensure correct billing for the Fleet Engine service. Keep in mind that, like delivery vehicles, task entities remain active within Fleet Engine for 7 days regardless of state, at which point they are removed. See [Finalize tasks](/maps/documentation/mobility/fleet-engine/journeys/tasks/finalize-tasks). |\n\nTask sequence flow\n------------------\n\nThe following diagram shows a detailed flow of a task lifecycle.\n\nWhat's next\n-----------\n\n- [Create shipment tasks](/maps/documentation/mobility/fleet-engine/journeys/tasks/create-shipment-tasks)"]]