Previous Topic: Add UPDATE Exception LogicNext Topic: Delete Followed by Insert


Add DELETE Entity Action

Adding a DELETE entity action consists of the following activities:

The DELETE entity action removes an occurrence of an entity. After a DELETE, the business can no longer access the entity occurrence. Before performing the DELETE, the process logic must have CREATEd or READ the entity, as shown in the following example.

The following example shows DELETE following a READ Statement:

DELETE following a READ Statement

Note: DELETE has no exception condition.

The DELETE action also deletes all entity occurrences that no longer participate in mandatory pairings with occurrences of this entity type. This effect is named cascade deletion. For example, ORDER and ORDER LINE have a mandatory relationship in the Data Model. It becomes necessary to delete the ORDER with an ORDER Number of 111.

The following logic addresses this situation:

READ order
WHERE DESIRED order number IS EQUAL TO 111
DELETE order

Downstream Effects: Because ORDER has a mandatory relationship to ORDER LINE, CA Gen generated code also deletes all ORDER LINES associated with the affected ORDER. If ORDER LINE had any other mandatory relationships, CA Gen would have deleted any entity paired with an ORDER LINE based on that relationship. The cascade delete continues until all pairings based on mandatory relationships have been deleted.

More information:

DISASSOCIATE Entities

TRANSFER Relationships