Segmentable Activity Status
A segmentable activity has an own status which in some cases may be different from the status of its segments. The status of a segmentable activity is determined by the activity progress and by the statuses of its segments.
A segmentable activity is created in the pending status and remains pending if all its segments are in the pending, cancelled or deleted status, or if it has no segments at all (non-scheduled segmentable activities).
As soon as one of the segments is started, the status is changed to started.
When one or more segments of a segmentable activity are in the completed or not done status, and there are no other started or pending segments, the activity has the completed status.
A segmentable activity is in the completed or not done status when one or more segments of a segmentable activity are in the completed or not done status, respectively, and there are no other started or pending segments.
A segmentable activity changes its status to cancelled when all its segments have been canceled or when the entire activity is canceled together with one of the segments. At the same time no segments must be in the completed or not done status.
If the canceled activity is in a not-activated route, it can also be deleted. For an activity to be deleted, it must have no canceled segments or segments in activated routes.