Notes
Slide Show
Outline
1
StateModel Design – 1
Data Stucture Diagram (DSD/EERD)
2
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 */
  • }


3
StateModel Design – 3
Revert to Sparse Diagram Style
4
StateModel Design – 4
Use of Sparse Diagram Style:
Add AC, ES + (dynamic) AI, EI
5
StateModel Design – 5
TBD Plans for SM Schema
6
StateModel Design - 6:
bde2sch Conversion
7
StateModel Design - 7
Schema Tables TT and TA
8
StateModel Design – 8a
Schema Tree (Tables Depth-First)
9
StateModel Design – 8b
Schema Tree (Tables Depth-First)
10
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.
11
StateModel Design - 10
Two-State SM Example
12
StateModel Design - 11
(Two-State Model Conversion to a SM.dat File)
13
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
  • }
14
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 */
  • }


15
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 */
  • }