title Schedule Session bottomparticipants actor "Trainee" as A boundary "Schedule Session" as B control "Schedule Controller" as C database "Database" as D C->B: B->A:Send email A->B:Interact B->C: C->B: B->A:Log in A->B:Provide login\n details B->C: C->D:get_id D->C: C->D:get_available_trainings D->C: C->B: B->A:Display times\n and roles A->B:Choose time B->C: C->D:get_valid_roles D->C: note over A,D:If the trainee can only assume one role (due to having\ncompleted their allowed observations or practicals,\nor due to the slot already having an allocated practical\ntrainee), then the following round-trip is skipped\n(until the next note) C->B: B->A:Offer choice\n of role A->B:Choose role B->C: note over A,D:If the previous interaction was skipped, the user's choice\nis set automatically to the only available role C->B: B->A:Confirm time\n and role A->B:Confirm B->C: C->D:record_trainee_role