StateModel Design – 1
Data Stucture Diagram (DSD/EERD)

StateModel Design – 2:
StateModel.sch File (incomplete)
SchemaVersion SV /* schema version containing this state mode */
{   /* SV Attributes: name, versionNo, lastModAuthor, lasModDate*/
}
StateModel SM /* State Model for one Active Class  ( TT000001 SM) */
{
SMid NA c8 1 /* pkey of this State Model */
SVid NA c8 1 /* fkey of Schema Version */
Abbrev NA i4 0 /* ttabbrev of Modeled Object? */
Name NA t80 0 /* Full Name or Description of SM */
}
State ST / * One state or stage of  behavior (  TT000002  ST) */
{
STid NA c8 1 /* pkey of this STat e */
SMid NA c8 1 /* fkey of parent State Model */
STname NA c32 0 /* a name to identify this state */
ARname NA c8 0 /* Action Routine Name */
ARptr  NA i4 0 /* Was pointer, now integer index since 04s522) */
Descrip NA t80 0 /* Full Name or Description of State */
}
Transition  TR /* Allowable transition: STid1 to STid2 (TT000003 TR ) */
{
TRid NA c8 1 /* pkey of this State Transition */
STid1 NA c8 1 /* Transition Source or 'From' State */
STid2 NA c8 1 /* Transition Destination or 'To' STate */
}
EventType  ET   /* Event Type (asynchronous message type) (TT000004 ET) */
{
ETid NA c8 1 /* pkey of Event Type */
SMid NA c8 1 /* State Model target of EventType */
Label NA c8 0 /* Event Type Name; syntax:  <SM>E##:<name> */
Descrip NA t80 0 /* Event Type description */
}
EventEnable  EN /* Relates Event Types to State Transitions (TT000005 EN) */
{
ENid NA c8 1 /* pkey of ENable relation (ET to TR) */
ETid NA c8 1 /* fkey to Event Type */
TRid NA c8 1 /* fkey of enabled State Transition */
}

StateModel Design – 3
Revert to Sparse Diagram Style

StateModel Design – 4
Use of Sparse Diagram Style:
Add AC, ES + (dynamic) AI, EI

StateModel Design – 5
TBD Plans for SM Schema

StateModel Design - 6:
bde2sch Conversion

StateModel Design - 7
Schema Tables TT and TA

StateModel Design – 8a
Schema Tree (Tables Depth-First)

StateModel Design – 8b
Schema Tree (Tables Depth-First)

State Model Design - 9
Name-scopes for schema tables
Meta-data tables TT and TA have the same format   as  ordinary tables described by instances of TT and TA.
TT and TA  and any other meta-tables (SV, VV etc.) can be defined and stored in the first two rows of TT and their 11 TA-child-rows.
CAUTION! The order of TT_-rows is a critical invariant for any application because chgen has no other way to order them for encode-decode-indexing purposes.
Rigorous invariant encoding is possible for chgen, but it requires (1) partitioning tables into namespaces or sub-schema scopes, and (2) defining a table-type order or index as a TT-row meta-attribute within each namespace scope. This ordering should be invariant over all concurrent collaborating applications, for any schema version SV.

StateModel Design - 10
Two-State SM Example

StateModel Design - 11
(Two-State Model Conversion to a SM.dat File)

StateModel Design – 12
NameSpace and SchemaVersion
(hyper-linked from the Data Model)
NameSpace NS  /* (TBD): permits locally scoped table types */
{ /* E.g.: StateModel, LCP, BDE, ERD, JPsim , other apps */
  NSName
lastModAuthor
lastModDate
lastModPath
NSDescription
}
SchemaVersion SV /* schema version containing this state mode */
{
namespaceName …
schemaVersionNo …
lastModAuthor …
lastModDate 
lastModPath
SVDescription
}

StateModel Design – 13
StateModel and State
(hyper-linked from the Data Model)
StateModel SM /* State Model for some Active Class method */
{
SMid NA c8 1 /* pkey of this State Model */
SVid NA  c8 1 /* fkey of Schema Version */
ACid NA c8 1 /* Active Class having this state model */
Abbrev NA  i4 0 /* ttabbrev of Modeled Object? */
SMName NA c32  0 /* Name of this state model */
SMdescription t80 0 /* Description of State Model */
}
State ST / * One state or stage of  behavior  */
{
STid NA c8 1 /* pkey of this STate */
SMid NA c8 1 /* fkey of parent State Model */
STname NA c32 0 /* a name to identify this state */
ARname NA c32 0 /* Action Routine (func) Name */
ARptr  NA i4 0 /* Action Routine (func) index (04f522)*/
Descrip NA t80 0 /* Full Name or Description of State */
}

StateModel Design - 14 -
TRansition, EventType, Enable
 (hyper-linked from the Data Model)
Transition  TR /* Allowable transition: STid1 to STid2 */
{
TRid NA c8 1 /* pkey of this State Transition */
STid1 NA c8 1 /* Transition Source or 'From' State */
STid2 NA c8 1 /* Transition Destination or 'To' State */
}
EventType  ET   /* Event Type (asynchronous message type) */
{ /*TBD: M-to-N-Associate ET with sender ACid1, receiver ACid2 */
ETid NA c8 1 /* pkey of Event Type */
SMid NA c8 1 /* State Model target of EventType */
Label NA c8 0 /* Event Type Name (<SM>E##:<name>)*/
Descrip NA t80 0 /* Event Type description */
}
EventEnable  EN /* Relates Event Types to State Transitions */
{
ENid NA c8 1 /* pkey of ENable relation (ET to TR) */
ETid NA c8 1 /* fkey to Event Type */
TRid NA c8 1 /* fkey of enabled State Transition */
}