Getting StartedΒΆ

Here is a quick guide to our API.

#!>>
#!Defects & Solutions sequence diagram
#!<<

operator:Actor[r]
hmi:hmi[r] "Operator tablet"
bb_ds:bb "Defects & Solutions BB"
bb_m:bb "Machine Status BB"
bb_s:bb "Operator skills profiling BB"


operator:hmi.Chose a part to manifacture
hmi:allowed machine states=bb_m.GET /api/states_setup&
hmi:defect lists=bb_ds.GET /api/defects?part_id={part_number}&



operator:hmi.Detects a known defect&

*5 bb_m
Set machine status as 'stopped_for_defect'
and populate the optional field with:
"optional": {
  "defect_id": <defect_id>
}
*5
hmi:bb_m.POST /api/machines/:machine_id/events/&
(5)bb_m

hmi:solution list=bb_ds.GET /api/solutions?defect_id={defect_id}

hmi:operator skills=bb_s.GET /api/operator_skills/:operator_id

hmi:perform skill matching

[c: loop untill a solution works]
[c:alt skill match ok]
  operator:performs a solution
  operator:hmi.reports the outcome&
  hmi:bb_ds.POST /api/reports/&


  -- [else]
*3 bb_m
Set machine status as 'waiting_for_teamleader'
and populate the optional field with:
"optional": {
  "defect_id": <defect_id>,
  "stopped_for_defect_event_id": <defect_event_id>
}
*3
 *4 operator
flow goes to teamleader
*4
  hmi:bb_m.POST /api/machines/:machine_id/events/&

(3)bb_m

(4) hmi
[/c]
[/c]

*6 bb_m
Set machine status as 'running'
*6
hmi:bb_m.POST /api/machines/:machine_id/events/&
(6)bb_m

#!>>
 #!Defects & Solutions sequence diagram - Team Leader
 #!<<

 operator:Actor[r] "Team Leader"
 hmi:hmi[r] "Operator tablet"
 bb_ds:bb "Defects & Solutions BB"
 bb_m:bb "Machine Status BB"


 [c: loop]

   operator:hmi.Monitors machines status
   hmi:machines list=bb_m.GET /api/machines&
   hmi:checks for stopped machines

   [c: loop foreach machine in state 'waiting_for_teamleader' ]
     hmi:last event=bb_m.GET /api/machine/:id/last_event
     hmi:solution list=bb_ds.GET /api/solutions?defect_id={last_event\.optional\.defect_id}
     hmi:list of already attemped solutions=bb_ds.GET /api/reports?event_id={last_event\.optional\.stopped_for_defect_event_id}&

     [c: loop untill a solution works]
       operator:performs a solution
       operator:hmi.reports the outcome&
       hmi:bb_ds.POST /api/reports/&
     [/c]
     *2 bb_m
     set machine status as 'running'
     *2
     hmi:bb_m.POST /api/machines/:machine_id/events/&
     (2)bb_m
   [/c]
 [/c]

A new GET request is available to the machine status building block that returns the last event registered for that machine. The machine state can only be changed through POST requests of machine events, and the event_id allows us to backtrack through the reports of the defects and solutions BB to find out what solutions where tried for a specific defect.

To get the last event of a specific machine do a GET request to /api/machine/:id/last_event.