Show TOC

 Record

Definition

This concept allows you to map value assignment types that have been assigned multiple values (or in other words value assignment types with several data records) in the EH&S Expert.

Use

It could be the case that data records from a value assignment type that has been assigned multiple values (for example, density of a substance measured at different temperatures) are required in a rule, or that the EH&S Expert is to create several data records for a value assignment type (or in other words, is to assign multiple values to the value assignment type). For this, you must assign to a record the fact corresponding to the characteristic of the value assignment type.

Note Note

You can use the EH&S Expert to assign multiple values to an appropriate characteristic within one data record in a value assignment type by assigning data to the corresponding fact using the operator += in the THEN part of the rule. The fact must not be contained in a record.

End of the note.

Structure

Records can be found in the fact section and are introduced with RECORD <Record name> and concluded with END . The way in which a record is formulated is similar to that of a composition.

Example Example

The value assignment type Oral toxicity contains three data records: a value for the type LD50 , one for LD100 , and one for LD0 . The record could be formulated in the following way:

End of the example.
 

RECORD OraTox

   

Type,

   

Accuracy,

   

Value

 

END

Note Note

If you create a set of rules using the rule editor, the editor generates a rule file with the correct syntax automatically.

End of the note.

Integration

The facts of a record are addressed using <RECORD NAME>.<FACT NAME> . Rules that contain records are executed for all instances of the record.

Records can also be present within compositions. If this is the case, the facts of the record are addressed using <COMPOSITION NAME>.<RECORD NAME>.<FACT NAME> .

New instances for a record can be created within the set of rules. The facts for the new record are filled with data using <RECORD NAME>.NEW.<FACT NAME> . You cannot create new records within a composition.

You must use the COMMIT command to create the new instance for the record and to make it available for normal rule access.

Example Example

A new instance for acute oral toxicity could be created in the following way:

End of the example.
 

OraTox.NEW.TYPE := "LD50",

 

OraTox.NEW.VALUE := 2000,

 

OraTox.NEW.Accuracy := "approx.",

 

COMMIT(OraTox)

Example Example

The following set of rules calculates the minimum oral toxicity for all existing types in the substances of the composition. The default setting UsedOraTypes for the fact is essential, otherwise the activity for the rule CreateInstances is never performed (see When Is a Rule Executed? ).

End of the example.
 

FACTS

   

UsedOraTypes := [],

   

RECORD OraTox

     

Type,

     

Value

   

END

   

COMPOSITION COMP

     

RECORD OraTox

       

Type,

       

Value

     

END

   

END

 

RULES

   

// Create ONE instance for each existing OraTox value. Data that has already been created is saved in UsedOraTypes.

   

RULE CreateInstances

     

IF Not(COMP.OraTox.Type [<] UsedOraTypes)

     

THEN

       

UsedOraTypes += COMP.OraTox.Type,

       

OraTox.NEW.Type := COMP.OraTox.Type,

       

OraTox.NEW.Value := COMP.OraTox.Value,

       

COMMIT(OraTox)

   

END

   

RULE SetMinimumValues

     

IF OraTox.Type = COMP.OraTox.Type,

       

OraTox.Value > COMP.OraTox.Value

     

THEN

       

OraTox.Value := COMP.OraTox.Value,

   

END

 

END

In this example, if three types of OraTox values were maintained in each of the five components, then the CreateInstances rule is called for all 3*5=15 OraTox values maintained and is executed three times for the three different types of values. Afterwards, there are three instances of the record OraTox . The SetMinimumValues rule is then applied to each of the 15*3=45 combinations of COMP.OraTox and OraTox records.