Opstat messages: update schedule and order status.
Abstract
Implement a rule base schedule and order status update on area and site level.
This specification relates to habit.statushandling and includes the following tasks:
-
a -
b
Rationale
The flecsimo integration is based on top-down messaging of planning data, orders, sfcus and others but also requires a bottom-up messaging to reflect changes in operations. First class information will provided by the stations which report every state change as a status message (this was fixed and implemented in commit edd8e371).
However, not all status information will be of importance for higher levels facilities like areas or sites. They are concerned about objects like sfcu, schedule and order and they will expect ´opstatmessages instead ofstatus` messages.
Orders, schedules and sfcus may be affected when a state change of a station signals a state change of these objects. For example,
- When all tasks on all assigned stations for an sfcu are done, the sfcu itself will be considered as
DONE. - When all scheduled sfcus of an order are in state
DONEthe corresponding order should also be considered asDONE. This example also shows that there is not a one-to-one correspondence of a single state change event of a station and the aggregated state of a higher level object. The following specification will outline the rules for transforming and propagating status information asopstatmessages.
Specification
This specification relates to habit.statushandling but may effect also further components.
Processing of Station Status Messages
This processing will be done at cell level. Please note: sfcu objects have no state PICKABLE
The diagram below gives overview of the machine triggers for an opstat-status setting. The process in subsequent subscriber level (e.g. area and site) is described in the next section.
flowchart LR
ACTIVE-->state_a
DONE-->state_d
STANDBY-->state_s
subgraph Statushandling Loading Process
direction LR
state_a[/status: ACTIVE/]--> evaluate_ACTIVE(eval/update sfcu:WIP)
evaluate_ACTIVE-->a_to_opstat(transform)
a_to_opstat-->opstat_a[/opstat/]
end
subgraph Statushanding Picking Process
state_d[/status: DONE/]-->evaluate_DONE(eval/update sfcu:PICKABLE)
end
subgraph Statushanding Unloading Process
state_s[/status: STANDBY/]-->evaluate_STANDBY(eval/update sfcu:DONE)
evaluate_STANDBY-->s_to_opstat(transform)
s_to_opstat-->opstat_s[/opstat/]
end
subgraph Station States
direction TB
HALTED-->READY
STOPPED-->READY
READY-->STANDBY
STANDBY-->SETUP
STANDBY-->ACTIVE
SETUP-->ACTIVE
ACTIVE-->DONE
DONE-->READY
style HALTED fill:red
style STOPPED fill:grey
style STANDBY fill:green
style ACTIVE fill:green
style DONE fill:green
style SETUP fill:orange
end
Implementation specification as pseudo code:
if status_mesage.state == ACTIVE:
set sfcu.status = WIP # Work in progress
set schedule.status = WIP
else if status_mesage.state == DONE:
set schedule.status = PICKABLE # Material is waiting to be unloaded
else if status_mesage.state == STANDBY and status_message.sfcu != 0:
set sfcu.status = DONE # Material was unloaded
set schedule.status = DONE
publish opstat(sfcu=sfcu, supplier, org=cell, ..., state=sfcu.status)
Processing of OPSTAT messages: evaluation rules
The next diagram gives an overview of the opstat processing points in the factory. These will be specified in detail elow the diagram.
%%{init: { 'sequence': {'mirrorActors':false} } }%%
sequenceDiagram
participant site
participant area
participant cell
participant station
par Downstream
site->>area: assign schedule(supplier=ALL)
area->>cell: publish opdta(sfcu,operations,tasks,...)
area->>cell: assign schedule(supplier=cell)
station--)cell: lookup sfcu on load event
and Upstream
station->>cell: status(sfcu, ..., state)
cell->>cell: map status to opstat
cell->>area: opstat(sfcu, state)
area->>area: evaluate update of sfcu and schedule
area->>site: opstat(sfcu, state)
site->>site: evaluate update of sfcu, schedule and order
end
Evaluation at area level
Implementation specification as pseudo code:
if opstat.state in (WIP, DONE, PICKABLE):
set schedule.state = opstat.state
where schedule.sfcu == opstat.sfcu
and schedule.supplier == opstat.supplier
if opstat.state in (WIP, DONE):
set sfcu.state = opstat.state
where sfcu.id = opstat.sfcu
if schedule.state == DONE
for all items in schedule # select from database
where schedule.org == cell
and schedule.sfcu == opstat.sfcu:
set schedule.state = DONE # update
where schedule.org == area
and schedule.sfcu == opstat.sfcu
publish opstat(sfcu=sfcu, supplier, org=area, ..., state=sfcu.status)
Note: sfcu's do not have a state PICKABLE.
Evaluation at site level
Implementation specification as pseudo code:
if opstat.state in (WIP, DONE): # Update schedule and sfcu state
set schedule.state = opstat.state
where schedule.sfcu == opstat.sfcu
and schedule.supplier == opstat.supplier
set sfcu.state = opstat.state
where sfcu.id = opstat.sfcu
if schedule.state == DONE for all items in schedule # Update order state
where schedule.org == area
and schedule.sfcu == opstat.sfcu:
set order_plan.state = DONE
where order_plan.order == schedule.order
Note: sfcu's do not have a state PICKABLE.