The Meta Instruction Set - Meta Tests.

 Meta tests are similar to normal action diagram tests. There are equivalents of If & Else as well as Case, with When & Otherwise. The difference between these and their non-meta counterparts comes in the conditions you can test for. The test condition is the same for +If or +When, the difference is that the +When goes inside the +Case instruction.

Meta instruction tests check for the existence of triples in your model, for specific properties of the CMSO and for the existence and properties of meta variables. They are the main way of controlling code generation. If the test is false, no code inside the test is generated.

All of the test meta instructions start with a single +.

Look at the Relation & view validation function from the previous page for examples:

There are five meta test in this section of code. Lets look at each in turn:

1. +If TRP optionality SYS, System: Optional

This test does two things. Firstly, it tested to see if the CMSO has the triple specified in the model. The TRP optionality SYS verb is a continuation of either of the Entity-to-Entity relation verbs. Since this line of code is inside the entity relation loop, the CMSO will be set to an entity relation verb.

Secondly, it tests to see if the target object of the TRP optionality SYS triples is the system value Optional.

In other words, if the current entity relation does not have the optionality triple specified or, if it does exist but it is some other value than optional, the test is false and the code inside this +If instruction is ignored for this iteration of the +For Each Entity Relation loop.

2. +If Query View Key

This test also operates on the CMSO, an attribute of the current view in this case. It will be true for any field that is part of the key of the view. There are a variety of other properties you can test for in this way. The complete list is:

Condition Description
Query View Ascending Key True if the field is a key to the view and is in ascending collating sequence.
Query View Derived True if the field is an attribute of the Entity through a ENT Has derived FLD triple.
Query View Foreign Key True if the field is part of the foreign key of an Entity-to-Entity relation.
Query View Key True if the field is a key of the view.
Query View Seek Redirection True if the field is used for non-exact key matching when reading data from the view.
Query View Virtual True if the field is a virtual attribute of the view.

 3. +If Field: +UI function.

This tests to see if the meta variable is currently defined. Since meta variables are only used during generation of the function, 'currently defined' depends on the sequence of the code in your action diagram. This does not test to see which, if any, object is currently referenced by the meta variable.

4. +If FLD Displayed as FLD

This is similar to the first test, except that it is only checking for existence of the triple for the field CMSO.

5. +If Field: +Current field, Field: +External field

This test compares the objects referenced by the two meta variables. It is true only when the meta variables reference the same object.

 

Go to: Top : Next page