# @ohos.WorkSchedulerExtensionAbility (Deferred Task Scheduling Callbacks) The **WorkSchedulerExtensionAbility** module provides callbacks for deferred task scheduling. When developing an application, you can override the APIs of this module and add your own task logic to the APIs. > **NOTE** > > - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The APIs of this module can be used only in the stage model. ## Modules to Import ```ts import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility' ``` ## Attributes **System capability**: SystemCapability.ResourceSchedule.WorkScheduler | Name| Type| Readable| Writable| Description| | -------- | -------- | -------- | -------- | -------- | | context10+ | [WorkSchedulerExtensionContext](js-apis-inner-application-WorkSchedulerExtensionContext.md) | Yes| No| Context of the **WorkSchedulerExtension**. This context is inherited from **ExtensionContext**.| ## WorkSchedulerExtensionAbility.onWorkStart onWorkStart(work: workScheduler.WorkInfo): void Called when the system starts scheduling the deferred task. **System capability**: SystemCapability.ResourceSchedule.WorkScheduler **Parameters** | Name | Type | Mandatory | Description | | ---- | ---------------------------------------- | ---- | -------------- | | work | [workScheduler.WorkInfo](js-apis-resourceschedule-workScheduler.md#workinfo) | Yes | Target task.| **Example** ```ts export default class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility { onWorkStart(workInfo) { console.log('MyWorkSchedulerExtensionAbility onWorkStart' + JSON.stringify(workInfo)); } } ``` ## WorkSchedulerExtensionAbility.onWorkStop onWorkStop(work: workScheduler.WorkInfo): void Called when the system stops scheduling the deferred task. **System capability**: SystemCapability.ResourceSchedule.WorkScheduler **Parameters** | Name | Type | Mandatory | Description | | ---- | ---------------------------------------- | ---- | -------------- | | work | [workScheduler.WorkInfo](js-apis-resourceschedule-workScheduler.md#workinfo) | Yes | Target task.| **Example** ```ts export default class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility { onWorkStop(workInfo) { console.log('MyWorkSchedulerExtensionAbility onWorkStop' + JSON.stringify(workInfo)); } } ```