'delete_activity' Command

The command affects the pending activity specified by key fields of 'command/appointment' that exists in the system and deletes the activity from the system if the route has not been started yet or cancels the activity otherwise. The command will:

1) move the activity to the specified resource, if the 'external_id' is specified in the command and is different from the existing activity 'external_id'

2) if the resource's route is active:

2a) update the activity properties and fields (not inventory) by 'update_appointment' command

2b) cancel the activity

3) if the resource's route is inactive, delete the activity (the 'on move' message scenario will not be triggered)

The command will fail if the activity does not exist in OFS or is not of 'pending' status.

Note:
A segmentable activity can be deleted by the 'delete_activity' command if the activity status is 'pending' and all segments of the activity are in the 'pending' or 'cancelled' status', otherwise the command will fail.