Difference between revisions of "Core.Declarations.GlobalDeclarations"

From emotive
Jump to navigation Jump to search
Line 1: Line 1:
{{DISPLAYTITLE:OTX '''Global Declarations''' data model}}[[Category:OTX-Core]][[Category:Declarations]]
+
{{DISPLAYTITLE:OTX '''Global Declarations'''}}[[Category:OTX-Core]][[Category:Declarations]]
 
== Classification ==
 
== Classification ==
{{ClassificationCore | Global Declarations | OTX global declarations data model | [[OtxReference#Core|OTX Core]] | - }}
+
{{ClassificationCore | Global Declarations | Global variables and constants | [[OtxReference#Core|OTX Core]] | - }}
  
 
== Introduction ==
 
== Introduction ==
In the global declaration block:
+
The following elments can be declared in the global declaration block:
  
* Global Constant
+
* Global Constants
* Document Variable
+
* Context Variables
* Context Variable
+
* Document Variables
  
can be declared. These elements have a global validity. That is, they can both within the document in which they are declared, as well as in other documents, see [[OtxImports|Imports]] are used.
+
These elements have a global scope. That is, they can be used within the document in which they are declared, as well as in other documents, see [[OtxImports|Imports]].
  
 
== Semantics ==
 
== Semantics ==
 
=== Global Constant ===
 
=== Global Constant ===
The value of a global constant is set at design time and can not be changed at runtime. For global constants have the following [[OtxVisibilities|Visibilities]]:
+
The value of a global constant is set at design-time and can not be changed at runtime. The global constants must have one of the following [[OtxVisibilities|Visibilities]]:
  
 
* Private (default)  
 
* Private (default)  
Line 20: Line 20:
 
* Public
 
* Public
  
A constant has a [[OtxDataTypes|Type]] and a corresponding type value.
+
A constant has a [[OtxDataTypes|Type]] and a value corresponding to the type.
  
=== Document Variable ===
+
=== Global Variable (Document Variable) ===
The value of a global variable can be changed at runtime. Global variables can only be used in the same document. They have, therefore only the following [[OtxVisibilities|Visibilities]]:
+
The value of a global variable can be changed at runtime. Global variables can only be used in the same document. Therefore, they only have one following [[OtxVisibilities|Visibility]]:
  
 
* Private (fixed)
 
* Private (fixed)
  
A variable has a [[OtxDataTypes|Type]] and a corresponding type the initial value (default value).
+
A variable has a [[OtxDataTypes|Type]] and an initial value (default value) corresponding to the type.
  
=== Context Variable ===
+
=== Environment Variable (Context Variable) ===
Context variables behave like global constants. However, they have a special meaning. They represent environment-related data, such as vehicle type, name of workshop, Logged in User, etc., see the [[OtxPrinciples#ContextConcept|Context Concept]]. Context variables have one of the following visibilities:
+
Context variables behave like global constants. However, they have a special meaning. They represent environment-related data, such as vehicle type, name of workshop, user login name, etc., see the [[OtxPrinciples#ContextConcept|Context Concept]]. The context variables must have one of the following [[OtxVisibilities|Visibilities]]:
  
 
* Private (default)
 
* Private (default)
Line 36: Line 36:
 
* Public
 
* Public
  
A context variable has a [[OtxDataTypes|Type]] and a corresponding type the default value.
+
A context variable has a [[OtxDataTypes|Type]] and a default value corresponding to the type.
  
 
== Checker rules ==
 
== Checker rules ==

Revision as of 08:27, 10 September 2014

Classification

Name Global Declarations
Short Description Global variables and constants
Class OTX Core
Pre-Conditions -
Specified by ISO 13209-2

Introduction

The following elments can be declared in the global declaration block:

  • Global Constants
  • Context Variables
  • Document Variables

These elements have a global scope. That is, they can be used within the document in which they are declared, as well as in other documents, see Imports.

Semantics

Global Constant

The value of a global constant is set at design-time and can not be changed at runtime. The global constants must have one of the following Visibilities:

  • Private (default)
  • Package
  • Public

A constant has a Type and a value corresponding to the type.

Global Variable (Document Variable)

The value of a global variable can be changed at runtime. Global variables can only be used in the same document. Therefore, they only have one following Visibility:

  • Private (fixed)

A variable has a Type and an initial value (default value) corresponding to the type.

Environment Variable (Context Variable)

Context variables behave like global constants. However, they have a special meaning. They represent environment-related data, such as vehicle type, name of workshop, user login name, etc., see the Context Concept. The context variables must have one of the following Visibilities:

  • Private (default)
  • Package
  • Public

A context variable has a Type and a default value corresponding to the type.

Checker rules

Core_Chk051 Immutability of constants, input parameters and context variables
Core_Chk009 Mandatory constant initialisation

See also

Validation (OTX-Checker)
​​Naming Conventions
Imports
Visibilities
Validities
Signatures
Parameter Declarations
Procedures
Comments