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

3.AddEntities To Data Model

Uploaded by

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

3.AddEntities To Data Model

Uploaded by

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

InsuranceSuite Fundamentals:

Add Entities to the Data Model


Student Exercise
InsuranceSuite Fundamentals - Student Exercise

Creating New Entities


The business analysts want to capture specific information about each contact interaction such as a
telephone call, email message, postal mail letter, or in-person office visit. Eventually, they want the
information displayed in an Interactions section of TrainingApp.

“We want a CSR (Customer Service Representative) such as Alice Applegate to be able to create and
edit details about contact interactions.” – Insurance company business analysts

In this lab, your job is to make the necessary data model changes to meet customer requirements. As a
configuration developer, you will use the Entity Editor in Guidewire Studio to modify the TrainingApp data
model. You will implement the user interface changes in a later module.

Prerequisites
For this exercise, use TrainingApp, Guidewire Studio, and a supported web browser.
http://localhost:8880/ab/ContactManager.do is the default URL for TrainingApp. To view, edit, and delete
various contacts, log in to TrainingApp as Alice Applegate. The login/password for Alice Applegate is
aapplegate/gw.

Lab: Create a new entity


As a configuration developer, you want to be able to create new entities. In this lab, you will use the Entity
Editor to create an entity to capture contact interaction details.

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 2


InsuranceSuite Fundamentals - Student Exercise

1. Create a new entity named Interaction_Ext and add the following fields:

Field Name Datatype Null ok?

InteractionDate date and time true

InitiatedByContact A boolean value true

Summary A string of up to 60 characters true

AssociatedUser A foreign key to User true

2. Set the Exportable property of Interaction_Ext to true.

Tip
When creating an entity which will have an “owned by” relationship to a core entity
(in this case ABContact), you must set the Exportable property to true. Failure to do
so will result in errors that prevent the application from starting. This is a technical
issue related to the implementation of Archiving, which is covered in another lesson.

1. Use Studio’s code generation feature to generate the Java class from the entity and verify the
generated Java class

If possible, use incremental code generation


Verify that there were no errors during code generation
Open the generated Java class

Important!
Read carefully.

2. For each new entity element, remember to set the nullok attribute to true if not specifically
defined to be false.
3. When required, add an element description and specify column parameters

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 3


InsuranceSuite Fundamentals - Student Exercise

Best Practices
Use _Ext in the entity name

Notice that the name of the entity has an _Ext suffix. For new entities, Guidewire recommends that the
name of the entity should end with _Ext. This is to prevent potential conflicts during the upgrade to the
next version of the Guidewire application.

Lab: Define an array relationship between two entities


As a configuration developer, you want to be able to define different types of relationships between
entities. In this lab, you will define an array relationship between ABContact and Interaction_Ext:

“An ABContact entity can have zero or many Interactions associated with it.” – Insurer business analysts

1. Add an array key field to ABContact

Extend the ABContact entity to define a new array. The array key field should point to
Interaction_Ext. The array name should be descriptive and should follow the recommended naming
conventions.
2. Use Studio’s code generation feature to generate the Java class from the entity and verify the
generated Java class

If possible, use incremental code generation


Verify that there were no errors during code generation
Open the generated Java classes and verify that you can see the new fields
Remember, for every data model array the framework automatically generates
addTo<ArrayName>(element) and removeFrom<ArrayName>(element) functions. Verify
that you can find those methods in the generated Java class.

Best Practices
Use _Ext in entity field name when extending base application entities

For fields that are added to a base application entity, Guidewire recommends that the field name should
end with _Ext. This is to prevent potential conflicts during the upgrade to the next version of the
Guidewire application.

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 4


InsuranceSuite Fundamentals - Student Exercise

Activity
Verify the work you have done

As a configuration developer, you want to be able to properly deploy new and changed data model
resources.

1. Restart the server to deploy the changes

During server restart Studio first runs the code generators, then compiles the project and finally
deploys the resources
2. Regenerate the Data Dictionary

Follow the steps to regenerate the Data Dictionary


3. Open the Data Dictionary

In Windows Explorer, navigate to the data dictionary.


Open the data dictionary using your preferred browser.
4. View the Interaction_Ext entity

Verify each new field and associated datatype.


5. View the ABContact entity

Verify you can see the new array

Lab Solution: Create a new entity

Solution
Exact details on how to complete the lab.

1. Create the Interaction_Ext entity

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 5


InsuranceSuite Fundamentals - Student Exercise

2. Add new elements to Interaction_Ext.eti

Add the InteractionDate field

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 6


InsuranceSuite Fundamentals - Student Exercise

Add the InitiatedByContact field

Add the Summary field and its columnParam

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 7


InsuranceSuite Fundamentals - Student Exercise

Add the AssociatedUser field

3. Set the Exportable property of Interaction_Ext to true.

4. Entities support incremental code generation. You can click on the validate icon or use the
CTRL + S keystroke to kick off incremental code generation. You can open the generated Java
class once the code generation is completed.

Note: The code generation was successful if the Codegen tool window has nothing to show.

Screenshot of some of the Java code generated by the Codegen tool.

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 8


InsuranceSuite Fundamentals - Student Exercise

Lab Solution: Define an array relationship between two


entities

Solution
Exact details on how to complete the lab.

1. Add the array key to the ABContact.etx

2. You must also add a foreign key to Interaction_Ext.eti since every array requires a reverse
foreign key on the other side of the relationship.

3. Entities support incremental code generation. You can click on the validate icon or use the
CTRL + S keystroke to kick off incremental code generation. You can open the generated Java
class once the code generation is completed.

Note: The code generation was successful if the Codegen tool window has nothing to show.

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 9


InsuranceSuite Fundamentals - Student Exercise

Guidewire Proprietary & Confidential – DO NOT DISTRIBUTE 10

You might also like