02-TA80 CONF020 DataModelIntro
02-TA80 CONF020 DataModelIntro
December 9, 2013
This lesson uses the notes section for additional explanation and information.
To view the notes in PowerPoint, select View Normal or View Notes Page.
When printing notes, select Note Pages and Print hidden slides.
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 2
Lesson outline
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 3
The data model
• For each Guidewire application, the data model is the set
of data objects and information about their relationships
ABContact
ID • Consists of entities,
AssignedUser
WebAddress_Ext
FraudInvestigationNum_Ext
entity fields, typelists
LastCourtesyContact_Ext
CustomerRating_Ext
and typekeys
StrategicPartner_Ext
ContactTier_Ext (typekey) - Part of Guidewire
ContactITier
Interactions_Ext (array)
ID data model
- Other data model
components include
Interaction_Ext User
ID ID
field validators and
* InteractionDate abstract data types
InitiatedByContact
Summary InteractionReason_Ext - Diagram shows work
ABContact (foreignkey)
AssociatedUser (foreignkey) ID completed by
Reason (typekey)
Channel (typekey) students in course
ChannelType_Ext
ID
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 4
Data model entities
• A data model entity is an abstract definition of a group of
business objects used by the application
• Examples: ABContact and User
ABContact User
ID ID
Name Department
CreateTime JobTitle
PrefersContactByEmail VacationStatus
Score ...
AssignedUser
ContactNotes
VendorType
...
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 5
Data model entities in the database
ABContact
ID
Name
CreateTime
PrefersContactByEmail
Score
AssignedUser
ContactNotes
• Most entity data is stored in its own VendorType
database table ...
- Some tables are shared
- Other entities are virtual, non-persistent entities and no data is
managed in the database
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 6
Subtyped entities
• Subtype inherits all fields of its parent
- Some entities are subtyped ABContact
- Most subtyped are also abstract
• Not possible to
create entity instance at the
supertype, top level
ABPerson ABCompany
ABAttorney ABDoctor
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 7
Subtype entity data
• Supertype parent table stores all instances of itself AND of
subtype data
- Contains parent fields and all subtype fields
- Irrelevant fields are null for specific subtypes
- Subtype column identifies subtype
• Example:
- Firstname and lastname are always null for subtype = 3
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 8
Entity fields
• An entity field is a value (or set of values) used to define
the state or nature of a specific instance of the entity
- Example: ABContact's Name field
ABPerson
...
FirstName
MiddleName
LastName
FullName (virtual)
...
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 11
Foreign key fields
• A foreign key field stores a reference to a related object in
the data model
• AssignedUser in ABContact is the foreign key field for User
ABContact User
ID ID
Name Department
CreateTime JobTitle
PrefersContactByEmail VacationStatus
Score ...
AssignedUser
ContactNotes
VendorType
...
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 12
Foreign key fields in the database
• Foreign key fields are stored as foreign key columns
ABContact User
... ID
AssignedUser ...
...
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 13
Array key fields
• An array key field stores references to a set of related
objects in the data model
• Not stored in database
• Populated at runtime by queries
ABContact
ContactNote
ID
... ID
ContactNotes * ...
... ABContact
...
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 14
Typekey fields and typelists
• A typelist is a predefined list of values that constrains a
field
• A typekey field is a field associated with a specific typelist
• The typelist defines the possible values of the typekey field
ABContact
VendorType
ID Auto Repair Shop
Name Auto Glass Shop
CreateTime Towing Service
PrefersContactByEmail Fire Inspector
Score Building Contractor
AssignedUser Doctor
ContactNotes … typelist
VendorType
... typekey field
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 15
Typelists in the database
• Each typelist is stored in its own table
• Each typekey is a foreign key a single row in a typelist table
ABContact
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 16
Subtype typelists
• Subtyped entity automatically creates
typelist table of all subtypes
- Table of all subtypes for the supertype parent
- ID integer value uniquely identifies the subtype
- Typecode describes subtype
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 17
Data model configuration tasks
• Creating new entities
• Extending existing entities
• Creating typelists
• Extending existing typelists
• Following lessons discuss data model configuration tasks
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 18
Lesson outline
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 19
The Data Dictionary
• The Data Dictionary
documents the
entities and typelists
in your application
- Collection of HTML
pages
- Requires that you
regenerate
data dictionary
• Two primary
sections:
- Data Entities
- Typelists
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 20
Entities in the Data Dictionary
• Entities section lists each entity and information about it
• To view information about given entity, click its name
• Hyperlink document is fully navigable
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 21
Entity header
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 22
Subtypes list
• If entity is subtyped, it has
subtypes list
• Identifies all child subtypes
• Includes links to each
subtype
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 23
Fields
name data type properties description
expandable list of UI
files that display field
(if field is used in UI)
extensions to entity
in dark blue
virtual properties
identified
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 24
Arrays
• Each array
includes a link to
an entity stored
within an array
• Data dictionary
shows the
linkage
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 25
Subtype fields
• If entity is subtyped, fields and arrays declared at each
subtype level are listed in their own section
ABContact
ABPerson
ABPersonVendor ABAdjudicator
ABAttorney
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 26
Typelists in the Data Dictionary
• Typelists section lists each typelist and its typecodes
- To view information about given typelist, click its name
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 27
All fields
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 29
Lesson outline
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 30
Data model entities in application
architecture
database application server user interface
data model entity internal Gosu class page configuration file
ABContact ABContact
ABContact
ID Fields
Name Name
CreateTime PublicID
... CreateTime
...
ab_abcontact anAB
table row
Database
Coverage Contact
instance of
Gosu class
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 31
Dot notation
• Dot notation is a Gosu language syntax used to identify
data objects and properties
• Starts with object and ends
with field, related object,
or related array
• Relies on data model
- Not used to configure
data model
- Available for User Interface
configuration and Gosu classes
• Examples include data fields,
object collections, and methods
anABContact.FaxPhone
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 32
Dot notation syntax
• Referencing data field on given object
- object.field
anABContact
FaxPhone
anABContact.FaxPhone
AssignedUser JobTitle
anABContact.AssignedUser.JobTitle
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 33
Dot notation syntax (2)
• Referencing array on given object
- object.array
BankAccounts
anABContact.BankAccounts
• Referencing field at subtype level
- (object as subtype).field
anABContact
ABPerson
DateOfBirth
(anABContact as ABPerson).DateOfBirth
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 34
Lesson objectives review
• You should now be able to:
- Describe the contents of a Guidewire data model
- Identify information about a given application's data model
- Reference entity fields using dot notation
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 35
Review questions
1. For each of the following, identify if it is stored as a
database table, as a table column, or not stored in the
database at all:
a) An entity (such as ABContact)
b) A physical data field (such as ABContact.CreateTime)
c) A virtual data field (such as ABContact.FullName)
d) A foreign key field (such as ABContact.AssignedUser)
e) An array key field (such as ABContact.ContactNotes)
f) A typelist (such as VendorType)
g) A typekey field (such as ABContact.VendorType)
(continued)
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 36
Review questions
3. For the object "myContact" of
type ABContact, what is the
dot notation for the object's:
a) Preferred currency?
b) Notes?
c) Level of experience of
myContact's assigned user?
d) Mobile phone (if it is a person)
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 37
Notices
Copyright © 2001-2013 Guidewire Software, Inc. All rights reserved.
This material is Guidewire proprietary and confidential. The contents of this material,
including product architecture details and APIs, are considered confidential and are fully
protected by customer licensing confidentiality agreements and signed Non-Disclosure
Agreements (NDAs).
This file and the contents herein are the property of Guidewire Software, Inc. Use of this
course material is restricted to students officially registered in this specific Guidewire-
instructed course, or for other use expressly authorized by Guidewire. Replication or
distribution of this course material in electronic, paper, or other format is prohibited without
express permission from Guidewire.
© Guidewire Software, Inc. 2001-2013. All rights reserved. Do not distribute without permission. 38