TRACKING STATUS CHANGES AND ACCESS RIGHTS
=========================================

Jeremy Dick     QSS     29 April 1998


Purpose
-------
To prevent disallowed state transitions for requirements.
To control user access according to requirement status. 


Menus
-----
When installed, a new menu called "FE_RDB" will appear on the Module menu bar.
Under this, there is a sub-menu called "Setup status tracking"
which contains three scripts, "Transition control setup", "Access control setup"
and "Calculator".


Transition control setup
------------------------
Use standard DOORS facilities (Attributes/Edit types) to create an enumerated type
describing the states of requirements in a module.

Valid transitions between states are represented by storing an integer
value for each enumeration which uses binary encoding to record valid
next states. 

    EXAMPLE
    Enumerations (in order):
            Raw
            Defined
            Classified
            Reviewed
            Rejected
            
    Permitted transitions:
            Raw -> Defined
            Defined -> Classified
            Classified -> Reviewed
            (any) -> Rejected
            (any backwards step)
            
    These permitted transitions will be recorded using bits for each
    state according to the order presented, as follows:
            Least significant bit:  1   Raw
                                    2   Defined
                                    3   Classified
                                    4   Reviewed
            Most significant bit:   5   Rejected
            
    Values expressing valid transitions:
            (1) Raw         10011 = 19
            (2) Defined     10111 = 23
            (3) Classified  11111 = 31
            (4) Reviewed    11111 = 31
            (5) Rejected    10001 = 17
    
    It is the integer values 19, 23, 31 .... that are stored against
    each enumeration in the DOORS type definition.

Use standard DOORS facilities (Attributes/Define...) to create an 
attribute of the type just created.

To setup a trigger to check transitions for validity, run the
"Setup transition control" script.  It asks you to select the attribute
concerned, and then sets up the trigger.


Access control setup
--------------------
Use standard DOORS facilities to create an enumerated type and attribute 
describing the states of requirements in a module, as above.

In the Users module (which can be opened using 
FE_RDB/User groups/Open users module), use standard DOORS facilities 
(Attributes/Edit types) to create an enumerated type describing user 
classifications (e.g IPT, REW, REG).

Access rights for each user classification relating to each requirement
state are represented by storing an integer value for each enumeration 
which uses binary encoding to record on which states the users have 
write access.

    EXAMPLE
    Enumerations (in order):
            Raw
            Defined
            Classified
            Reviewed
            Rejected
            
    User groups:
            IPT: access to Raw, Defined, Classified
                    00111  =   7
            REW: access to Raw, Classified, Rejected
                    10101  =  21
            REG: access to Defined, Classified
                    00110  =   6
    
    It is the integer values 7, 21, 6 .... that are stored against
    each enumeration in the user group type definition in the Users
    module.
    
To setup a trigger to check access rights, run the "Setup access control" 
script.  It asks you to select the state attribute in the current module,
and the user classification attribute in the Users module, and then 
sets up the trigger.


Calculator
----------
This is to assist in the calculation of binary numbers for the above functions.
At present, there is no way within a DXL script of assigning thses values
to attribute enumerations; this has to be done manually using the standard 
DOORS facilities.  However, this script is of great help.

It asks you to select the enumerated attribute type for which you wish to
create a binary table, and then displays the enumerations in a 
multi-selectable list.

To find a value, select those enumerations that form the combination to
be encoded, and the corresponding number is calculated.

To decode a number, just fill in the "Corresponding value" field, and 
click on "Show"; the combination of enumerations will then be shown.
