TA80_INTG060_PluginsPredefined
TA80_INTG060_PluginsPredefined
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-2014. All rights reserved. Do not distribute without permission. 2
Lesson outline
• Gosu plugins
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 3
Plugin
• Often defines integration point
with external system(s)
• .gwp file
- …\config\plugin\registry\
- Specifies Gosu or Java class
- Defined additional parameters
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 4
Implemented plugins behaviors
• All applications • ClaimCenter
- User authentication - Policy search
- Geocoding - New Claim Wizard
- Number generation for
significant entities
- Document production and
• PolicyCenter
storage
- Vehicle identification
number (VIN)
search
• BillingCenter
- Commission
calculation
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 5
Types of plugins
• Predefined plugins
- Used to implement customizable
behavior for predefined points in the
application
• Messaging plugins
- Used to send messages to external
systems and process the resulting replies
• Startable plugins
- Used to listen for incoming messages and
processes them asynchronously
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 6
Plugin application scope
• Internal to Guidewire • External system integration
• Number generator plugin • Authentication plugin
example example
- Generates a unique, - Interacts with an external
sequential number for claims, system such as Active
policies, or accounts Directory, Single Sign On
- Application logic internal to (SSO) or LDAP Server
Guidewire
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 7
Plugin interfaces
• Every plugin class must implement at least one interface
- Interface varies based on the plugin to be implemented
- Interface contains methods that internal code will call
c c c
• Gosu Plugin* • OSGi Plugin • Java plugin
- Use Guidewire - IntelliJ IDEA with - Third party IDE
Studio OSGi Editor - Needs ALL
- Native access to - Access to Guidewire JARs
application API Guidewire - No inspection
- Native debugging application API support for
within Guidewire - Easily add third Guidewire Internal
Studio party libraries API
- Easy deployment - Require special
deployment
*Lesson covers only Gosu Plugins
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 9
Developer environments for plugins
Guidewire IntelliJ IDEA Third party IDE
Studio with OSGi Editor (Eclipse, other)
Gosu Yes
plugin
c
OSGi Yes Yes*
plugin
c
Java Yes Yes
plugin
c
*Requires manual configuration of OSGi files and bundle manifest
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 10
Use case: Exchange rate requirements
• Create an exchange rate set that includes one exchange
rate for every typekey currency
• TrainingApp
- Predefined Plugins
- Click Invoke
ExchangeRateSet
Plugin
• Interface to
implement:
- IExchangeRateSetPlugin
• Methods to implement:
- createExchangeRateSet()
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 11
Use case: Exchange rate calculation
1.301
$ €
0.769
ExchangeRate
Plugin
€ $
• TrainingApp supports multiple currencies and needs to be
able to convert values from one currency to another
• Exchange rates are retrieved through a plugin
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 12
Lesson outline
• Gosu plugins
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 13
Steps to implement Gosu plugins
1. Determine plugin requirements
2. Write plugin class in Guidewire Studio
3. Create or modify and then configure the
plugin registry file
c
4. Deploy the changes
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 14
Step 1: Gosu plugin requirements
• What interface(s) must the plugin
implement?
• What methods are included in the
interface(s)? c
• When are the methods called?
• What issues should you consider
when implementing the plugin?
• Does the plugin reference third party
JARs?
• Resources to consult:
- Integration Guide
- Gosu API and docs
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 15
Step 2a: Create the plugin class
• Create Gosu plugin
class in a package
located in \gsrc
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 16
Step 2b: Implement required interface(s)
1 package acme.ta.plugin.exchangerate
2
3 uses gw.plugin.exchangerate.IExchangeRateSetPlugin
4
5 class AcmeIExchangeRateSetPlugin implements
IExchangeRateSetPlugin {
6 override function createExchangeRateSet(): ExchangeRateSet {
7 return null
8 }
9 }
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 17
Step 2c: Replace method stubs with code
6 override function createExchangeRateSet(): ExchangeRateSet {
7 // Create and initialize new exchange rate set
…9 var erSet = new ExchangeRateSet()
10 erSet.Name = "Acme ExchangeRateSet " + DateUtil.currentDate()
12 erSet.MarketRates = true
13 erSet.EffectiveDate = currentDate()
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 18
Step 3a: Create the plugin registry file
1. Registry New Plugin In many cases, the plugin
definition ALREADY exists
in the project and it is NOT
necessary to create a new
plugin file!
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 19
Step 3b: Configure the registry file
• In Project View, open .gwp
• Plugin Editor
1. Add Plugin type
2. Specify class
3. Mark enabled
4. Define parameters
2
1
3
4
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 20
Step 4: Deploy plugin and code
Restart Server Make Project or
Reload Changed Classes
• New Gosu plugin class • Modified Gosu plugin class
• New or modified
- Plugin registry file
c GWP
Plugin
c
Gosu Plugin Modified
Class File
Gosu Class
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 21
Lesson outline
• Gosu plugins
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 22
Plugin Parameters
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 23
Reading plugin parameters
1 package acme.ta.plugin.exchangerate
2
3 uses gw.api.system.database.SequenceUtil
4 uses gw.plugin.InitializablePlugin
5 uses gw.plugin.exchangerate.IExchangeRateSetPlugin
…7 uses java.util.Map
8
…13 class AcmeIExchangeRateSetPluginWithParameters implements
IExchangeRateSetPlugin, InitializablePlugin {
14 override function createExchangeRateSet():ExchangeRateSet {
…40 }
43 override function setParameters(parameters:Map<Object,Object>) {
44 var userName = parameters.get("username")
45 var password = parameters.get("password")
46 print("Retrieving currency rates as "
+ userName + " with password " + password)
47 }
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 24
Lesson objectives review
• You should now be able to:
- Describe the basic functionality of Guidewire plugins
- Determine the methods needed for a given predefined plugin
- Write predefined plugins in Gosu
- Register and deploy plugins
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 25
Review questions
1. Identify if each statement is true or false.
a) Plugins implement methods that are called by internal code.
b) Plugins must be written in Gosu.
c) A plugin class must contain a predetermined set of methods
based on the business need it serves.
d) Plugins are used exclusively for external application integration.
© Guidewire Software, Inc. 2001-2014. All rights reserved. Do not distribute without permission. 26
Notices
Copyright © 2001-2014 Guidewire Software, Inc. All rights reserved.
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-2014. All rights reserved. Do not distribute without permission. 27