CANCEL operator
The CANCEL operator creates an action that cancels changes in the current session.
Syntax
CANCEL [NESTED [nestedPropertySelector] [CLASSES]]
where nestedPropertySelector has one of the following forms:
LOCAL
(propertyId1, ..., propertyIdN)
Description
The CANCEL operator creates an action that cancels changes in the current session. If executed during an apply transaction, the operator cancels the running apply instead of clearing the session.
Parameters
-
NESTEDOptional keyword after which you can specify which local properties preserve their changes after the
CANCELoperator is executed. By itself, with neitherLOCALnor a property list, it has no effect on the operator. -
LOCALKeyword. If specified after
NESTED, all local properties preserve their changes after theCANCELoperator is executed. -
propertyId1, ..., propertyIdNNon-empty list of local properties, specified after
NESTEDin parentheses. Each list element is a property ID. The local properties specified in the list will preserve their changes after the operator is executed. -
CLASSESKeyword. Can be written, but has no effect on the
CANCELoperator.
Examples
CLASS Sku;
in = DATA LOCAL BOOLEAN (Sku);
// bare cancel — drops every change accumulated in the current session
dropChanges() { CANCEL; }
// cancel that preserves a specific local property
dropChangesKeepIn() {
CANCEL NESTED (in[Sku]); // cancel all changes except the `in[Sku]` property
}
// cancel that preserves all local properties
dropChangesKeepAll() { CANCEL NESTED LOCAL; }