1 / 7

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

StateModel Design - 1 Data Stucture Diagram (DSD/EERD). SchemaVersion SV SchemaName VersionNo LastModAuthor LastModDate. FuncPtr Array[ ] (LCP-declared; link-time-updated; index initialized in ST). (Enter non-key attributes only; primary and foreign keys are implicit).

hisoki
Télécharger la présentation

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

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. StateModel Design - 1Data Stucture Diagram (DSD/EERD) SchemaVersion SV SchemaName VersionNo LastModAuthor LastModDate FuncPtr Array[ ] (LCP-declared; link-time-updated; index initialized in ST) (Enter non-key attributes only; primary and foreign keys are implicit) StateModel SM abbrev name SMdescription FuncTable FT (Action Routine)___ ARname ARdescription [ARptr = index to FPArray] State ST stateName ARname ARptr (FPindex) * STdescription (Source & Target ACid#) EventType ET label ETdescription *(Mutex Alt sequence via child_loop) TBD: Event Type Signatures Transition TR EventLabel TRdescription StateFunction SF Enable EN Each table must have a unique two-letter abbreviation ttabbr: SchemaVersion: SV; StateModel: SM; STate: ST; TRansition: TR; EventType: ET; ENable; EN; FunctionTable FT; StateFunction SF. Each TTabbrev produces a primary key (pkey) attribute: SV ->SVid; SM -> SMid; ST -> STid; TR -> TRid; ET ->ETid; EN -> ENid; FT -> FTid; SF -> SFid. Each 1:M relationship produces a foreign key (fkey): SV--->SM => ST.SMid; ST-->TR => TR:STid1 + TR:STid2; ET--->EN => EN.ETid; TR-->EN => EN.TRid; SM--->FT => FT.SMid; ST-->SF => SF.STid; FT--->SF => SF.Tid. Attribute formats and descriptions must also be acquired: When these are added, file StateModel.sch comprises a Data Dictionary of entities, classes, relations and attributes.

  2. 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 – 2:StateModel.sch File

  3. SchemaVersion SV /* schema version which contains this state model model */ { /* contents not shown, for brevity: 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 c4 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 (not needed; child_loop from ST to SF gets FTid –sequence) */ Descrip NA t80 0 /* Full Name or Description of State */ } Transition TR /* Possible transition from state STid1 to state 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 /* Label for events of this type; 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 */ } FunctionTable FT /* holds ActRtnfunction name and index, runs on entry to state (TT # 6)*/ { FTid NA c8 1 /* pkey of Function Table entry */ SMid NA c8 1 /* fkey of parent StateModel */ ARname NA c2 0 /* name of action routine or method */ ARptr NA i4 0 /* index into function ptr table (initialized at load time) */ } StateFunction SF /* M:N relationship from state entered to action routine sequence (TT # 7) */ { SFid NA c8 1 /* pkey of StateFunction table (associative entity) */ STid NA c8 1 /* fjey of a STate which will execute function */ FTid NA c8 1 /* fkey of Function in Table FT to be executed */ } StateModel Design - 3With ST to FP M to N Relation

  4. StateModel Design - 4:bde2sch Conversion EERDfile.dat from BDE BDE BDE b2t t2b (Desired input to chgen; TBD: get s2t out of chgen.) TTTA.msdat t2s chgen * (Current input to chgen) EERDfile.sch *[since v11, ‘chgen –meta EERDfile.sch’ does s2t]

  5. StateModel Design - 5 Schema Tables TT and TA (Schema as stored in tables TT and TA; for brevity, the attributes of tables FT, SF and SV are not shown) TableTypes TT /* holds description of each table type */ PKey TTabb TableName Description TT000001 SM StateModel /* Model for one Active Class */ TT000002 ST State /* Behavior of this state */ TT000003 TR Transition /* Transition: STid1 to STid2 */ TT000004 ET EventType /* Table of Event Types */ TT000005 EN EventEnable /* associates etent with transition */ TT000007 FT FunctionTable /* Table of Acton Routine Functions */ TR000008 SF StateFunction /* asssociates State with its Action */ TT000009 SV SchemaVersion /* identifies schema and tracks changes*/ TT.TAid_fcp for row 1 of table TT TableAttributes TA /* holds definition of each attribute */ TAid(Pkey) TTid(parent) Name Alt type is_key Description TA000001 TT000001 SMid NA c8 1 /* pkey of this State Model */ TA000002 TT000001 Abbrev NA c4 0 /* ttabbrev of Modeled Object? */ TA000003 TT000001 Name NA t80 0 /* Full Name or Description of SM */ TA000004 TT000002 STid NA c8 1 /* pkey of this STat e */ TA000005 TT000002 SMid NA c8 1 /* fkey of parent State Model*/ TA000006 TT000002 ActName NA c8 0 /* Action Routine Name */ TA000007 TT000002 ActFunc NA c8 0 /* Action Routine Function pointer*/ TA000008 TT000002 Name NA t80 0 /* Full Name or Description of State*/ TA000009 TT000003 TRid NA c8 1 /* pkey of this State Transition*/ TA000010 TT000003 STid1 NA c8 1 /* Transition Source or 'From' State */ TA000011 TT000003 STid2 NA c8 1 /* Transition Destination or 'To' STate*/ TA000012 TT000004 ETid NA c8 1 /* pkey of Event Type */ TA000013 TT000004 SMid NA c8 1 /* State Model Receiving this ET */ TA000014 TT000004 Label NA c32 0 /* State Transition label */ TA000015 TT000004 Descrip NA t80 0 /* Event Type description*/ TA000016 TT000005 ENid NA c8 1 /* pkey of ENable relation (ET to TR)*/ TA000017 TT000005 ETid NA c8 1 /* fkey to Event Type */ TA000018 TT000005 TRid NA c8 1 /* fkey of enabled State Transition*/ . . . (attribs of tables FT, SF and SV) . . . TT.TAid_fcp for row 5 of table TT Note that metadata tables TT and TA have the same format as ordinary tables described by instances of TT and TA. Therefore, metatables TT and TA can also be defined and stored in two rows of TT and eleven rows of TA.

  6. StateModel Design - 6Two-State SM Example State Model Name: TS:Two-State ET01:TSSet TSS0:OFF no-op TSS1:ON no-op ET02:TSReset This state model has two states, two transitions, and two event types. Each state has one incoming transition, one outgoing transition, and one ActionRoutine named no-op, which is executed on entry to either state. • This Diagram can be stored in a SMStateModel.dat file: • File SMStateModel.datcan be generated two ways: • From string constant declarations in a LCP API code file. • From bde2SM (.bde to .dat file converter) (TBUpdated)

  7. StateModel Design - 7(Two-State Model Conversion to a SM.dat File) SchemaVersion table entry omitted; EventType.Label field syntax restructured as in the revised ChkgAcct.ppt case study. (Generate this file from ST, TR and ET declared as strings.) State Model Name: TS:Two-State ET01:TSSet TSS0:OFF no-op TSS1:ON no-op ET02:TSReset BDE TwoStateSM.bde bde2sch TwoStateSM.sch: SV000001 TS TwoState /* equiv. to an RS Flipflop */ /*-------------------- (comment lines are ignored by pr_load) ----------------*/ ST000001 SM000001 TSS0:Off no-op /* Initial state:output=0 */ ST000002 SM000001 TSS1:On no-op /* Alternate state:output=1*/ /*-------------------------------------------------------------------------------------------*/ TR000001 ST000001 ST000002 /* enabled by set event */ TR000002 ST000002 ST000001 /* enabled by reset event */ /*-------------------------------------------------------------------------------------------*/ ET000001 SM000001 ET01:TSSet /* causes ON-to-OFF TR */ ET000002 SM000001 ET02:TSReset /* causes OFF-to-ON TR */ /*-------------------------------------------------------------------------------------------*/ EN000001 ET000001 TR000001 /* TSset enables TR1: ST1->ST2 */ EN000002 ET000002 TR000002 /* TSReset enables TR2: ST2->ST1 */

More Related