The workflow is the long-running process required to accomplish an operation
Use case
A use case represents a business action.
Şöyle düşünebiliriz.
Use case:create/update/delete business objectapply business rulecomplete a business operationproduce business events
Book Keepin
The retry count, lease, sent flag, processing flag, backoff timestamp, etc. exist solely so the workflow can safely coordinate work.
Örnek
Use case : Register UserImplementation:- Validate email is unique- Create user- Assign default role- Store user- Publish UserRegistered event
Workflow şöyle. The workflow spans time, retries, external systems, and multiple transactions.
User Registration Workflow- Register User use case- Send verification email
- Wait for user click
- Timeout after 7 days
- Resend email
- Activate account
Db Book Keeping Operations
Hem workflow, hem de use case içinde book keeping transactions olabilir. Bunlar use case anlamına gelmezler.
Örnek
X Delivery Workflow│├─ find pending delivery├─ mark SENDING ← DB operation├─ send UDP segment 1├─ wait for ACK├─ send UDP segment 2├─ wait for ACK├─ timeout?│ └─ mark BACKOFF ← DB operation│├─ retry│├─ final ACK│ └─ CompleteDelivery ← Use case│└─ publish resulting events