Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityDefaultedState.vb =================================================================== diff -u -r1729 -r1734 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityDefaultedState.vb (.../ActivityDefaultedState.vb) (revision 1729) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityDefaultedState.vb (.../ActivityDefaultedState.vb) (revision 1734) @@ -13,6 +13,8 @@ ''' Public Overrides Sub StartActivity(employee As IEmployee) + 'Update employee. + employee.CurrentActivity = me.Activity 'Change state. Activity.State = New ActivityStartedState(Me, employee) End Sub Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityStoppedState.vb =================================================================== diff -u -r1730 -r1734 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityStoppedState.vb (.../ActivityStoppedState.vb) (revision 1730) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityStoppedState.vb (.../ActivityStoppedState.vb) (revision 1734) @@ -27,6 +27,8 @@ ''' Public Overrides Sub StartActivity(employee As IEmployee) + 'Update employee. + employee.CurrentActivity = me.Activity 'Everyone can start this activity. Activity.State = New ActivityStartedState(Me, employee) End Sub Index: ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityStartedState.vb =================================================================== diff -u -r1730 -r1734 --- ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityStartedState.vb (.../ActivityStartedState.vb) (revision 1730) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/domain/classes/implementations/activity state/ActivityStartedState.vb (.../ActivityStartedState.vb) (revision 1734) @@ -27,19 +27,22 @@ ''' Public Overrides Sub StopActivity(employee As IEmployee) - if Not _employee.Equals(employee) Then + If Not _employee.Equals(employee) Then 'Different employee. - throw New Exception($"A different employee can't stop a started activity. Current activity belongs to {employee.ToString()}") + Throw New Exception($"A different employee can't stop a started activity. Current activity belongs to {employee.ToString()}") End If Activity.State = New ActivityStoppedState(Me) End Sub ''' Public Overrides Sub FinishActivity(employee As IEmployee) - if Not _employee.Equals(employee) Then + If Not _employee.Equals(employee) Then 'Different employee. - throw New Exception($"A different employee can't finish a started activity. Current activity belongs to {employee.ToString()}") + Throw New Exception($"A different employee can't finish a started activity. Current activity belongs to {employee.ToString()}") End If + 'Update employee. + employee.CurrentActivity = Me.Activity + 'Update state. Activity.State = New ActivityFinishedState(Me) End Sub End Class