...
Two types of approaches can be offered - "scheduled-style" mechanism that check the status of pieces and change the status of the PO line if necessary; “interceptor“injection-style” mechanism that monitor changes in the status of pieces and change the status of the PO line if necessary.
Scheduled-style mechanism
Checking and updating the PO line status upon retrieving
PostgreSQL Trigger Functions
Vert.X Periodic Timer
#_executing_periodic_and_delayed_actions
Interceptor-style mechanisms
Separate Scheduler Application
PostgreSQL cron-job
pg_cron