Creating an ExitPoint PCF
The following example takes you through the process of creating a new exit point PCF and then modifying a PolicyCenter interface screen to use the exit point. It does the following:
- Step 1 creates a new
ExitPointPCF page with the required parameters. - Step 2 modifies the Activity Detail screen by adding a new Dynamic URL button. If you click this button, it opens a new popup window and loads the Guidewire Internet home page into it.
- Step 3 tests your work and verifies that the button works as intended.
It is possible to use any action attribute to activate
the ExitPoint PCF. This
example uses a button input as it is the easiest to configure and test.
This example pushes the URL to a popup window that leaves the user logged
into PolicyCenter. You can also
configure the ExitPoint
PCF functionality to log out the user or to possibly reuse the current
window.
Step 1: Create the ExitPoint PCF file
About this task
The first step is to create a new ExitPoint PCF file and name it
AnyURL.
Procedure
- In Guidewire Studio, in the Project tool window, navigate to .
- Right-click exitpoints, and then click .
- In the New PCF File dialog, in the File name text box, type AnyURL.
- In the File type list, click Exit Point.
- In the AnyURL.pcf file editor, click the Exit Point box.
- In the Properties tab at the bottom of the window, set the following properties:
- Select the AnyURL file, so that Studio outlines the ExitPoint element in blue.
-
Select the Properties
tab at the bottom of the screen and set the listed properties. This example
pushes the URL to a popup window that leaves the user logged into PolicyCenter. You can also configure
the
ExitPointPCF functionality to log out the user or to possibly reuse the current window.- logout – false
- popup – true
- url – {exitUrl}
-
Click the Entry
Points tab, and then click Add
.
-
In the signature
text box, type the following entry point signature:
AnyURL(url : String)
- In the Toolbox, expand the Special Navigation node, click the Exit Point Parameter widget, and drag it into your exit point PCF.
-
Select the Exit
Point Parameter widget and enter the following in its Properties
tab:
- locationParam – url
- type – String
- urlParam – exitUrl
What to do next
After completing this task, complete Step 2: Modify the user interface screen to use the exit point.
Step 2: Modify the user interface screen to use the exit point
Before you begin
About this task
After you create the ExitPoint PCF, you need to link
its functionality to a PolicyCenter
screen. The Activity Detail
screen contains a set of buttons across the top of the screen. This example
adds another button to this set of buttons. It is this button that activates
the exit point.
Procedure
-
In Guidewire Studio, create a new
Button.Activity.DynamicURLdisplay key. You need this display key as a label for the button that you create in a later step.- Open the Display Key editor and navigate to .
- Select the Activity node, right-click and select Add.
- Enter the following in the Display Key Name dialog:
- Display Key Name — Button.Activity.DynamicURL
- Default Value — Dynamic URL
-
Open the PCF for the page on which
you want to add the exit point. For the purposes of this example, open
the
ActivityDetailScreenPCF file.Note: The simplest way to find a Studio resource is to pressCTRL+Nand enter the resource name. -
Select the entire
ActivityDetailScreenelement on the PCF page. Studio displays a blue border around the selected element. -
In the Code
tab at the bottom of the screen, enter the following as a new function:
// This function must return a valid URL string. function constructMyURL() : String { return "http://www.guidewire.com" }You can make the actual function as complex as you need it to be. The function can also accept input parameters as well. The only stipulation is that it must return a valid URL string.
- In the Toolbox for the PCF page that you just opened, find a Toolbar Button widget and drag it into the line of buttons at the top of the page.
- Select the new button widget so that it has a blue border around it.
-
Select the Properties tab at the bottom of the screen and set the listed properties. It is possible to use any action
attribute to activate the
ExitPointPCF. This example uses a button input as it is the easiest to configure and test.- action – AnyURL.push(constructMyURL())
- id – DynamicURL
- label – displaykey.Button.Activity.DynamicURL
What to do next
After completing this task, complete Step 3: Test your work.
Step 3: Test your work
Before you begin
About this task
After completing the previous steps, you need to test that the button you added to the Activity Detail screen works as you intended.
Procedure
- Start the PolicyCenter application server, if it is not already running. It is not necessary to restart the application server as you simply made changes to PCF files. You did not actually make any changes to the underlying PolicyCenter data model, which would require a server restart.
- Log into PolicyCenter using an administrative account.
- Press Alt+Shift+T to open the Server Tools screen. This screen is only available to administrative accounts.
- Choose Reload PCF Files in the screen. PolicyCenter presents a success message after it reloads the PCF files from the local file system.
- Log into PolicyCenter under a standard user account and search for an activity. The Activity Detail screen now contains a Dynamic URL button.
-
Click the Dynamic URL button and PolicyCenter opens a popup window and loads the URL that you set on the
constructMyURLfunction.
Results
If you followed the steps of this example exactly, PolicyCenter loads the Guidewire Internet home page into the popup window.
