289Statuses
Statuses of each document type, with color and first / final flags.
Try it
Workflow
Statuses (status_def) and the allowed moves between them (status_transition)
Draft β
β Issue β
ISSUEDβ Void β VOID
Issued
β Receive all β
PAIDβ Receive part β PARTIALβ Void β VOID
Partly paid
β Receive rest β
PAID
Paid
final - no further moves
Void
final - no further moves
Can a document move?
| # | Document type | Code | Name | Color | Sort order | First status | Final status | Status | |
|---|---|---|---|---|---|---|---|---|---|
| 8 | INVOICE | DRAFT | Draft | #64748b | 1 | β | Active | βοΈ | |
| 9 | INVOICE | ISSUED | Issued | #2563eb | 2 | Active | βοΈ | ||
| 10 | INVOICE | PARTIAL | Partly paid | #f59e0b | 3 | Active | βοΈ | ||
| 11 | INVOICE | PAID | Paid | #16a34a | 4 | β | Active | βοΈ | |
| 12 | INVOICE | VOID | Void | #dc2626 | 5 | β | Active | βοΈ | |
| 1 | ORDER | DRAFT | Draft | #64748b | 1 | β | Active | βοΈ | |
| 2 | ORDER | SUBMITTED | Submitted | #2563eb | 2 | Active | βοΈ | ||
| 3 | ORDER | APPROVED | Approved | #16a34a | 3 | Active | βοΈ | ||
| 4 | ORDER | REJECTED | Rejected | #dc2626 | 4 | Active | βοΈ | ||
| 5 | ORDER | SHIPPED | Shipped | #0891b2 | 5 | Active | βοΈ | ||
| 6 | ORDER | COMPLETED | Completed | #15803d | 6 | β | Active | βοΈ | |
| 7 | ORDER | CANCELLED | Cancelled | #475569 | 7 | β | Active | βοΈ |
Showing 1β12 of 12
π Learn: how this master is built table status_def
Key points
- A composite UNIQUE key (entity_type, code) lets ORDER and INVOICE both have a DRAFT status.
- StatusService.validateStatus(): only one first status per document type.
Code
- Entity
domain/StatusDef.java- Repository
repo/StatusDefRepository.java- Definition
MasterRegistry: "statuses"- Page / form
web/MasterController.java- Try-it panel
templates/tools/workflow.html- REST API
GET /api/status/ORDER/next?from=DRAFT
SQL to try in SSMS (database MasterDataLabDB)
SELECT entity_type, code, name, initial_status, final_status FROM status_def ORDER BY entity_type, sort_order;