BatchJobService
Constructors
constructor
**new BatchJobService**(«destructured»)
Parameters
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>batchJobStatusMapToProps
Map<BatchJobStatus, { entityColumnName: string ; eventType: string }>Requiredmanager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredEvents
objectRequiredEvents.CANCELED
stringRequiredDefault: "batch.canceled"
Events.COMPLETED
stringRequiredDefault: "batch.completed"
Events.CONFIRMED
stringRequiredDefault: "batch.confirmed"
Events.CREATED
stringRequiredDefault: "batch.created"
Events.FAILED
stringRequiredDefault: "batch.failed"
Events.PRE_PROCESSED
stringRequiredDefault: "batch.pre_processed"
Events.PROCESSING
stringRequiredDefault: "batch.processing"
Events.UPDATED
stringRequiredDefault: "batch.updated"
Accessors
activeManager_
Protected get**activeManager_**(): EntityManager
Returns
EntityManager
EntityManager
EntityManagerRequiredMethods
atomicPhase_
Protected **atomicPhase_**<TypeParameter TResult, TypeParameter TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise<TResult>
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.
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise<TResult>
Promise
Promise<TResult>Requiredcancel
**cancel**(batchJobOrId): Promise<[BatchJob](/references/services/classes/BatchJob)>
Parameters
Returns
Promise<BatchJob>
complete
**complete**(batchJobOrId): Promise<[BatchJob](/references/services/classes/BatchJob)>
Parameters
Returns
Promise<BatchJob>
confirm
**confirm**(batchJobOrId): Promise<[BatchJob](/references/services/classes/BatchJob)>
Parameters
Returns
Promise<BatchJob>
create
**create**(data): Promise<[BatchJob](/references/services/classes/BatchJob)>
Parameters
Returns
Promise<BatchJob>
listAndCount
**listAndCount**(selector?, config?): Promise<[[BatchJob](/references/services/classes/BatchJob)[], number]>
Parameters
Default: {}
Returns
Promise<[BatchJob[], number]>
prepareBatchJobForProcessing
**prepareBatchJobForProcessing**(data, req): Promise<[CreateBatchJobInput](/references/services/types/CreateBatchJobInput)>
Parameters
req
Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>RequiredReturns
Promise<CreateBatchJobInput>
retrieve
**retrieve**(batchJobId, config?): Promise<[BatchJob](/references/services/classes/BatchJob)>
Parameters
batchJobId
stringRequiredDefault: {}
Returns
Promise<BatchJob>
setFailed
**setFailed**(batchJobOrId, error?): Promise<[BatchJob](/references/services/classes/BatchJob)>
Parameters
error
string | BatchJobResultErrorReturns
Promise<BatchJob>
setPreProcessingDone
**setPreProcessingDone**(batchJobOrId): Promise<[BatchJob](/references/services/classes/BatchJob)>
Parameters
Returns
Promise<BatchJob>
setProcessing
**setProcessing**(batchJobOrId): Promise<[BatchJob](/references/services/classes/BatchJob)>
Parameters
Returns
Promise<BatchJob>
shouldRetryTransaction_
Protected **shouldRetryTransaction_**(err): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanupdate
**update**(batchJobOrId, data): Promise<[BatchJob](/references/services/classes/BatchJob)>
Parameters
Returns
Promise<BatchJob>
updateStatus
Protected **updateStatus**(batchJobOrId, status): Promise<[BatchJob](/references/services/classes/BatchJob)>
Parameters
Returns
Promise<BatchJob>
withTransaction
**withTransaction**(transactionManager?): [BatchJobService](/references/services/classes/BatchJobService)
Parameters
transactionManager
EntityManager