M4-S4 — Owners, time limits and working time
Section titled “M4-S4 — Owners, time limits and working time”| Module | M4 — The process engines |
| After this session you can | Predict who becomes the owner of a step and why, and when a time limit is reached and flagged, and prove both on the running platform. |
| Time | 63 min with a facilitator · about 63 min on your own |
| Before you start | M4-S3 (the stack and the move) and M4-S1 (the scheduler). Larkspur Lab, Rami Aziz signed in; Omar Haddad in a private window; the workbench API and record-query windows open. |
| Go deeper | Engine: Workflow — owner resolution and time limits · Working time and SLA engine · Workflow participation |
◆ Orientation (1 min) — Who, and by when
Section titled “◆ Orientation (1 min) — Who, and by when”M4-S3 chose the next step. Two questions remain, and they are the ones people complain about: why is this mine? and why was it flagged late? You configured owners with groups, managers and formulas in ACE M3-S3, and time limits with escalation in ACE M3-S4. Here you open the two engines behind them: the owner chain that the data service walks at every move, and the time-limit records that the workflow service opens, closes and sweeps. In the lab you prove a fallback owner and an overdue step from the stored records, not from the screen.
▤ Concept (9 min) — The owner chain and the clock
Section titled “▤ Concept (9 min) — The owner chain and the clock”The owner chain
Section titled “The owner chain”Every time the engine chooses a next step, it asks who owns it? It answers with a chain of rules tried in a fixed order; the first rule that produces an owner wins and the rest are not consulted.
flowchart TD
S["Next step chosen"] --> P{"A permanent reassignment<br/>recorded for this step?"}
P -->|yes| PO["That person"]
P -->|no| T{"Take-ownership step that<br/>returns to the last owner?"}
T -->|yes| TO["The last person who took it"]
T -->|no| R{"Repeating step with<br/>owners still to act?"}
R -->|yes| RO["The next remaining owner"]
R -->|no| E{"Entry step?"}
E -->|yes| EO["The entry's creator"]
E -->|no| C["Candidates: the step's owner,<br/>then each fallback in order"]
C --> K["Resolve, expand, filter eligible"]
K -->|"none eligible"| C
K -->|"first eligible"| OK["Owner"]
What to notice: the general case is the last rule. A permanent reassignment beats everything the designer configured, which is why a “wrong” owner is often a decision someone made months ago.
Candidates. In the general case the engine builds a list: the step’s owner, then each entry of Fallback Assignment, in order. For each candidate it runs three stages:
- Resolve the raw owner with the strategy its source type names. Fixed uses the user, group, list or organization unit you picked. Field reads a field of the record (following a relation if the path crosses one) and gives nothing if the field is empty. Previous step owner takes the owner of an earlier step, either as defined or as it actually happened. An Expression is evaluated with the record, the entity, the current user, the current step, the history and the workflow in scope; only valid user or group references survive.
- Expand the owner by its type. A group becomes its first member, or nobody when the step is parallel or the owner is picked manually (Take Ownership). A group with Manager selection becomes the manager of the organization unit. A relative option replaces the owner with their manager one or more levels up. A list becomes its first item. An empty group yields no owner at all, so the engine moves on to the next fallback (before 1.8 it stopped there and stranded the step).
- Filter for eligibility. An owner whose record is not active, a deactivated user, or an obsolete invalid record is dropped, and the engine tries the next candidate.
The first candidate that leaves a valid owner wins. If none does, every step except the exit is refused: the engine requires an original owner, the full eligible set before one person was chosen, and fails the move rather than leave a step nobody can see.
Two fields, two meanings. The stack item from M4-S3 stores owner (the person who acts now)
and originalOwner (the eligible set: the group, the list, every parallel owner). A group-owned
step shows one member as owner and the group as originalOwner; a manually picked step has an
empty owner until someone takes it. When you read “who could have acted”, read originalOwner.
Organization units in the chain
Section titled “Organization units in the chain”An organization unit appears in two places. As an owner type, it resolves to its members, like a group. As the source of Manager selection, it resolves to the unit’s manager, and a unit with no manager yields no owner, so the fallback applies. Relative options use the reporting line, so a “manager of the requester” step depends on every user’s manager being set: a missing manager silently pushes the step to the fallback.
The time limit’s three records
Section titled “The time limit’s three records”A step’s Timing is a design setting. At run time the workflow service keeps its own records:
| Record | When it is written | What it holds |
|---|---|---|
| Time-limit configuration | Rebuilt every time the entity’s definition is saved | One row per timed step: the value, the unit, the Timing method and the Timing Schedule |
| Time-limit history | When a timed step is reached | The received time, the due date, a copy of the working hours and holidays used, and a status: Pending, Achieved or Overdue |
| Occurrences (reaction service) | When an On Time Exceeded reaction has repeats | The dates of each repeat, from Wait for, Repeat after and Stop after |
stateDiagram-v2 [*] --> Pending: step reached (due date computed) Pending --> Achieved: step exited before the sweep found it late Pending --> Overdue: the minute sweep finds the due date passed Overdue --> [*]: step exited Achieved --> [*]
What to notice: a step is never “late” by itself. It becomes Overdue only when the sweep, which runs once a minute, finds its due date passed.
Opening. When a timed step is reached, the workflow service resolves the period: a fixed value, a field of the record or an expression, falling back to Fallback Value when the result is not a number, and skipping the step entirely if the result is zero. It converts the period to seconds, loads the Timing Schedule’s working hours and its holidays, and asks the clock service for a due date. It then writes a Pending history row with a snapshot of those hours and holidays. A second step-reached event for the same step and record does nothing.
Closing. When the step is exited, its Pending row becomes Achieved with a completion time.
The sweep. A job scheduled through the scheduler (M4-S1) with the cron * * * * * runs every
minute. It finds Pending rows whose due date has passed and, row by row, changes Pending to
Overdue only if the row is still Pending (a compare-and-set, since 1.10), publishing a time
exceeded event for each row it changed. That event starts your On Time Exceeded reactions. So
the Overdue flag lags the due date by up to a minute, and if the scheduler is down, nothing becomes
overdue at all.
How the clock counts
Section titled “How the clock counts”The clock service walks forward from the start time, day by day. It skips holidays entirely, counts only the time inside the day’s working window, and returns the moment the allowed period is used up. Days that are not listed in the working hours count as zero. Three consequences:
- The snapshot freezes the due date. Editing the working hours or adding a holiday changes new time limits, not open ones.
- Time zones come from the clock’s process. The working windows are stored as times of day, and the clock applies them in its own runtime time zone. Run the clock in a fixed zone, UTC being the usual choice, and enter working hours against it; otherwise due dates shift by the offset.
- A schedule with no real working window is a defect. Treat “every schedule contains at least one working window” as a rule of your program.
Repeats of an escalation are computed by the same clock, so a Repeat after of one working day skips weekends and holidays too.
▶ Guided demo (8 min) — Read an owner’s reasons
Section titled “▶ Guided demo (8 min) — Read an owner’s reasons”Starting state. Larkspur Lab as seeded. Non-conformance NC-0311 (Kestrel Seals: batch with wrong hardness) is at Containment, owned by the group Quality.
- Open NC-0311. The form shows the step Containment and Tariq Saleh as owner.
- Read its stack item:
curl -s "$BASE/api/v2/entities/non_conformances/entries/<NC-0311 id>" -H "x-app-token: $TOKEN" | jq '.result.entry.value._metaCurrentSteps[0] | {owner, originalOwner, ownerDefinition}'.owneris Tariq,originalOwneris the Quality group,ownerDefinitionrecords type group and source fixed. - In the designer, open Data Entities › Non-conformances › Workflows › Containment and read its owner: group Quality, first member. Tariq is the group’s first member.
- Open Administration › Organization › Groups › Quality. The members list starts with Tariq.
- Back in the API answer, read
receivedAton the stack item; this is the time the time-limit row for Containment used as its start.
Screenshot pending The stack item of NC-0311 with owner Tariq Saleh, originalOwner the Quality group and the owner definition
What to notice: owner and originalOwner answer different questions: who acts now, and who could act.
✓ Practice (4 min) — The chain
Section titled “✓ Practice (4 min) — The chain”A step’s owner is the field Assigned technician, with the group Maintenance Planners as Fallback Assignment. A work order is created with Assigned technician set to a user who was deactivated last week. Who owns the step?
Check your answer
The correct answer is C. Open the explanation under each option to see why.
Six months ago an administrator permanently reassigned the Approval step of a service to Sara Qasim. The designer now names the group Procurement as the owner. Who owns Approval for a new request of that service?
Check your answer
The correct answer is A. Open the explanation under each option to see why.
A step uses Manager selection on the requester’s organization unit. For requests from Larkspur Field Service the step goes to the fallback owner. What do you check first?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
⛏ Lab (32 min) — A fallback owner and a two-minute limit, proved
Section titled “⛏ Lab (32 min) — A fallback owner and a two-minute limit, proved”Goal. Prove from the stored records that a deactivated owner falls through to the fallback, and that a timed step goes from Pending to Overdue and starts its escalation.
Before you start. The working hours Larkspur round the clock (testing) exist (every day, 00:00 to 23:59). The Work Orders step In Progress is owned by the field Assigned technician. The contractor account Yusuf Halabi exists and is active.
Part A — the fallback owner
- In Data Entities › Work Orders › Workflows, open the step In Progress, and in Fallback Assignment add the group Maintenance Planners. Save with Save Changes.
- Create work order WO-1101 (P-104 vibration check), Assigned technician Maya Idris, and move it to In Progress.
- Read its stack item (the demo’s command, on WO-1101).
owneris Maya. - Deactivate Yusuf Halabi in Administration › Organization › Users.
- Create WO-1102 (C-220 filter change), Assigned technician Yusuf Halabi, and move it to In Progress.
- Read its stack item.
owneris Omar Haddad, the first member of Maintenance Planners;ownerDefinitionnames the group, the fallback that won.
Part B — a two-minute limit
-
Open the step Planned and set Timing on: Timing Schedule Larkspur round the clock (testing), Time Unit Minutes, Timing method Fixed Value, value 2. Save.
-
In Reactions › Time Monitoring, check that Escalate late planning (On Time Exceeded, Choose Step Planned) notifies Maintenance Planners.
-
Create WO-1103 (V-31 actuator noise) and move it to Planned. Note the time.
-
In the record-query window, read the time-limit history in the workflow service’s database:
db.WorkflowSlaHistory.find({ "relatedTo.dataEntry": "<WO-1103 id>" },{ stepId: 1, receivedDate: 1, dueDate: 1, status: 1 })One row,
status2 (Pending),dueDatetwo minutes afterreceivedDate. -
Wait three minutes, then read the row again:
status1 (Overdue).
Screenshot pending Two reads of the time-limit row of WO-1103, the first Pending and the second Overdue, with the same due date What to notice: the due date never changes between the two reads; only the status does, when the minute sweep finds it.
- In Reaction Logs, one run of Escalate late planning for WO-1103; as Omar, the notification arrived.
- Change the step’s value to 60 and save. Read WO-1103’s row: its
dueDatehas not changed. - Move WO-1103 to In Progress. Read the row: still Overdue, now with a completion time.
- Restore: set Planned’s Timing back to the seed’s value and schedule, and reactivate Yusuf Halabi.
Check.
- WO-1101’s owner is Maya.
- WO-1102’s owner is Omar, from the fallback, while Yusuf is deactivated.
- WO-1103’s row went from status 2 to status 1 within about three minutes.
- The escalation ran once and Omar received it.
- Changing the step’s value did not move the open row’s due date.
- The step’s timing and Yusuf’s account are back to the seed.
Pass condition. Your notes show the stack item of WO-1101 and WO-1102 and the time-limit row of WO-1103 at each read, and you can name the rule of the chain and the stage of the time limit behind each.
If something goes wrong
| What you see | What to do |
|---|---|
| WO-1102 is refused with an owner error | The fallback is not saved, or Maintenance Planners is empty. Re-open the step and check Fallback Assignment. |
| No time-limit row in step 10 | The step’s Timing is missing a schedule, a unit or a value; any one of them missing skips the step silently. |
| The row stays Pending after five minutes | The minute sweep depends on the scheduler: check lk-osos-scheduler is running and its sweep job exists (M4-S1). |
| The due date is hours away | The working hours do not cover now, or the clock runs in another time zone than the one you entered them in. Use the round-the-clock schedule. |
| Several escalation runs | Repeat after is set on the reaction; that is expected repetition, counted in working time. |
Model answer
Part A. For WO-1101 the candidate list starts with the field Assigned technician; Maya is active, so the first candidate wins. For WO-1102 the field resolves to Yusuf, but the eligibility filter drops a deactivated user, so the engine resolves the next candidate, the group, expands it to its first member and records the group as the owner definition and original owner.
Part B. Reaching Planned opened a Pending row whose due date the clock computed from the round-the-clock schedule: received time plus two minutes. The minute sweep found it past due, changed it to Overdue with a compare-and-set and published the time-exceeded event, which ran Escalate late planning. The value change rebuilt the configuration for future rows only; the open row kept its snapshot. Exiting the step closed the row; an overdue row stays overdue.
◇ Worked scenario (3 min) — The weekend that counted
Section titled “◇ Worked scenario (3 min) — The weekend that counted”Tariq Saleh complains that non-conformances raised on Thursday afternoon are flagged overdue on Sunday morning, although the time limit is “two working days” and Friday and Saturday are the weekend. Decide at each step before you read on.
Step 1. Which schedule? The step’s Timing Schedule is Larkspur office hours: Sunday to Thursday, 08:00 to 16:00. Friday and Saturday are not listed, so they count as zero. Two working days of eight hours from Thursday 14:00 should end on Monday at 14:00, the rows say Sunday 09:00. Where can a wrong due date come from?
Step 2. The schedule and the clock. You read a recent row’s snapshot. The windows read 08:00 to 16:00, as entered, and there is no holiday in the range. You confirm with the operator that the clock runs in the same time zone the hours were entered in. The schedule and the clock are not the cause: with these windows, Sunday 09:00 is exactly three working hours after Thursday 14:00.
Step 3. The value. The step’s Timing method is Expression, in Hours: it gives 8 for a critical non-conformance and 16 otherwise, reading the field Severity. Severity was renamed to Impact last month. The expression now fails, so the engine used the Fallback Value, which is 3, a value someone set years ago as a safety net. Three hours from Thursday 14:00: two on Thursday, none on Friday or Saturday, one on Sunday. Due Sunday 09:00; the minute sweep flagged it then.
Step 4. The fix. You correct the expression to read Impact, set the fallback to the longest real limit (16) so that a broken expression errs towards patience, and record a program rule that a field rename is checked against every expression that reads it. Open rows keep their snapshot and their old due dates, so you list them and decide with Tariq whether to accept them.
The lesson: a wrong due date has three possible sources, the schedule, the clock’s zone and the period’s value, and the row’s snapshot lets you separate them.
✓ Practice (5 min) — Time limits
Section titled “✓ Practice (5 min) — Time limits”An administrator adds a public holiday for tomorrow. A non-conformance opened this morning has a due date tomorrow afternoon. What happens to its due date?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
The scheduler service was unavailable from 10:00 to 10:20. A step’s due date was 10:05. When is it flagged Overdue, and when does its escalation run?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
Office hours run 08:00 to 16:00, Sunday to Thursday, with no holidays. A work order enters a step with a four-hour limit at 14:00 on a Thursday. When is it due?
Check your answer
The correct answer is C. Open the explanation under each option to see why.
A step’s Timing method is Field Value on Allowed hours, with Fallback Value 0. A record is created with Allowed hours empty. What does the engine do?
Check your answer
The correct answer is A. Open the explanation under each option to see why.
↺ Recap (1 min) — The process engines, opened
Section titled “↺ Recap (1 min) — The process engines, opened”You can now walk the owner chain and say why a step belongs to whom, and follow a time limit from its opening snapshot to the minute sweep that flags it. After this module you can predict and diagnose scheduled work, reaction runs, workflows, owners and time limits from what the engines record. Next, M5-S1: identity. Every owner, executor and Executed by you read in M4 is an identity some service trusted; you now learn how it got there.