← VVD Glazing Router

Routing Logic

The routing logic three ways: the rules with a what-if checker, the same steps as boolean conditions, and every combination in a full truth table.

1Routing Rules

Each rule in plain IF / THEN form. Rules are checked in order and the first one that matches decides the order. Use the checker to try your own situation.

What-if checker

Answer yes or no for each question. "Enough" means stock ≥ the quantity the order needs. The matching rule lights up on the right.

2Boolean Routing Conditions

The routing logic as numbered steps. Each step has one clear condition made of AND / OR.

Steps

Checked in order. The first step whose condition is true decides the order. If it is false, go to the next step.

Step Route to Condition (every line must be true) Flag / note
0a Client's HUBinterim mode
Interim mode is ON
AND Client has a HUB
AND HUB open jobs ≤ daily cap
Frame: the HUB's stock (only if > frame qty required for glazing), else the client sends their own frame (FRAME_OOS_CLIENT_FRAME_HUB). Lens: the HUB's stock, else DC's stock, else DC substitutes a lens and sends it to the HUB (LENS_OOS_SUBSTITUTE). DC is never used.
0b TOGinterim mode, HUB over cap
Interim mode is ON
AND Client has a HUB
AND HUB open jobs > daily cap
AND The ordered lens is a TOG lens
AND TOG frame stock ≥ frame qty required for glazing
AND TOG open jobs ≤ daily cap
Better than waiting for the HUB. TOG makes its lenses on demand. No flag.
0c Client's HUBinterim mode, queued over cap
Interim mode is ON
AND Client has a HUB
AND Step 0b did not apply
HUB_OVER_CAP: the order queues at the HUB (its open jobs go over the daily cap). Frame and lens as in step 0a.
1 DC
DC frame stock ≥ frame qty required for glazing
AND DC open jobs ≤ daily cap
A lens never blocks DC. LENS_OOS_SUBSTITUTE if DC lens stock < lens qty required for glazing.
2 Client's HUBuses the HUB's lens · frame sent by the client, or the HUB's stock if it qualifies
Client has a HUB
AND HUB open jobs ≤ daily cap
AND HUB lens stock ≥ lens qty required for glazing
The frame is never a condition. It comes from the HUB's stock (only if it is > frame qty required for glazing, so at least 1 frame stays), else the client sends their own frame (FRAME_OOS_CLIENT_FRAME_HUB).
3 TOG
The ordered lens is a TOG lens
AND TOG frame stock ≥ frame qty required for glazing
AND TOG open jobs ≤ daily cap
TOG makes its lenses on demand. No flag.
4 Client's HUBlens sent from DC · frame sent by the client, or the HUB's stock if it qualifies
Client has a HUB
AND HUB open jobs ≤ daily cap
The HUB has no lens stock ≥ lens qty required for glazing (else step 2 applied) and TOG could not take the order (step 3). The lens ships from DC if DC lens stock ≥ lens qty required for glazing, otherwise DC substitutes a lens and sends it (LENS_OOS_SUBSTITUTE). The frame is sourced as in step 2.
5 DCthe client sends their own frame
DC frame stock < frame qty required for glazing
AND (
Client has no HUB
OR HUB open jobs > daily cap
)
FRAME_OOS_CLIENT_FRAME, plus LENS_OOS_SUBSTITUTE if DC lens stock < lens qty required for glazing. TOG's frame stock is not counted: if TOG could glaze the order, step 3 would have taken it.
6 DCoverflow
None of the steps above applied
CAP_OVERFLOW, plus LENS_OOS_SUBSTITUTE if DC lens stock < lens qty required for glazing. The order waits and is re-run next morning.

Terms

  • Frame qty required for glazing, lens qty required for glazing: how many of the ordered frame and lens this order needs for glazing (for example 1 frame and 2 lenses). Every stock check compares stock with these quantities, never with a fixed 0 or 1. Stock counts pieces.
  • Open jobs: jobs not finished yet, including carry-over from earlier days. Daily cap is the max cap used elsewhere on this site. A portal can take an order while its open jobs ≤ daily cap.
  • HUB: only the client's own HUB (HUB-A or HUB-B). Other HUBs are never checked and never ship stock. A HUB's frame stock counts only when it is > the frame qty (at least 1 frame stays); otherwise the client sends their own frame.
  • TOG: glazes only when the ordered lens is a TOG lens, and makes that lens on demand, so its lens stock never blocks. Nothing at TOG, neither frames nor lenses, is ever transferred to another portal. Nothing is ever sent to TOG, so it glazes only with its own frame stock.
  • DC: a lens never blocks DC. With lens stock < lens qty required for glazing, DC substitutes one and the order gets LENS_OOS_SUBSTITUTE.

3Full Truth Table

Every combination of the ten yes/no factors, with the step that decides it and where the order goes. Factors that cannot matter in a row (for example the HUB's stock when the client has no HUB) show "–", so each situation appears once.

The ten factors

✓ yes · ✗ no · – doesn't matter

Frame and Lens mean enough stock at that portal (stock ≥ the quantity the order needs). Within cap means open jobs ≤ max cap. At the HUB, Frame means stock > the quantity (at least 1 frame stays).

Downloads the situations shown below (with the current filters, language and mode) as a CSV file.

All situations