Determining if the Activity is to be Moved or Rescheduled

Note: Please note that activity move or reschedule is the second step of the command execution, which is performed before the activity is updated, canceled, or deleted. If the move or reschedule defined in the request cannot be performed, the command will be rejected.

  1. IF: activity does not exist AND command type is 'cancel_appointment'

THEN: command is rejected with message 'appointment is not found'

  1. IF: command date field is not specified AND activity does not exist

THEN: command is rejected with message 'date is empty'

  1. IF: command date field is not specified AND activity already exists

THEN: command date is set to existing activity date

Note: If the date field is empty – the activity is set to non-scheduled
  1. IF: command date field value is a date in the past

THEN: command is rejected with a message 'action on the past is not allowed'

5.2.2.5) IF: command 'external_id' field is not specified AND activity does not exist

AND default appointment pool is not specified or invalid

THEN: command is rejected with message 'external_id not specified'

  1. IF: command 'external_id' field is not specified AND activity does not exist

AND default appointment pool is specified and valid

THEN: command provider is set to default appointment pool value AND 'external_id not specified – inserting into default pool' warning is issued

  1. IF: command 'external_id' field is not specified AND activity already exists

AND existing activity provider is invalid

AND default appointment pool is not specified or is invalid

THEN: existing activity is updated but not moved/rescheduled or canceled

  1. IF: command 'external_id' field is not specified AND activity already exists

AND existing activity provider is invalid

AND default appointment pool is specified and valid

THEN: command provider is set to default appointment pool value and 'external_id not specified and existing route is invalid – moving to default pool' warning is issued

  1. IF: command external_id field is not specified AND activity already exists

AND existing activity provider is valid

THEN: command provider is set to existing activity provider

  1. IF: command 'external_id' field is specified and valid AND activity already exists

AND command 'external_id' is not equal to existing activity 'external_id'

AND command date is equal to existing activity date

AND existing activity provider is in the same provider group as command provider

THEN: command provider is set to existing activity provider AND 'provider is in the same group as original provider – will not move' warning is issued

  1. IF: command 'external_id' field is specified AND activity already exists

AND command provider is invalid

AND default activity pool is not specified or invalid

THEN: existing activity is updated but not moved/rescheduled and not canceled

  1. IF: command 'external_id' field is specified AND activity does not exist

AND command provider is invalid

AND default appointment pool is not specified or invalid

THEN: command is rejected with 'queue is invalid' message

  1. IF: command 'external_id' field is specified AND activity already exists

AND command provider is invalid

AND default appointment pool is specified and valid

THEN command provider is set to default appointment pool value AND 'queue is invalid – falling back to default pool' warning is issued

  1. IF: neither service window start or end are specified

THEN: new activity is created as 'unordered'

  1. IF: activity already exists AND command date is different from existing activity date

AND activity has been set started, completed, canceled, or notdone via Manage

THEN: existing activity is ignored and new pending activity is added for the new date

  1. IF: activity already exists AND command provider is different from existing activity provider

AND activity has been set completed, canceled or notdone via Manage

THEN existing activity is ignored and new pending activity is added to the new provider

  1. IF: activity already exists AND command provider is different from existing activity provider

AND activity has been set started via Manage

THEN activity is not moved nor it is created – the properties of existing activity are updated.