Processes
This document describes the processes service, which manages processes that notify the user about the status of a background task. It includes functionality to create, update, and delete processes.
This service will use the notification service to actually send the notifications to the user.
Usage Sequence
The following sequence diagrams shows the usage of the processes service:
- Request Complex Operation: The User/Client requests some update to the system that requires a background task. E.g.
Create userorCreate Project, which requires further processing like sending an email to the user, creating a user in AAD, seeding project data, etc. TheuserIdis received to associate the task to the user. - Create Entity: As soon as the request is validated, the Main Service responsible for executing the task, e.g. Users Service or Projects Service, creates the entity in the database. The entity is created with a status of
PendingorProcessing, and anentityIdis assigned to it, as well as aprocessIdto track the background task. This status indicates that the entity cannot be modified until the process is completed or failed. - Entity Created: The Main Service returns the
entityIdandprocessIdto the User/Client for further tracking of the task and entity. - Start Processing: The Main Service starts a background task, usually managed by Temporal.io, to process the task. The task could be a simple operation or a complex operation that requires multiple steps and time to complete.
- Create Process: The Main Service call to creates a process associated to the
userId,processIdandentityIdto track the task. - Notify User: The Processes Service calls the Notification Service to send a notification to the user about the status of the task. The notification includes the
entityIdandprocessIdto track the task. - Begin Background Task: The Main Service starts the background task to process the operation.
During the background process, each atomic activity in the workflow can update the process status and progress to notify the user about the task. Each update to the process must include a level of severity, a message, and a timestamp. The user can use preferences to filter the notifications by severity.
Data Model
The following diagram shows the data model for the processes service:
ProcessProcessId: Unique identifier for the process.UserId: Identifier of the user associated with the process.ProjectId: Identifier of the project associated with the process.EntityId: Identifier of the entity associated with the process.EntityType: Type of the entity associated with the process.
ProcessStatus