import { TxTask } from "./tx-task"; import { Subject } from 'rxjs'; import { TxMountPoint } from './tx-mountpoint'; import { TxJobJSON } from "./tx-job-json"; import { TxSubscribeOptions } from './tx-subscribe-options'; import { TxJobComponentOptions } from './tx-job-component-options'; import { TxJobExecutionOptions } from "./tx-job-execution-options"; import { TxRecordPersistAdapter } from "./tx-record-persist-adapter"; import { TxJobExecutionId } from "./tx-job-execution-id"; import { TxJobServices } from './tx-job-services'; import { TxSubscribe } from './tx-subscribe'; import { TxDirection } from './tx-direction'; export declare class TxJob { private name; private _isCompleted; isStopped: Subject; onComponent: TxSubscribe; onError: TxSubscribe; uuid: string; stack: any[]; trace: any[]; block: any[]; subscribers: any[]; error: boolean; single: boolean; revert: boolean; current: any; options: TxJobExecutionOptions; pointnumber: number; executionId: TxJobExecutionId; recorder: TxRecordPersistAdapter; waiting: Set; services: TxJobServices; constructor(name: string); subscribeCB(data: TxTask, txMountPoint: TxMountPoint, options: TxSubscribeOptions): Promise; errorCB(task: TxTask, txMountPoint: TxMountPoint, options: TxSubscribeOptions): Promise; subscribe(txMountPoint: TxMountPoint): void; /** * use when defining S2S. like: job.on('service').add('mountpoint') * @param serivce in case of S2S set the service of the following mountpoint */ on(serivce: string): TxJobServices; /** * TxDoublePoint hold to TxSinglePoint: * sender: user to send tasks from me to others * recver: user to subscribe and receive from others to me * * @param sender - the mountpoint use to send tasks by me to others */ add(sender: TxMountPoint, options?: TxJobComponentOptions): void; private newDoublePoint; private getDoublePoint; execute(task: TxTask, options?: TxJobExecutionOptions): Promise; continue(data: TxTask, options?: TxJobExecutionOptions): Promise; /** * run the components step by step, after each step the control return to user * the call to step again to run next component. * @param data the data to pass to components * @param options */ step(data: TxTask, options?: TxJobExecutionOptions): Promise; undoCB(data: TxTask): Promise; undo(data: TxTask, direction?: TxDirection): Promise; /** * do error handling on all components * * @param data * @param options */ errorAll(data: any, options?: TxJobExecutionOptions): Promise; private publish; private publishError; /** * S2S: in case of S2S take all the mountpoint defined in this.services * and use them for the executions. */ private setFromServices; private isMultiPoint; private shift; private shiftError; private shiftErrorGetCurrent; reset(): void; unsubscribes(): void; release(): void; notify(data: TxTask): void; private finish; private isFinish; private isErrorFinish; private doErrorFinish; toJSON(): TxJobJSON; upJSON(json: TxJobJSON): this; static create(json: TxJobJSON): TxJob; /** * Add record to options is optional, if options.execute.record === true then * set TxJobRepository.setRecordFlag(this.job, true) to on. * This flag is override TxJobRepository.recordFlag and return true. * * If options.execute.record === false then turn record off on the TxJobRegistry and return false; * * If options.execute.record is not exit (not define) then use the TxJobRegistry flag * * @param {TxJobExecutionOptions} options * @returns {boolean} */ private isRecord; private record; genExecutionId(): void; getExecutionId(): TxJobExecutionId; getCurrentName(): any; getIsCompleted(): TxSubscribe; isCompleted: TxSubscribe; getIsStopped(): Subject; getOnComponent(): TxSubscribe; getOnError(): TxSubscribe; getName(): string; getUuid(): string; getOptions(): TxJobExecutionOptions; }