ENTITY managed_data_item_with_history

(* SCHEMA STRUCTURAL_FRAME_SCHEMA; *)
(* New for LPM/6 - See Issues 80 and 102 *)
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;
		(*	
			the data must have history 
		*)
	WRM61 : EXISTS(SELF\managed_data_item.originating_application);
		(*	
			the data must be associated with an application 
		*)
	WRM6 : first_managing_application :=: originating_application;
		(*	
			the application that first managed the data must be the one 
			that provided its unique identifier 
		*)
	WRM7 : ('STRUCTURAL_FRAME_SCHEMA.MANAGED_DATA_CREATION' 
			IN TYPEOF(SELF\managed_data_item.history[1]));
		(*	
			the first data processing event that may be recorded 
			for each instance of manged_data_item will be its creation 
		*)	 
	WRM8 : NOT ( (original_data = TRUE) AND 
		 ('STRUCTURAL_FRAME_SCHEMA.MANAGED_DATA_IMPORT' 
			IN TYPEOF(SELF\managed_data_item.history[1])) );
		(*
			the data cannot be deemed as original if has been imported
		*)		 
	WRM37 : SIZEOF(QUERY(creation <* SELF\managed_data_item.history | 
		 ('STRUCTURAL_FRAME_SCHEMA.MANAGED_DATA_CREATION') IN
		 TYPEOF(creation))) = 1;
		(*
			an instance of manged_data_item can only be created once
		*)	
	WRM38 : NOT( ('STRUCTURAL_FRAME_SCHEMA.MANAGED_DATA_DELETED' 
			IN TYPEOF(SELF\managed_data_item.data_item))
		AND (number_of_uses = 1) );
		(*
			an instance of managed_data_item has to be created before
			the data associated with it can be deleted.  
		*)	
	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) );
		(*
			there must be at least one instance of managed_data_modification 
			associated with the managed_data_item if the engineering data has been deleted. 
			In other words, the data processing event that deleted the engineering data 
			is recorded by the instance of managed_data_modification.  
			(Deletion is considered in CIS/2 to be a type of data modification.)  	
		*)	
END_ENTITY;

Explicit Attributes

Entity managed_data_item_with_history has the following local and inherited explicit attributes:
AttributeTypeDefined By
 instance_idglobally_unique_id (STRING)managed_data_item
 originating_applicationmanaged_application_installation (ENTITY)managed_data_item
 data_itemselect_data_item (SELECT)managed_data_item
 historyLIST OF managed_data_transaction (ENTITY)managed_data_item
 original_dataLOGICALmanaged_data_item

Derived Attributes

Entity managed_data_item_with_history has the following local and inherited derived attributes:
AttributeTypeDefined By
 number_of_usesINTEGERmanaged_data_item_with_history
 first_managing_applicationmanaged_application_installation (ENTITY)managed_data_item_with_history
 first_managing_personperson (ENTITY)managed_data_item_with_history
 date_first_managedcalendar_date (ENTITY)managed_data_item_with_history
 last_managing_applicationmanaged_application_installation (ENTITY)managed_data_item_with_history
 last_managing_personperson (ENTITY)managed_data_item_with_history
 date_last_managedcalendar_date (ENTITY)managed_data_item_with_history

Inverse Attributes

    No Inverse Attributes

Supertypes

Entity managed_data_item_with_history inherits from the following supertypes:
  managed_data_item

Subtypes

    No subtypes

Referenced By

Entity managed_data_item_with_history and its supertypes are referenced by the following definitions:
DefinitionTypeReferenced Entity
 get_instance_id FUNCTION managed_data_item
 managed_data_creation ENTITY managed_data_item
 managed_data_deleted ENTITY managed_data_item
 managed_data_export ENTITY managed_data_item
 managed_data_import ENTITY managed_data_item
 managed_data_item_with_history ENTITY managed_data_item
 managed_data_modification ENTITY managed_data_item
 managed_data_transaction ENTITY managed_data_item
 unique_data_item FUNCTION managed_data_item


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2023-03-25T00:11:38-04:00