Creating Entities
Creating Entities
9 September 2013
Lesson objectives
• By the end of this lesson, you should be able to:
- Describe how custom entities are added to an application
- Create foreign keys and arrays on entities
- Create new entities
- List the features relevant to advanced data model design
situations
This lesson uses the notes section for additional explanation and information.
To view the notes in PowerPoint, choose ViewNormal or ViewNotes Page.
If you choose to print the notes for the lesson, be sure to select “Print hidden slides.”
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
2
Lesson outline
• Custom entities
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
3
Review: Entities in base applications
Claim Policy Billing
Center Center Center
base application
Guidewire Platform entities
Activity User
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
5
Declaring entities
Claim Policy Billing • All entities are declared
Center Center Center in eti (entity) files
- Base application
MedCase Trailer PhoneCall contains eti files for
MedCase Trailer Phone base app entities
_Ext.eti _Ext.eti Call_Ext.eti
- Developers can create
new eti files for custom
Claim Quote Invoice entities
Claim.eti Quote.eti Invoice.eti
Guidewire Platform
Activity User
Activity.eti User.eti
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
6
Custom entities and Gosu classes
database application server
Building_Ext Building_Ext
Fields
NumOfEmployees
Building NumOfEmployees internal
InspectionDate Gosu
_Ext.eti InspectionDate
HasParking class
HasParking
…
...
abx_building aBuilding
row in instance
Coverage read from db
database of Gosu
table save to db class
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
7
Lesson outline
• Custom entities
• Entity declaration
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
8
Entity declaration (eti) files
Building_Ext
Entity editor
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
9
Primary tags of eti file
• <entity>
- Defines entity to be created
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
10
XML description and <entity> tags
• First tag must be <?xml version="1.0"?>
• Entity tag syntax:
<entity entity="EntityName_Ext" table="tablename"
desc="DescString" type=“type (typically retireable)"
xmlns="http://guidewire.com/datamodel">
...
</entity>
- For entity name, Guidewire recommends CamelCase and
ending name in "_Ext"
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
11
Optional <entity> tag attributes
• exportable="value"
- Defaults to "false"
- When set to "true", entity is available to application SOAP
APIs (which means its data can be exposed to external
systems)
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
12
Lesson outline
• Custom entities
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
13
Foreign keys and arrays
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
15
<foreignkey> in XML
• Syntax:
<foreignkey name="FieldName" columnName="FieldNameID"
fkentity="OtherEntity" desc="DescString"/>
- Recommended naming convention:
- For name, end field with "_Ext" only when field is added to base
entity
- Include columnName attribute and set it to field name + "ID"
• Example:
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
16
Array – Studio
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
17
<array> tag
• Syntax:
<array name="ArrayName" arrayentity="OtherEntity"
desc="DescString"/>
- Recommended naming convention for name:
- Using plural form of name
- Using "_Ext" suffix only when field added to base entity
• Example:
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
18
Each array requires "reverse" foreign key
• If entity A has array of entity B, then entity B must have
foreign key pointing to entity A
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
19
Lesson outline
• Custom entities
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
20
Steps to create an entity
1. In Project view, navigate to folder:
/configuration/config/Extensions/Entity
2. Create new entity
a. Context menu Entity
b. Entity dialog, enter details
3. Add child elements and define attributes
4. Validate
5. Restart application server
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
21
Step 1: Navigate to folder
In Project view, navigate to folder:
/configuration/config/Extensions/Entity
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
22
Step 2: Create new entity
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
23
Step 3: Add child elements and attributes
Elements
Attributes
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
24
Step 4 and 5: Validate and restart server
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
25
Entity names
• Every entity has
internally declared
DisplayName field
- It names each instance
of that entity
- It is used when entity
must be named in user
interface
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
26
Defining entity names
• Entity names defined using Gosu
- Many base entities have entity names
in base application
- For new entities that will be displayed
in the UI, entity name must be created
- This is discussed in "Entity Names"
lesson (which comes after section on
Gosu)
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
27
Lesson outline
• Custom entities
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
28
One-to-ones
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
32
Review questions
1. What is the difference between an etx file and an eti file?
2. Does the base application have existing entities? Can
developers create new entities files?
3. If the ABLawyer entity has an array of Cases, what type of
field is required on the Case entity?
4. To deploy data model changes, are you required to:
a) Identify changes in the Data Dictionary
b) Restart the application server?
c) Restart Studio?
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
33
Notices
Copyright © 2001-2013 Guidewire Software, Inc. All rights reserved.
Guidewire, Guidewire Software, Guidewire ClaimCenter, Guidewire PolicyCenter, Guidewire
BillingCenter, Guidewire Reinsurance Management, Guidewire ContactManager, Guidewire
Vendor Data Management, Guidewire Client Data Management, Guidewire Rating
Management, Guidewire InsuranceSuite, Guidewire ContactCenter, Guidewire Studio,
Guidewire Product Designer, Guidewire Live, Guidewire DataHub, Guidewire InfoCenter,
Guidewire Standard Reporting, Guidewire ExampleCenter, Gosu, Deliver Insurance Your
Way, and the Guidewire logo are trademarks, service marks, or registered trademarks of
Guidewire Software, Inc. in the United States and/or other countries.
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
34