File

platform-components-ng/projects/platform-components-lib/src/lib/components/background-tasks/service/background-tasks.service.ts

Description

Background tasks service

Index

Methods

Constructor

constructor(http: HttpClient, callbackService: CallbackService, qppErrorMessageService: QppErrorMessageService)
Parameters :
Name Type Optional
http HttpClient No
callbackService CallbackService No
qppErrorMessageService QppErrorMessageService No

Methods

addBackgroundTask
addBackgroundTask(tasks: any)

Add background task

Parameters :
Name Type Optional Description
tasks any No

Task | Task[]

Returns : void

void

Async cancelAllTasks
cancelAllTasks(taskTypes: BackgroundTaskType[])

Clears all tasks of specified types. If no task types are specified, it clears all tasks.

Parameters :
Name Type Optional Default value Description
taskTypes BackgroundTaskType[] No []

Array of BackgroundTaskType to filter tasks

Returns : Promise<void>

Promise of void

  • This method also cancels polling for conversion status tasks.
Async cancelPollingForConvStatus
cancelPollingForConvStatus(backgroundTask: BackgroundTask)

Cancel polling for conversion statuscontextId

Parameters :
Name Type Optional Description
backgroundTask BackgroundTask No

Background Task

Returns : Promise<boolean | void>

Promise of boolean

clearAllCompletedTasks
clearAllCompletedTasks(taskTypes: BackgroundTaskType[])

Clears all completed tasks of specified types. If no task types are specified, it clears all completed tasks.

Parameters :
Name Type Optional Default value Description
taskTypes BackgroundTaskType[] No []

Array of BackgroundTaskType to filter tasks

Returns : void

void

clearBackgroundTaskForContextId
clearBackgroundTaskForContextId(contextId: string)

Clears the background task for a specific context ID.

Parameters :
Name Type Optional Description
contextId string No

Context Id

Returns : void

void

  • This method also cancels polling for conversion status tasks associated with the context ID.
clearBackgroundTasks
clearBackgroundTasks()

This methods is used to clear the background task dialog by removing all the tasks from backgroundTasks$ which are not in 'PENDING' status.

Returns : void

void

downloadFile
downloadFile(backgroundTask: BackgroundTask)

Download File

Parameters :
Name Type Optional Description
backgroundTask BackgroundTask No

Background Task

Returns : void

void

getBackgroundTaskForContextId
getBackgroundTaskForContextId(contextId: string)

Get background task for context id

Parameters :
Name Type Optional Description
contextId string No

Context Id

Observable

getBackgroundTasks
getBackgroundTasks()

Get background tasks

Returns : any

void

result-matching ""

    No results matching ""