Skip to main content
Skip to main content

BatchJobService

Properties

__configModule__Record<string, unknown>
__container__anyRequired
__moduleDeclaration__Record<string, unknown>
batchJobRepository_Repository<BatchJob>Required
batchJobStatusMapToPropsMap<BatchJobStatus, { entityColumnName: string ; eventType: string }>Required
eventBus_EventBusServiceRequired
manager_EntityManagerRequired
strategyResolver_StrategyResolverServiceRequired
transactionManager_undefined | EntityManagerRequired
EventsobjectRequired
Events.CANCELEDstringRequired
Events.COMPLETEDstringRequired
Events.CONFIRMEDstringRequired
Events.CREATEDstringRequired
Events.FAILEDstringRequired
Events.PRE_PROCESSEDstringRequired
Events.PROCESSINGstringRequired
Events.UPDATEDstringRequired

Accessors

activeManager_

Returns

EntityManagerEntityManagerRequired

Methods

atomicPhase_

Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created.

Parameters

work(transactionManager: EntityManager) => Promise<TResult>Required
the transactional work to be done
isolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>
the isolation level to be used for the work.
maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>
Potential error handler

Returns

PromisePromise<TResult>Required
the result of the transactional work

cancel

Parameters

batchJobOrIdstring | BatchJobRequired

Returns

PromisePromise<BatchJob>Required

complete

Parameters

batchJobOrIdstring | BatchJobRequired

Returns

PromisePromise<BatchJob>Required

confirm

Parameters

batchJobOrIdstring | BatchJobRequired

Returns

PromisePromise<BatchJob>Required

create

Parameters

Returns

PromisePromise<BatchJob>Required

listAndCount

Parameters

Returns

PromisePromise<[BatchJob[], number]>Required

prepareBatchJobForProcessing

Parameters

reqRequest<ParamsDictionary, any, any, ParsedQs, Record<string, any>>Required

Returns

PromisePromise<CreateBatchJobInput>Required

retrieve

Parameters

batchJobIdstringRequired

Returns

PromisePromise<BatchJob>Required

setFailed

Parameters

batchJobOrIdstring | BatchJobRequired
errorstring | BatchJobResultError

Returns

PromisePromise<BatchJob>Required

setPreProcessingDone

Parameters

batchJobOrIdstring | BatchJobRequired

Returns

PromisePromise<BatchJob>Required

setProcessing

Parameters

batchJobOrIdstring | BatchJobRequired

Returns

PromisePromise<BatchJob>Required

shouldRetryTransaction_

Parameters

errRecord<string, unknown> | { code: string }Required

Returns

booleanboolean

update

Parameters

batchJobOrIdstring | BatchJobRequired
dataPartial<Pick<BatchJob, "context" | "result">>Required

Returns

PromisePromise<BatchJob>Required

updateStatus

Parameters

batchJobOrIdstring | BatchJobRequired
statusBatchJobStatusRequired

Returns

PromisePromise<BatchJob>Required

withTransaction

Parameters

transactionManagerEntityManager

Returns

BatchJobServiceBatchJobServiceRequired
Was this section helpful?