Skip to content

Instantly share code, notes, and snippets.

@schurpf
Last active March 19, 2019 20:34
Show Gist options
  • Save schurpf/ebb3fd450a93d3d9eacdd78eef34451f to your computer and use it in GitHub Desktop.
Save schurpf/ebb3fd450a93d3d9eacdd78eef34451f to your computer and use it in GitHub Desktop.
# need entire service flow state machine
# need entire service flow state machine
Service state machine Level 1 - New Fitting
###############
# from any state
service_stop -> Ended without success
Service New*
update_data -> Data
update_survey -> Anamnese
update_refrection -> Refraction
add_lenspass -> Lenspass
# switch bewtween data, anmanese and refraction when updated
Data
update_data -> Data
update_survey -> Anamnese
update_refrection -> Refraction
add_lenspass -> Lenspass
Anamnese
update_data -> Data
update_survey -> Anamnese
update_refrection -> Refraction
add_lenspass -> Lenspass
Refraction
update_data -> Data
update_survey -> Anamnese
update_refrection -> Refraction
add_lenspass -> Lenspass
# no more going back once in Lenspass state
Lenspass
promote_lenspass_to_final -> Ended with success
helper_create_service_lenspass -> Service Lenspass New 1
helper_create_lenspass -> Lenspass New 1
Ended with success
Ended without success
# All lenspasses back to state before service
Service cancelled
# state machine on flow/service operation level (middle layer)
# conected to service_id and lenspass_id
Service Lenspass Level 2
###############
# reject from every state
rejecte -> Rejected 1
rejecte2 -> Service Lenspass Ended Unsuccessful 1
# lens ordering from every state
order_lens -> Final 1
order_lens2 -> Service Lenspass Ended Successful 1
Service Lenspass New 1*
order_trial_lenses -> Trial Lens Ordered 1
finish_lenspass_immidiate_check_1 -> Trial 1
Trial Lens Ordered 1
arrive_trial_lens_at_customer -> Trial 1
finish_lenspass_immidiate_check_1 -> Trial 1
Trial 1
promote_lenspass_to_final_1 -> Service Lenspass Ended Successful 1
Service Lenspass Ended Successful 1
Service Lenspass Ended Unsuccessful 1
# state machine on lenspass object level (bottom layer)
# connected to lenspass_id
Lenspass Level 3
###############
# lenspass added without Service
Lenspass New 1*
promote_lenspass_to_final -> Final 1
reject_lenspass -> Rejected 1
Final 1
archive_lenspass -> Archived 1
Archived 1
unarchive_lenspass -> Final 1
Rejected 1
function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",
{style: {color: "darkBlue"}},
`The current state is: ${current_state_name}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment