Define or edit an availability script in Studio
Before you begin
- In Product Designer, commit all changes to the product model clauses you will be modifying.
- Ensure that no one works on the clauses that you will be modifying.
About this task
Although Product Designer enables you to write availability scripts, it does not validate or compile the scripts that you write. Therefore, Guidewire recommends that you use Product Designer only to examine scripts, but use the Studio XML editor to write, verify, and compile scripts.
When changes are made in Product Designer, Product Designer detects conflicts before committing changes. However, Product Designer cannot detect the changes you made in Studio. Detecting no conflicts, Product Designer saves all product model clauses that were modified, potentially overwriting changes you made in Studio. To avoid overwriting work you did in Studio, make your changes in Studio, then restart Product Designer. Product Designer will pick up the changes you made in Studio.
Procedure
- Use the Project window to navigate to and go to the resources/productmodel/codeLine directory.
- Locate and open the folder that corresponds to the pattern in which you want to write or edit the script. In the preceding example, go to the BusinessAutoLine/coveragepatterns folder.
- Open the XML file that corresponds to the pattern Code. The code appears in brackets to the right of the selected item in the Product Designer Navigation panel. In the preceding example, open CA_PIP_AR.xml.
-
Locate the
CoveragePatternelement in which you want to write or edit the script, and then locate or insert theAvailabilityScriptelement within thatCoveragePattern. In the preceding example, the XML code is:
Define your script as XML CDATA. Notice that as you type, Studio provides auto-completion and validates your code.<AvailabilityScript> <![CDATA[return BAJurisdiction.BusinessAutoLine.GaragingJurisdictions.contains(BAJurisdiction)]]> </AvailabilityScript> - Restart Product Designer. Product Designer picks up the changes you made in Studio.
