Finding an Existing Activity

The logic of activity-related commands depends on the presence or absence of an existing activity, where 'activity does not exist' means there are no activities that match all the key values and 'activity exists' means at least one activity matches all key values:

To determine if the activity already exists in the system, activities with the same key values are found and filtered as follows:

IF:

  • existing activity type is 'break' OR 'prework'

  • existing activity status is one of {'deleted', 'suspended'}

  • existing activity is scheduled for a past date

  • existing activity status is 'cancelled' and was canceled by Inbound API (not by a Manage user)

THEN: activity is ignored (not considered existing)

IF: there still is more than one activity with the same key fields

THEN: the activity with the maximum ID is treated as existing and the others are treated as duplicated and are canceled/deleted after a successful command execution.