lib/common/process/process-manager.service.ts
Service for managing processes.
Properties |
|
Methods |
|
constructor(lockExec: WarlockFn, logger: Logger, broker: MessagesBroker, processUnitRep: Repository<ProcessUnitEntity>, processLogRep: Repository<ProcessLogEntity>)
|
||||||||||||||||||
Parameters :
|
Async createLogInstance | ||||||||
createLogInstance(processCode: string)
|
||||||||
Creates a log instance for a process.
Parameters :
Returns :
unknown
The created ProcessLogEntity instance. |
getLastLogsByProcess | |||||||||||||||
getLastLogsByProcess(processCode: string, limit: number)
|
|||||||||||||||
Gets the last logs of a process by its code.
Parameters :
Returns :
any
An array of ProcessLogEntity instances. |
getProcessData | |||||||||||||||
getProcessData(code: string, force)
|
|||||||||||||||
Gets process data by its code.
Parameters :
Returns :
any
The ProcessUnitEntity instance. |
getProcessLogById | ||||||||
getProcessLogById(id: number)
|
||||||||
Gets a process log by its ID.
Parameters :
Returns :
any
The ProcessLogEntity instance. |
Async getProcessUnitStatus | ||||||||
getProcessUnitStatus(code: string)
|
||||||||
Gets the status of a process unit.
Parameters :
Returns :
unknown
The current status of the process unit. |
Async init |
init()
|
Initializes the process manager service, resets process statuses, and registers processes.
Returns :
any
|
Private Async resetAllProcessStatuses |
resetAllProcessStatuses()
|
Resets the statuses of all enabled processes to "Ready".
Returns :
any
|
Async setProcessUnitStatus | ||||||||||||
setProcessUnitStatus(code: string, status: Process.Status)
|
||||||||||||
Sets the status of a process unit.
Parameters :
Returns :
unknown
|
Async startProcess | ||||||||
startProcess(code: string)
|
||||||||
Starts a process by its code.
Parameters :
Returns :
any
|
Async stopProcess | ||||||||
stopProcess(code: string)
|
||||||||
Stops a process by its code.
Parameters :
Returns :
any
|
Async toggleProcess | ||||||||
toggleProcess(code: string)
|
||||||||
Toggles the enabled status of a process.
Parameters :
Returns :
any
|
updateLogInstance | ||||||||
updateLogInstance(logInstance: ProcessLogEntity)
|
||||||||
Updates a log instance.
Parameters :
Returns :
any
The updated ProcessLogEntity instance. |
Private Static pmInitStatus |
Type : boolean
|