Provide definitions of structural as well as transactional related aspects of the business data model
@Scope:[#VIEW] Annotation ObjectModel { lifecycle { enqueue { expiryBehavior : String enum { RELATIVE_TO_ENQUEUE_START; RELATIVE_TO_LAST_CHANGE; } default #RELATIVE_TO_LAST_CHANGE; expiryInterval : String; notificationBeforeExpiryInterval : String; }; processing { expiryBehavior : String enum { RELATIVE_TO_PROCESSING_START; RELATIVE_TO_LAST_CHANGE; } default #RELATIVE_TO_LAST_CHANGE; expiryInterval : String; notificationBeforeExpiryInterval : String; }; }; modelCategory : String enum { BUSINESS_OBJECT; }; dataCategory : String enum { TEXT; HIERARCHY; }; representativeKey : keyElementRef; semanticKey : array of elementRef; compositionRoot : Boolean default true; transactionalProcessingEnabled : Boolean default true; transactionalProcessingDelegated : Boolean default true; createEnabled : Boolean default true; updateEnabled : Boolean default true; deleteEnabled : Boolean default true; writeDraftPersistence : String; writeActivePersistence : String; entityChangeStateId : elementRef; }; @Scope:[#ELEMENT] Annotation ObjectModel { association { type : array of String enum { TO_COMPOSITION_CHILD; TO_COMPOSITION_PARENT; TO_COMPOSITION_ROOT; }; }; createEnabled : Boolean default true; text { element : array of elementRef; association : associationRef; }; hierarchy { association : associationRef; }; foreignKey { association : associationRef; }; readOnly : Boolean default true; mandatory : Boolean default true; enabled : Boolean default true; };
Annotation | Meaning | |
---|---|---|
ObjectModel.association.type[ ] |
Defines the association type that is used for defining a compositional view hierarchy. Scope: [ELEMENT] Evaluation Runtime (Engine):
Values: |
|
Value | Description | |
#TO_COMPOSITION_CHILD | Within the compositional hierarchy there must be a #TO_COMPOSITION_CHILD association leading to each direct sub view of a given view. | |
#TO_COMPOSITION_PARENT | Views that do not represent the root of the hierarchy must have an association to their compositional parent view annotated with #TO_COMPOSITION_PARENT. | |
#TO_COMPOSITION_ROOT |
Additionally, views that do not represent the root must have a #TO_COMPOSITION_ROOT association for performance reasons (for example: authorization checks (instance restrictions) based of information from root views). NOTE: In such a case, the root view of the hierarchy must be annotated with @ObjectModel.compositionRoot: true . |
|
ObjectModel.compositionRoot |
Defines the root of a compositional hierarchy Scope: [VIEW] |
|
ObjectModel.createEnabled |
If this annotation has value true, it is allowed to create new instances. Scope: [VIEW] Evaluation Runtime (Engine):
|
|
ObjectModel.dataCategory |
Defines the category of data that is represented by the below-mentioned values. Scope: [VIEW] Evaluation Runtime (Engine): In ABQL joins between a Data- and a Text entity without explicit language key handling will be interpreted as a 1 : (0,1) association, where the language key is defaulted with the logon language. Values: |
|
Value | Description | |
#TEXT |
Indicates that the annotated entity represents texts. Usually one key element is of type language. NOTE: Within the VDM a text view is always language-dependent. |
|
#HIERARCHY |
Indicates that the entity represents the hierarchy-related data. This could be a header information or structure information. |
|
ObjectModel.deleteEnabled |
If this annotation has value true, it is allowed to delete existing instances. Scope: [VIEW] Evaluation Runtime (Engine):
|
|
ObjectModel.enabled |
If this annotation has the value true, the corresponding element (field or association) is supported at runtime. Scope: [ELEMENT] Evaluation Runtime (Engine): SADL: Exposes this information |
|
ObjectModel.entityChangeStateId |
This annotation is related to a single field that contains the change state of an active document. The change state is always updated as soon as the document is changed. Usually, fields like last changed timestamp, hash values, or version counters are used as EntityChangeStateIds. Scope: [VIEW] |
|
ObjectModel.foreignKey.association |
Defines association to a view that represents a value list/check table of the annotated filed. The annotated field must be valuated as equal to the annotated representative key field of the target view. The maximum target cardinality of the association has to be 1. Scope: [ELEMENT] Evaluation Runtime (Engine):
|
|
ObjectModel.hierarchy.association |
This annotation can be added to the key field that
specifies the association to a hierarchy view. The hierarchy view
defines an external hierarchy for the instances of the current view
and is annotated with @ObjectModel.dataCategory:
#HIERARCHY. Scope: [ELEMENT] Evaluation Runtime (Engine): Analytic Manager: Uses associated view for hierarchical presentation. |
|
ObjectModel.lifecle.enqueue.expiryBehavior |
The creation of an exclusive draft related to an existing active document causes an exclusive durable lock of the active document. The lifecycle.enqueue.* annotations allow to overrule the global defaults for the durable lock expiration handling. After a certain period of time, the durable exclusive lock on the active document has to be released. This period of time is defined by the expiration behavior. Enqueue Expiration Behavior:
Scope: [VIEW] Evaluation Runtime (Engine): The lifecycle services automatically unlock active documents accordingly to the defined enqueue expiration behavior. |
|
ObjectModel.lifecle.enqueue.expiryInterval | Using this annotation, you can specify an interval to
overrule the default duration. The value must be compliant to the dayTimeDuration format (http://www.w3.org/TR/xmlschema11-2/#dayTimeDuration). Scope: [VIEW] |
|
ObjectModel.lifecle.enqueue.notificationBeforeExpiryInterval | To notify the draft processor in advance before the expiration takes place, a notification will be send. The default warning interval can be overruled by the help of annotation notificationBeforeExpiryInterval using the valid dayTimeDuration format (http://www.w3.org/TR/xmlschema11-2/#dayTimeDuration). Scope: [VIEW] | |
ObjectModel.lifecle.processing.expiryBehavior |
After the durable lock expiration phase has been processed for an exclusive draft, the durable lock of its active document is released. However for draft-aware applications it is still not allowed to create a new draft related to the same active document until the processing of the existing draft is expired. The lifecycle.processing.* annotations allow to overrule the global defaults for the draft processing expiration handling. After a certain period of time, the processor is removed from an exclusive draft and a different user is allowed to create a new draft related to the same active document. In that case, the first draft is deleted. Otherwise, the editing for the first draft can be continued at a later point in time. The default processing expiration settings can be overruled like the lifecycle.enqueue.* annotations by the help of a behavior, duration interval and notification interval. Scope: [VIEW] Evaluation Runtime (Engine): The lifecycle services automatically set the processing status of a draft accordingly to the defined processing expiration behavior. |
|
ObjectModel.lifecle.processing.expiryInterval |
Using this annotation, you can specify an interval to overrule the default duration interval. Scope: [VIEW] |
|
ObjectModel.lifecle.processing.notificationBeforeExpiryInterval |
Using this annotation, you can specify an interval to overrule the default notification interval. Scope: [VIEW] |
|
ObjectModel.mandatory |
If this annotation has value true, the field must be filled by the consumer when executing a modification. Scope: [ELEMENT] Evaluation Runtime (Engine):
|
|
ObjectModel.modelCategory |
Each business object can semantically be categorized using this object model setting Scope: [VIEW] Evaluation Runtime (Engine): The model category must not have any runtime effect but is used for a semantic grouping, for example in view browsers. Values: |
|
Value | Description | |
#BUSINESS_OBJECT | View that represents a BOPF business object | |
ObjectModel.readOnly |
If this annotation has the value true, the field must not be updated by the consumer. Scope: [ELEMENT] Evaluation Runtime (Engine):
|
|
ObjectModel.representativeKey | Most specific element (field or managed association) of
the primary key (indicated by the keyword KEY)
that represents the entity which the view is based on. This element
shall be used as the anchor for defining foreign key relationships
(except for text views): The foreign key field corresponding to the
representative key represents the entity. As such it can be called
representative foreign key element. The foreign key association is
defined on the representative foreign key element. The name of the
representative key typically equals the name of the entity
represented by the view. For non-text views it is the key element for which the view serves as a value list/check table. For text views (@ObjectModel.dataCategory: #TEXT) it identifies the key element to which the text fields relate to. The representative key element has to be modelled explicitly even if there is only one primary key field (no implicit derivation). A view may only become a target of a foreign key association if it has a representative key element (exception: language dependent text views may not be used as targets of foreign key relationships)Scope: [VIEW] Evaluation Runtime (Engine): Analytic Manager: In analytics, both the grouping by the entity and the hierarchical representation of the entity are handled using the representative foreign key field. |
|
ObjectModel.semanticKey[ ] |
Identifies an instance of an entity from business perspective using human-readable field values. It does neither contain time-/language-dependent nor other technical components (for example: draft indicator). Thus it may be ambiguous resulting in multiple selected records/instances of a view that may need to be filtered using contextual information (for example: current date, preferred language). For a given entity, only a single semantic key is defined.Scope: [VIEW] Evaluation Runtime (Engine): UI: Uses semantic key for bookmarking and navigation. |
|
ObjectModel.text.association |
Defines the associated view (annotated with @ObjectModel.dataCategory: #TEXT), which provides textual descriptions for the annotated field. NOTE: The usage of this annotation excludes the usage of @ObjectModel.text.element. Scope: [ELEMENT] Evaluation Runtime (Engine):
|
|
ObjectModel.text.element[ ] |
Establishes the conjunction of a field with its
descriptive language-independent texts. NOTE: The usage of this annotation excludes the usage of @ObjectModel.text.association. Scope: [ELEMENT] Evaluation Runtime (Engine): SADL - First text field listed in the annotation array will be handled as descriptive text of the annotated field in OData exposure scenarios. |
|
ObjectModel.transactionalProcessingEnabled | Enables the transactional runtime support. It may only be defined on root view level (@ObjectModel.compositionRoot: true). Scope: [VIEW] Evaluation Runtime (Engine):
|
|
ObjectModel.transactionalProcessingDelegated | Indicates that transactional accesses to the view are delegated to the transactional runtime of the underlying view (which is annotated with @ObjectModel.transactionalProcessingEnabled:true). It may only be defined on root view level (@ObjectModel.compositionRoot:true). Scope: [VIEW] Evaluation Runtime (Engine):
|
|
ObjectModel.updateEnabled | If this annotation has value true, it is allowed to update existing instances. Scope: [VIEW] Evaluation Runtime (Engine):
|
|
ObjectModel.writeActivePersistence |
Defines the DDIC database table name of the active view. This requires @ObjectModel.transactionalProcessingEnabled: true Scope: [VIEW] |
|
ObjectModel.writeDraftPersistence |
Defines the DDIC database table name of the draft data. This requires @ObjectModel.transactionalProcessingEnabled: true Scope: [VIEW] |
|
ObjectModel.writeEnabled - Deprecated! |
Enables the transactional runtime support. It may only be defined on root view level (@ObjectModel.compositionRoot: true). Caution Do not use this annotation an more! It is replaced by ObjectModel.transactionalProcessingEnabled.
Scope: [VIEW] Evaluation Runtime (Engine):BOPF - Depending on the specified persistence information, we can distinguish between the folllowing scenarios: a) writeActivePersistence: Active data (defined by that CDS view) is directly modified by the transactional runtime (without having any kind of draft). b) writeDraftPersistence: Active data (defined by that CDS view) is only indirectly modified by a draft. c) writeActivePersistence & writeDraftPersistence: Both the draft and the active data are written by the transactional runtime. |
This example demonstrates how you can define a compositional hierarchy.
@ObjectModel.modelCategory: #BUSINESS_OBJECT @ObjectModel.compositionRoot: true define view I_SalesOrder association [0..*] to I_SalesOrderItem as _Item ... { @ObjectModel.association.type: #TO_COMPOSITION_CHILD _Item, ... } define view I_SalesOrderItem association [1..1] to I_SalesOrder as _SalesOrder ... { @ObjectModel.association.type: [#TO_COMPOSITION_ROOT, #TO_COMPOSITION_PARENT] _SalesOrder, ... }
This example demonstrates how you can define foreign key relationship.
define view I_SalesOrderItem association [0..1] to I_Material as _Material on $projection.Material = _Material.Material ... { @ObjectModel.foreignKey.association: ’_Material’ Material, _Material, ... } @ObjectModel.representativeKey: ’Material’ define view I_Material ... { key Material, ... }
This example demonstrates how you can define language-dependent texts
define view I_Material association [0..*] to I_MaterialText as _Text ... { @ObjectModel.text.association: ’_Text’ key Material, _Text, ... } @ObjectModel.dataCategory: #TEXT @ObjectModel.representativeKey: ’Material’ define view I_MaterialText ... { key Material, @Semantics.language: true key Language, @Semantics.text: true MaterialName, @Semantics.text: true MaterialDescription, ... }
This example demonstrates how you can define language-independent texts
define view I_Plant ... { @ObjectModel.text.element: [’PlantName’] key Plant, @Semantics.text: true PlantName, ... }
This example demonstrates how you can define the transactional behavior
@ObjectModel.compositionRoot: true @ObjectModel.transactionalProcessingEnabled: true @ObjectModel.writeDraftPersistence: ‘<DraftDDICTable>’ define view I_MaterialWithDraft ... { ... }