Checks out one or more employees from a given Process Activity. This includes calculating and storing the check-in duration, handling auto-pause behavior if applicable, and terminating the Process Activity when appropriate.
If ProcessActivityEmployeeCollection is provided, it is used as the list of employees to check out.
Otherwise, the service validates the provided ProcessActivity and retrieves the current user’s employee if Employee is not provided via input.
It then determines which employees are currently checked in for that activity.
For each employee being checked out:
Sets the EndDate to the current UTC time.
Calculates the duration based on the start and end time, and applies the weight.
Associates a Trainer if specified.
Validates that EnableCheckIn is enabled for the activity.
If the activity is In Progress and AutoPause is enabled, and this is the last checked-in employee, the activity is paused automatically.
Saves and terminates the ProcessActivityEmployeeCollection relations.
If the Process Activity is in Closed or Canceled system state, no employees remain checked in, and no checklist associated with the activity, the activity itself is terminated.