0% found this document useful (0 votes)
46 views

Creating Entities

CreatingEntities
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Creating Entities

CreatingEntities
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

Creating New 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 ViewNormal or ViewNotes 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

• Entity declaration files

• Foreign keys and arrays

• Defining new entities

• Advanced data model design features

© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
3
Review: Entities in base applications
Claim Policy Billing
Center Center Center

Claim Quote Invoice


• Application-level entities
are specific to given
application
Guidewire Platform
Activity User • Platform-level entities
are common to all
Guidewire applications
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
4
Custom entities
Claim Policy Billing • Customers can add third
Center Center Center layer of "custom entities"

MedCase Trailer PhoneCall


custom
entities

Claim Quote Invoice

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

• Foreign keys and arrays

• Defining new entities

• Advanced data model design features

© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
8
Entity declaration (eti) files

Building_Ext

Entity editor

• Edit using Entity editor


• Creates only one entity
XML
- Each entity can have at most one eti file
Building_Ext.eti

© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
9
Primary tags of eti file
• <entity>
- Defines entity to be created

• Primary subtags (same as for <extension>)


- <column>
- Declares data field (storing simple values such as Strings,
booleans, datetimes or integers)
- <foreignkey>
- Declares foreign key field
- <array>
- Declares array
- <typekey>
- Declares field constrained by specific typelist

© 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

• Entity declaration files

• Foreign keys and arrays

• Defining new entities

• Advanced data model design features

© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
13
Foreign keys and arrays

ABContact Buildings Building AddressID


Address
_Ext
(array key) (foreign key)

• Typically, entities are not isolated in data model


• Two ways in which one entity can reference another
- Foreign key
- Pointer to single instance of some other entity
- Maintained by foreign key column in database table
- Example: each Building can have one address
- Array key
- Collection of pointers to instances of some other entity
- Maintained by code during runtime
- Example: each ABContact can have zero to many buildings
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
14
Foreign key – Studio
The foreign key defined in Building_Ext associates the array to ABContact

Both Address and ABContact appear as foreign keys in Building_Ext

© 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

Array definition for Buildings_Ext in entity ABContact

© 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

• Entity declaration files

• Foreign keys and arrays

• Defining new entities

• Advanced data model design features

© 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

Validation reports problems with the entity creation

© 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

• Entity declaration files

• Foreign keys and arrays

• Defining new entities

• Advanced data model design features

© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
28
One-to-ones

ABContact foreign key FinancialSummary


ID ID
FinancialSummaryID ABContactID
one-to-one

• A one-to-one is used to identify that two foreign key


relationships are in fact the same relationship
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
29
Edge foreign keys
ABContact
ABCompany ABPerson

edge foreign key

• An edge foreign key lets either:


- An entity reference itself, or
- Two or more entities reference each other
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
30
Delegates
delegate entities implementing delegate
Assignable Assignable

Assignable Activity ContactNote


AssignedUser ID ID
AssignedGroup Status Subject
Escalated NoteType
AssignedUser AssignedUser
AssignedGroup AssignedGroup

• A delegate is a virtual entity consisting of database fields,


or methods, or both that can be reused by multiple entities
- Delegates bundle together data and functionality that is
needed by multiple unrelated entities
• Customers can implement existing delegates and create
and implement new delegates
© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
31
Lesson objectives review
You should now be able to:
- Describe how custom entities are added to an application
- Describe the structure of an entity XML file
- Create foreign keys and arrays to entities
- Create new entities
- List the features relevant to advanced data model design
situations

© 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 products are protected by one or more United States patents.

© Guidewire Software, Inc. All rights reserved. Do not distribute without permission.
34

You might also like