managed_data_item_with_history

EXPRESS specification:

ENTITY managed_data_item_with_history
SUBTYPE OF ( | managed_data_item);
DERIVE
number_of_uses | : | INTEGER := SIZEOF(SELF\managed_data_item.history);
first_managing_application | : | managed_application_installation := SELF\managed_data_item.history[1] \managed_data_transaction.application;
first_managing_person | : | person := SELF\managed_data_item.history[1] \managed_data_transaction.user.the_person;
date_first_managed | : | calendar_date := SELF\managed_data_item.history[1] \managed_data_transaction.processing_date.date_component;
last_managing_application | : | managed_application_installation := SELF\managed_data_item.history[number_of_uses] \managed_data_transaction.application;
last_managing_person | : | person := SELF\managed_data_item.history[number_of_uses] \managed_data_transaction.user.the_person;
date_last_managed | : | calendar_date := SELF\managed_data_item.history[number_of_uses] \managed_data_transaction.processing_date.date_component;
WHERE
WRM60 | : | number_of_uses > 0;
WRM61 | : | EXISTS(SELF\managed_data_item.originating_application);
WRM6 | : | first_managing_application :=: originating_application;
WRM7 | : | ('STRUCTURAL_FRAME_SCHEMA.MANAGED_DATA_CREATION' IN TYPEOF(SELF\managed_data_item.history[1]));
WRM8 | : | NOT ( (original_data = TRUE) AND ('STRUCTURAL_FRAME_SCHEMA.MANAGED_DATA_IMPORT' IN TYPEOF(SELF\managed_data_item.history[1])) );
WRM37 | : | SIZEOF(QUERY(creation <* SELF\managed_data_item.history | ('STRUCTURAL_FRAME_SCHEMA.MANAGED_DATA_CREATION') IN TYPEOF(creation))) = 1;
WRM38 | : | NOT( ('STRUCTURAL_FRAME_SCHEMA.MANAGED_DATA_DELETED' IN TYPEOF(SELF\managed_data_item.data_item)) AND (number_of_uses = 1) );
WRM39 | : | NOT( ('STRUCTURAL_FRAME_SCHEMA.MANAGED_DATA_DELETED' IN TYPEOF(SELF\managed_data_item.data_item)) AND (SIZEOF(QUERY(modification <* SELF\managed_data_item.history | ('STRUCTURAL_FRAME_SCHEMA.MANAGED_DATA_MODIFICATION') IN TYPEOF(modification))) < 1) );
END_ENTITY;

References (1):

Name | Type | Referred through | Express-G
managed_data_item | Entity |
Subtype
| No Diagram

Inheritance graph

ENTITY managed_data_item_with_history;
ENTITY managed_data_item;
instance_id | : | globally_unique_id;
originating_application | : | OPTIONAL managed_application_installation;
data_item | : | select_data_item;
history | : | LIST OF managed_data_transaction;
original_data | : | LOGICAL;
ENTITY managed_data_item_with_history;
DERIVE
number_of_uses | : | INTEGER := SIZEOF(SELF\managed_data_item.history);
first_managing_application | : | managed_application_installation := SELF\managed_data_item.history[1] \managed_data_transaction.application;
first_managing_person | : | person := SELF\managed_data_item.history[1] \managed_data_transaction.user.the_person;
date_first_managed | : | calendar_date := SELF\managed_data_item.history[1] \managed_data_transaction.processing_date.date_component;
last_managing_application | : | managed_application_installation := SELF\managed_data_item.history[number_of_uses] \managed_data_transaction.application;
last_managing_person | : | person := SELF\managed_data_item.history[number_of_uses] \managed_data_transaction.user.the_person;
date_last_managed | : | calendar_date := SELF\managed_data_item.history[number_of_uses] \managed_data_transaction.processing_date.date_component;
END_ENTITY;