Skip to content

Commit 6c39850

Browse files
Merge pull request #271810 from williamzhao87/patch-2
Update scheduled-jobs.md
2 parents d8a233e + bb1ae1e commit 6c39850

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

articles/communication-services/how-tos/router-sdk/scheduled-jobs.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Create a scheduled job for Azure Communication Services
33
titleSuffix: An Azure Communication Services how-to guide
4-
description: Use Azure Communication Services Job Router SDK to create a scheduled job
4+
description: Use Azure Communication Services Job Router SDK to create a scheduled job.
55
author: williamzhao
66
manager: bga
77
services: azure-communication-services
@@ -25,12 +25,12 @@ In the context of a call center, customers may want to receive a scheduled callb
2525
- A deployed Communication Services resource. [Create a Communication Services resource](../../quickstarts/create-communication-resource.md).
2626
- A Job Router queue with queueId `Callback` has been [created](manage-queue.md).
2727
- A Job Router worker with channel capacity on the `Voice` channel has been [created](../../concepts/router/matching-concepts.md).
28-
- Subscribe to the [JobWaitingForActivation event](subscribe-events.md#microsoftcommunicationrouterjobwaitingforactivation)
29-
- Optional: Complete the quickstart to [get started with Job Router](../../quickstarts/router/get-started-router.md)
28+
- Subscribe to the [JobWaitingForActivation event](subscribe-events.md#microsoftcommunicationrouterjobwaitingforactivation).
29+
- Optional: Complete the quickstart to [get started with Job Router](../../quickstarts/router/get-started-router.md).
3030

3131
## Create a job using the ScheduleAndSuspendMode
3232

33-
In the following example, a job is created that is scheduled 3 minutes from now by setting the `MatchingMode` to `ScheduleAndSuspendMode` with a `scheduleAt` parameter. This example assumes that you've already [created a queue](manage-queue.md) with the queueId `Callback` and that there's an active [worker registered](../../concepts/router/matching-concepts.md) to the queue with available capacity on the `Voice` channel.
33+
In the following example, a job is created that is scheduled 3 minutes from now by setting the `MatchingMode` to `ScheduleAndSuspendMode` with a `scheduleAt` parameter. This example assumes that you [created a queue](manage-queue.md) with the queueId `Callback` and that there's an active [worker registered](../../concepts/router/matching-concepts.md) to the queue with available capacity on the `Voice` channel.
3434

3535
::: zone pivot="programming-language-csharp"
3636

@@ -87,7 +87,7 @@ client.createJob(new CreateJobOptions("job1", "Voice", "Callback")
8787
8888
## Wait for the scheduled time to be reached, then queue the job
8989

90-
When the scheduled time has been reached, the job's status is updated to `WaitingForActivation` and Job Router emits a [RouterJobWaitingForActivation event](subscribe-events.md#microsoftcommunicationrouterjobwaitingforactivation) to Event Grid. If this event has been subscribed, some required actions may be performed, before enabling the job to be matched to a worker. For example, in the context of the contact center, such an action could be making an outbound call and waiting for the customer to accept the callback. Once the required actions are complete, the job can be queued by calling the `UpdateJobAsync` method with the `MatchingMode` set to `QueueAndMatchMode` and priority set to `100` to quickly find an eligible worker, which updates the job's status to `queued`.
90+
When the scheduled time is reached, the job's status is updated to `WaitingForActivation` and Job Router emits a [RouterJobWaitingForActivation event](subscribe-events.md#microsoftcommunicationrouterjobwaitingforactivation) to Event Grid. If this event is subscribed, some required actions may be performed, before enabling the job to be matched to a worker. For example, in the context of the contact center, such an action could be making an outbound call and waiting for the customer to accept the callback. Once the required actions are complete, the job can be queued by calling the `UpdateJobAsync` method with the `MatchingMode` set to `QueueAndMatchMode` and priority set to `100` to quickly find an eligible worker, which updates the job's status to `queued`.
9191

9292
::: zone pivot="programming-language-csharp"
9393

@@ -152,14 +152,15 @@ if (eventGridEvent.EventType == "Microsoft.Communication.RouterJobWaitingForActi
152152
{
153153
// Perform required actions here
154154

155-
client.updateJob(new RouterJob(eventGridEvent.Data.JobId)
155+
job = client.updateJob(eventGridEvent.getData().toObject(new TypeReference<Map<String, Object>>() {
156+
}).get("JobId").toString(), BinaryData.fromObject(new RouterJob()
156157
.setMatchingMode(new QueueAndMatchMode())
157-
.setPriority(100));
158+
.setPriority(100)), null).toObject(RouterJob.class);
158159
}
159160
```
160161

161162
::: zone-end
162163

163164
## Next steps
164-
165-
- Learn how to [accept the Job Router offer](accept-decline-offer.md) that is issued once a matching worker has been found for the job.
165+
i
166+
- Learn how to [accept the Job Router offer](accept-decline-offer.md) that is issued once a matching worker is found for the job.

0 commit comments

Comments
 (0)