Developer Guide | PUBLIC Document Version: 1.0 – 2021-05-06

Developer Guide SAP Underwriting for Insurance 4.0 SP06 company. All rights reserved. affiliate

THE BEST RUN 2021 SAP SE or an SAP © Content

1 Introduction...... 8 1.1 About This Document...... 8 1.2 Audience...... 8 1.3 Source Code Terms and Conditions...... 8 1.4 Supported Clients...... 8 1.5 Product Name Abbreviations...... 9

2 Understanding Application Development in FS-QUO...... 10 2.1 Terminology...... 10 2.2 Understanding the Difference Between Coverage-Based and Risk-Based Product Architectures ...... 12 2.3 Customer Views...... 13 2.4 Overview...... 15 2.5 References...... 18 2.6 Development Components...... 19 2.7 Understanding How the Components Work Together...... 20

3 Working with the Development Toolkit...... 22 3.1 Understanding the FS-QUO Development Toolkit Contents...... 22 3.2 Installing the FS-QUO Toolkit...... 24 Prerequisites for Installing the FS-QUO Toolkit...... 25 Creating the FS-PRO Designer Runtime Database...... 26 Installing and Configuring ...... 26 Installing WildFly and Creating a New Server Profile...... 27 Generating the Keystore and Enabling SSL in WildFly...... 27 Installing and Configuring the FS-QUO Toolkit...... 28 Copying and Deploying Insurance Product JAR Files from Product Configurator...... 35 Configuring the FS-QUO Toolkit for FS-QUO...... 36 Installing and Configuring Standalone SAP JCo (Optional)...... 37 Validating the Complete FS-QUO Toolkit Installation (Fiori)...... 40 Validating the Complete FS-QUO Toolkit Installation (Sencha)...... 41 Copying the Artifacts to the Development Profile...... 41 Administrative Console Changes...... 42 Debugging UI Changes...... 42 Building the Custom FS-QUO SCA and Package...... 43 Updating the FS-QUO Toolkit...... 43 3.3 Additional Software Management Tools...... 45

Developer Guide 2 PUBLIC Content 3.4 Changing Default Error Report Settings...... 46

4 Extensibility Best Practices...... 47 4.1 Understanding Extensibility...... 47 4.2 Extensibility Best Practices (Version 3.0 and Later)...... 48 Understanding Design Time...... 48 Customization Site Map...... 48 Extensibility Scenarios by Area...... 49 Adding a Custom Project...... 57 4.3 Extensibility Best Practices (Legacy)...... 58 Understanding Extensibility...... 58 Extension Compared to Customization...... 59 Location of Configuration Changes...... 59 Location of Extensions...... 60 Changes Preserved After an Upgrade...... 60 Conflicts with New Functionality...... 61 Merging Changes in an Upgrade...... 61 Typical Extensibility Scenarios...... 61 4.4 Unsupported Extension Types...... 67 4.5 Understanding TransferObjectBase Usage in Risk-Based Architecture...... 68

5 Sencha-Based UI...... 72 5.1 Modifying the User Interface...... 72 Understanding the User Interface Development Components...... 73 Modifying a Screen or Section...... 75 Modifying Buttons in the Button Bar...... 88 Extending the User Interface...... 91 5.2 Understanding the JavaScript Classes...... 92 Available Classes and Functions...... 93 Available Control Classes...... 98 5.3 Understanding Handlers and Handler Beans...... 102 Configuring Handlers...... 102 Configuring Handler Beans...... 109 Extending a Handler...... 110 Extending a Handler Bean...... 111 Preserving Extended Handlers After Upgrading...... 111 Example: Extended Handlers and Handler Beans...... 111 5.4 Working with the Validation Framework...... 112 Locating the Validation Framework...... 113 Understanding the Screen Framework Folder...... 114 The Validation Folder...... 120 Understanding Business Questions...... 127

Developer Guide Content PUBLIC 3 Using Validation Stems...... 131 5.5 Working with the Search Framework...... 132 Locating the Search Framework...... 132 The Search Framework Folder...... 132 Search Component...... 132 SearchCriteriaItem Component...... 133 SearchCriteriaItemColumns Component...... 135 SearchControlUIConfiguration Component...... 135 SearchGroupByColumns Component...... 136 SearchOrderByColumns Component...... 136 SearchResultItem Component...... 136 SearchColumns component...... 137 Example: Configuring the Work List Search...... 138 Modifying a Database View...... 139 Understanding the Search Framework Methods...... 140 5.6 Working with the Simplified Insurance Application Renderer...... 141 Suppressing Error Information...... 142 Setting Up the Simplified Insurance Application Renderer...... 143 Extending the Simplified Insurance Application Renderer...... 149

6 Core FS-QUO...... 150 6.1 Working with Application Flows...... 150 Overriding a Flow...... 152 Modifying a Flow...... 152 Example: Adding an Activity to a Flow...... 158 Preserving Modified Flows After an Upgrade...... 159 6.2 Business Services...... 159 Accessing the javadoc...... 160 Business Service Components and Methods...... 160 Understanding Business Validation...... 164 Understanding the Core Service Components...... 166 Extending a Business Service...... 167 Preserving Extended Services After Upgrading...... 168 6.3 Underwriting Application Configuration...... 168 AppConfig Service Bean...... 169 Locating the Standalone Underwriting Application Configuration...... 170 Extending the Underwriting Application Configuration Standalone Object...... 171 Modifying Application Configuration Settings...... 172 Folders in the Underwriting Application Configuration Object...... 173 6.4 Using the Scheduler...... 184 Installing the Scheduler...... 184

Developer Guide 4 PUBLIC Content Configuring the Scheduler...... 185 Creating or Updating the Archive...... 186 Running the Scheduler...... 186 Shutting Down the Scheduler...... 187 Interpreting the Scheduler Results...... 187 Renewal Information...... 188 6.5 SAP Business Partner Integration...... 188 NetWeaver Business Client...... 188 Business Partner Configuration...... 189 Field Mapping Illustrations...... 189 Permissions...... 192 Single Sign-On...... 193

7 Risk-Based Architecture...... 195 7.1 Working with Roles and the Permissions Framework...... 195 Reusing the Permission Component...... 195 The Role Framework...... 196 Screen Control Permissions...... 202 Permissions Provided with FS-QUO...... 204 7.2 Understanding Visitor Patterns...... 218 Model Visitor...... 219 ModelVisitor Class...... 219 Policy Traversal...... 221 Definition Visitor Patterns...... 222 Instance Visitor Patterns...... 224 7.3 Policy Models...... 227 Policy Model and Database Tables...... 227 Modifying the Policy Model...... 228 Policy Database Tables...... 239 Supporting Database Tables...... 280 Task Database tables...... 284 7.4 Product and Reference Services...... 285 User-Defined Services...... 285 Location of the Product Services...... 286 Location of the Reference Services...... 286 Service API for the Commercial P and Product Template...... 287 Service API for the Commercial P and C Reference Object Template...... 307 7.5 Using Stems...... 310 Stem Classes and Functions...... 311 Accessing the javadoc...... 313 Adding a Stem Class...... 314

Developer Guide Content PUBLIC 5 7.6 Configuring Premium Audits...... 319 Configuring Premium Audit Parameters for a Marketable Product...... 320 Configuring Deposit Premium Calculations...... 324 Configuring Premium Audit eApps at the Product Level...... 325 Configuring Premium Audit eApps at the Coverage Group Level...... 326 Configuring Premium Audit eApps for a Coverage...... 327 Configuring Fields that Impact Premium Calculation...... 328 Assigning Permissions to Process Premium Audits...... 329 Setting up Premium Audit Parameter Rules...... 330 Assigning Permission to Change Premium Audit Parameters Post-Bind...... 331 Setting up Automatic Waiving of Premium Audit Intervals...... 332 Assigning Permission to Manually Waive Premium Audit Intervals...... 333 Configuring Premium Audit Override...... 334 7.7 Selecting a Ratebook...... 334 Configuring Ratebook Selection...... 336 Example of Ratebook Selection Configuration...... 344 7.8 Configuring Out-of-Sequence Endorsements...... 346 Configuring the Input Fields to be Reapplied...... 346 Specifying Extension Tables...... 347 Setting OOS Permissions...... 349 7.9 Additional Configuration Procedures...... 349 Applying Form Configuration Changes...... 349 Configuring Forms Attachment...... 350 Configuring Tax Rules...... 350 Configuring Validation for Flat Cancellation Type...... 351 Referrals Configuration Note...... 352 Configuring the Delta Service...... 352

8 Coverage-Based Architecture...... 355 8.1 SAP Insurance Portals and Workplaces (IPW)...... 355 Extending Fiori Apps UI...... 355 8.2 OData Extensions...... 381 DataTable-related Annotations...... 381 ProductRuleDataSource...... 381 Processor...... 382 ModelValueMapper...... 382 DataTableValueMapper...... 383 8.3 Replacing EMF (PTTO) with Domain Layer...... 384 PTTO Removal...... 384 Characteristics of EMF...... 384 Areas changed from using PTTO to Domain Layer...... 384 Characteristics of Domain Layer...... 385

Developer Guide 6 PUBLIC Content Comparing EMF and Domain Layer...... 385 8.4 Troubleshooting...... 386 8.5 Cross-Site Request Forgery (XSRF/CSRF) Protection ...... 387 CSRF Protection Within FS-IPW Applications ...... 387 CSRF Protection Within Sencha (Legacy) Applications...... 389

9 Appendix...... 391 9.1 Building Enterprise Services for FS-QUO...... 391 First Time Setup...... 391 Building Enterprise Service Implementation from ESR...... 393

Developer Guide Content PUBLIC 7 1 Introduction

1.1 About This Document

This guide describes the following information:

● The SAP Underwriting for Insurance (FS-QUO) architecture and the objects used to create the application ● How to extend the default FS-QUO behavior ● How to modify the FS-QUO configuration (for example, the application configuration and flows)

1.2 Audience

This guide is intended for technical consultants and developers who modify FS-QUO functionality. This guide is also intended for business analysts and administrators who configure FS-QUO.

The prerequisites for using this guide are the following:

● You are familiar with FS-QUO. ● You have experience developing applications using Ext JS and Spring Web Flow.

1.3 Source Code Terms and Conditions

The FS-QUO source code described in this guide is the intellectual property (IP) of SAP AG. The source code is available for customers to support extension.

Any changes that you make to the core source code voids part of the warranty or the entire warranty.

For more information about IP terms and conditions, see the license agreement.

1.4 Supported Clients

The FS-QUO client is browser-based.

For information about the browsers that are supported, see the Client Requirements for FS-QUO topic in the SAP Underwriting for Insurance Installation Guide.

Developer Guide 8 PUBLIC Introduction 1.5 Product Name Abbreviations

In the documentation, the products are also referred to by their abbreviations, as listed in the following table:

Full Product Name Abbreviation Alias

SAP Product and Quotation FS-PQM n/a Management for Insurance

SAP Product Lifecycle Management for FS-PRO Product Configurator Insurance

SAP Underwriting for Insurance FS-QUO Designer

SAP Workplaces for Insurance FS-IPW n/a

SAP Policy Management FS-PM n/a

Developer Guide Introduction PUBLIC 9 2 Understanding Application Development in FS-QUO

2.1 Terminology

While this Developer Guide focuses on FS-QUO, any customer wishing to customize this solution should be familiar with how FS-QUO fits into the overall FS-PQM product offering. The following terms and labels are meant to help with this understanding:

● A Program is an overall software offering/solution. ● A Program is made up of software Components, which are separately released and installed. ● A Component contains Modules, which are logical areas of functionality within the Component. Modules can be either horizontal (frameworks) or vertical (features).

The following table describes the Components and Modules in this release:

Item Type Description

FS-PQM Program Product, Quotation and Un­ derwriting for Insurance

FS-PRO Component Product Management for In­ surance

Administrative Console Module (Framework) An application for managing the FS-PRO system.

Product Configurator (FS- Module (Framework) An application for managing PRO) products.

Product Web Services (PWS) Module (Framework) A framework for exposing product services as web services.

IFBC Integration Module (Feature) Ability to export or import a product's IFBC definitions to or from FS-PM.

Developer Guide 10 PUBLIC Understanding Application Development in FS-QUO Item Type Description

Product Architectures Module (Framework) [FS-PRO content] Repre­ sents a top-level architecture (mode) for the Program.

Out of the box, two product architectures are supported:

● Coverage-Based ● Risk-Based

These terms are explained in more detail in a later section.

Sample Products Module (Feature) [FS-PRO content] Out of the box examples of functioning products, for both product architectures.

Product Stems Module (Framework) [Java] A set of specialized functions callable from prod­ uct script rules.

Product Runtime Framework Module (Framework) A platform for product-driven applications. Includes libra­ ries and engines to opera­ tionalize products (for exam­ ple, federated data model, product services, eApps).

FS-QUO Component Quotation and Underwriting for Insurance

Administrative Console Module (Framework) An application for managing the FS-QUO system.

Designer Module (Framework) An application for managing core data definitions.

Application Framework Module (Framework) Includes utilities for OData, SWF, Business Services, and Data Model.

Quotation Web Application Module (Feature) Back end for Quotation Fiori applications. Includes imple­ mentation for OData, SWF and Business Services

Underwriting Web Applica­ Module (Feature) Back end for Underwriting tion Fiori applications. Includes implementation for OData, SWF and Business Services

Developer Guide Understanding Application Development in FS-QUO PUBLIC 11 Item Type Description

Quotation Enterprise Serv­ Module (Feature) Includes skeleton classes, ices implementation classes, and Business Services.

Underwriting Enterprise Module (Feature) Includes skeleton classes, Services implementation classes, and Business Services.

FS-PM Integration Module (Feature) Ability to search and create BP/Insurable Object; book a policy to FS-PM

FS-IPW Component Workplaces for Insurance

Fiori Launchpad Configura- Module (Feature) Enables application tiles and tion related authorization.

Quotation Applications Module (Feature) Front end for Quotation Fiori applications, implemented in SAPUI5.

Underwriting Applications Module (Feature) Front end for Underwriting Fiori applications, imple­ mented in UI5.

Fiori refers to a set of usability guidelines for applications.

In the context of FS-PQM, a Fiori Application () is any application that conforms to Fiori guidelines or is implemented using a standard architecture consisting of the following items:

● Fiori launchpad ● UI5 ● OData services

2.2 Understanding the Difference Between Coverage-Based and Risk-Based Product Architectures

The following table outlines the differences between the two standard product architectures

Coverage-Based Model Risk-Based Model

Focused LOBs Personal/Simple P&C Commercial/Complex P&C

Life

FS-QUO Responsibilities Quotation and Underwriting (NB) Quotation and Underwriting (NB, CB)

Policy Management

Developer Guide 12 PUBLIC Understanding Application Development in FS-QUO Coverage-Based Model Risk-Based Model

FS-PM Responsibilities Policy Management N/A

Standard FS-PQM Integrations FS-PM N/A

ERP-BP

2.3 Customer Views

From the customer's perspective, there are three views of FS-PQM software:

Installable Refers to all FS-PQM-related artifacts available for the customer to download from SAP and View install.

Design Time Refers to set of systems that exist while the customer is developing their FS-PQM solution, View such as configuring their products and customizing the application for their use:

● FS-PRO Design Time (Administrative Console, Product Configurator) ● FS-QUO Design Time (Administrative Console, Designer) ● FS-QUO Toolkit

These systems are created from installable artifacts.

Runtime View Refers to set of systems that exist while the customer's FS-PQM solution is deployed and testable (for example, in QA or Production):

● FS-PRO Runtime ● FS-QUO Runtime

These systems are created from installable artifacts.

These three views apply to all three components (FS-PRO, FS-QUO, and FS-IPW). The following table outlines the artifacts/concepts relevant to each view-component combination.

 Note

The details in this table aren't meant to be exhaustive, but rather provide orientation for where certain concepts and technologies fall in the customer project lifecycle.

Developer Guide Understanding Application Development in FS-QUO PUBLIC 13 View FS-PRO FS-QUO FS-IPW

Installable Database (ZIP) Database (ZIP) - includes FS- ABAP Package (add-on) PRO database, plus addi­ ● QUO Fiori App (XML, JS, CSI Home (ZIP) tional content for FS-QUO BSP, and so on) ● UW Fiori App (XML, JS, SCA CSI Home (ZIP) - includes BSP, and so on) FS-PRO CSI Home, plus ad­ ● FS-PRO.ear ● FLP configuration (tiles, ditional content for FS-QUO ○ 3rd party libraries roles, and so on) ○ camilionlib.j SCA - includes FS-PRO SCA ar contents, plus additional components for FS-QUO ○ camilionejb.j ar ● FS-QUO JAR files ○ camilionweb.w ● quo-web.war ar ● uw-web.war ○ PSRepo.war ○ PSRuntime.war ○ ProductExplor er.war ○ ProductBuilde .war

Install Options (Usage Types)

● Product Configurator (PC) ● Product Web Services (PPMS)

Developer Guide 14 PUBLIC Understanding Application Development in FS-QUO View FS-PRO FS-QUO FS-IPW

Design Time Database Database Toolkit (for Eclipse)

File System (CSI Home) File System (CSI Home) ● Plugin to remotely man­ age FLP content Web Applications Web Applications ● One project for each ● camilionweb.war ● camilionweb.war app: ○ Administrative ○ Administrative ○ My Insurance Console (for opera­ Console (for devel­ Worklist tions) opment) ○ Create Insurance ○ Product ○ Designer Quote Configurator Toolkit (for Eclipse) ○ My Underwriting Worklist ● Includes FS-IPW Toolkit, plus additional projects for FS-QUO ● Uses WildFly for local testing ● Contains projects with build scripts and source code ● Produces an FS-QUO SCA

Runtime Database Database Fiori Apps

File System (CSI Home) File System (CSI Home) ● QUO - My Work List (Quotes) Web Applications Web Applications ● QUO - New Business ● camilionweb.war ● camilionweb.war ● UW - My Work List + ○ Administrative ○ Administrative Case Details (Cases) Console (for Opera­ Console (for opera­ tions) tions) ○ Product Web ○ Product Web Services Services ○ eApp service ● QUO.war ○ OData ● UW.war

2.4 Overview

The below diagram depicts a runtime deployment of FS-QUO. The subsequent sections describe each concept in more detail.

Developer Guide Understanding Application Development in FS-QUO PUBLIC 15 Fiori Applications

Fiori applications for Quotation and Underwriting are based on the Fiori application architecture, whereby the implementation is separated across front-end and back-end servers.

● Front-end server (NetWeaver ABAP with Fiori launchpad; FS-IPW installed). ○ The front-end server provides Fiori launchpad functionality, as well as the browser-side content for each Fiori application. ○ The “tile” used to launch each application is configured in Fiori launchpad, along with any users, roles and permissions for the launchpad. ○ UI5 content (View XML and Controller JS) is uploaded to the front-end server, and associated to a Tile. ○ At runtime, the front-end accesses the-back end through RESTful URLs (OData) specified in the Controller JS files. ● Back-end server (NetWeaver AS Java; FS-QUO installed). ○ The back-end server provides OData CRUD (Create Retrieve Update Delete business object interface operations) services to support the front-end. These services represent the MVC Model for the Fiori application. ○ The OData services are implemented using the Apache Olingo framework. ○ The OData services are implemented as Processor classes, which call FS-QUO Business Services. ● Web Dispatcher server. ○ A simple web server which uses a “reverse proxy” (HTTP forwarding) technique to make the front-end and back-end appear as one server to the browser. ○ Depending on context path, the Web Dispatcher forwards the request to either the front-end or back- end server.

Developer Guide 16 PUBLIC Understanding Application Development in FS-QUO Enterprise Services

Enterprise Services for Quotation and Underwriting are implemented using the standard SAP Enterprise Service framework:

● Operations and schemas are defined in the Enterprise Service Repository (ESR) system, which generates the WSDL. ● The WSDL is imported into NetWeaver Developer Studio in order to generate “skeleton” (service model and shell implementation) classes. ● The skeleton classes are imported into the Toolkit, where the FS-QUO-specific implementation logic is added. The implementation classes call FS-QUO Business Services. ● The Enterprise Service builds as an EJB module which is recognized and exposed as a web service by the NetWeaver enterprise service container (outside of FS-PQM).

eApps eApps work with Fiori applications:

● The eApp runtime engine has a clean separation between front-end and back-end. ○ The renderer is implemented in UI5 and is customizable. ○ The front-end makes requests to a back-end servlet using JSON (rather than OData). ○ The front-end eApp libraries convert the results to UI5 for display. ● The eApp is integrated into Fiori applications through standard UI5 “hooks”.

Refer to the Product Configurator User Guide for more information.

msg.PM Integration

The rating calculation portion of an FS-PRO product can be delegated to existing msg.PM products. This is possible due to the following:

● FS-PRO has an “IFBC Import” feature, which can import any existing IFBC templates (and related information) from FS-PM into FS-PRO. ● The published product from msg.PM (after conversion to a QAR file using the PMQ.Builder tool) is deployed in FS-PQM. ● msg.PM has provided a library with APIs for consuming QAR files in Java. ● A stem is provided in FS-QUO for calling the msg.PM library in a consistent way from the product.

J2EE Deployment

FS-QUO deployment more closely follows J2EE standards.

Developer Guide Understanding Application Development in FS-QUO PUBLIC 17 ● Java code isn't deployed in the directory and loaded through custom classloader. ● Quotation and Underwriting modules each build as its own WAR. ● The Java code for Quotation and Underwriting are separate JAR files deployed at the EAR level (and are thus accessible from all WARs).

Security

As of FS-PQM 3.0, UI5 eApp and OData for Quotation and Underwriting, authentication and user management are deferred to NetWeaver as opposed to Role Painter:

● User information such as User name, Role and Preferred Language are configured in any NetWeaver- compatible User Store (such as an ABAP server or LDAP). Such information is available to FS-PQM through the NetWeaver UME API (which is configured in NetWeaver to point to the User Store). ● The NetWeaver SecurityCheck filter is enabled on the new URLs. This triggers the NetWeaver login screen if the session isn't authenticated. ● Following this filter, a FS-PQM filter ClientSessionFilter is part of the filter chain. If this filter is reached, it is assumed that the session has been authenticated by NetWeaver. This filter populates the FS-PQM ClientSessionState object (needed for internal processing) by calling the UME API to get User information from the external User Store.

Any custom URLs added to Quotation or Underwriting must also have these filters applied.

Globalization

● A product in FS-PRO can contain value row data for a non-English language (only one language per product). ● Static UI5 content in Fiori apps supports multiple languages using the Language Pack capability of UI5. When a user logs in to the Fiori launchpad, they can specify a language other than English. If Language Pack content is available for that language, it is loaded by UI5.

Legacy

The remaining sections in this chapter are specific to the "legacy" (Sencha-based) runtime for FS-QUO.

2.5 References

Fiori documentation SAP Fiori

Developer Guide 18 PUBLIC Understanding Application Development in FS-QUO Enterprise Services and Enterprise Services Repository Refer to the SAP Help Portal page for FS-PRO 3.0. (ESR) extensibility

Globalization Refer to the Product Configurator User Guide.

2.6 Development Components

The FS-QUO application is developed using components that are exposed as Ext JS classes, Java classes, Product Configurator objects, and XML files.

The following FS-QUO components are located in Product Configurator:

● Underwriting Application ● Permissions Framework ● Validation Framework ● Search Framework

The following components require programming:

● User interface JavaScript classes ● Process configuration files ● Handlers and Handler Beans ● Business Services ● Product and Reference Services ● Visitor Patterns ● Policy Models

 Note

For more information about each component and how you can use it to extend FS-QUO, see the related topics.

Developer Guide Understanding Application Development in FS-QUO PUBLIC 19 2.7 Understanding How the Components Work Together

The following diagram shows an overview of the components and technology used to develop and extend FS- QUO:

The components work together in the following way:

● The Underwriting Application Configuration object contains the information used to configure the FS-QUO application. This object defines default roles and permissions, search behavior, validation, and business questions. ● The extended Underwritng Application Configuration object (typically named Extended Application Configuration) lets you define configuration settings that are specific to your FS-QUO application. The extended object inherits from the Underwriting Application Configuration object. ● The FS-QUO user interface is developed using Ext JS. ● The process configuration XML files in the flow layer define how FS-QUO runs, the flow of the application, and how the screens transition to one another. ● When a user performs an action on the user interface (for example, click search), a handler translates the data between the user interface and the business services. ● Business Services are methods that perform operations on policies (for example, create a new account or add a form). Business services aren't specific to products. ● Core services are the underlying layer for business services. ● Product Services are methods that perform operations on products (for example, return a list of coverages in a specific product). Business services can invoke Product Services to get product-specific data for a particular policy.

Developer Guide 20 PUBLIC Understanding Application Development in FS-QUO ● The Policy Model is an XML representation of the data for a specific policy transaction. The Policy Model lets you access data without querying the FS-QUO database tables and views. Business services can get policy information from the Policy Model. ● A product bean is an object that transfers the eApp data between the user interface and the product JAR file.

Developer Guide Understanding Application Development in FS-QUO PUBLIC 21 3 Working with the Development Toolkit

3.1 Understanding the FS-QUO Development Toolkit Contents

The development environment consists of all the required software and source code to help you extend FS- QUO functionality.

 Caution

Before you work with the FS-QUO source code, see the Source Code Terms and Conditions

The FS-QUO development toolkit is a ZIP file that contains the pre-configured FS-QUO Maven projects. These projects include the source code.

The following projects are provided in the toolkit:

ASLibrary The ASLibrary project is a Maven project which contains the core FS-QUO source code, unit tests and some build libraries. This project is built as a JAR file and assembled into the FS-QUO EAR lib folder.

ASModel The ASModel project is a Maven project that uses the Eclipse Modeling Framework (EMF) to define the Policy Model and metadata used by FS-QUO. These classes define both static and dynamic classes that are used to model insurance products and policy data in memory. This project is built as a JAR file and assembled into the FS-QUO-ear/lib directory.

ASTxnModel The ASTxnModel project is a Java project containing the EMF classes related to the Transaction flow defined in the Camilion Application Framework (CAF), which is an implementation of Spring Web Flow. The classes handle tracking where a transaction is in the flow, transitions between states and the status of the activities in the flow.

ASWebService The ASWebService project is a Java project containing the web services available from FS-QUO. These services allow CRUD operations on some of the Policy Model objects. These web services enabled development of our first portal offering, although they will likely become redundant with the OData services that are being developed

com.sap.fs.quo.domain.data The Domain Data Model for FS-QUO.

com.sap.fs.quo.service Business Services for FS-QUO.

fs.ipw.insquote.create The Create Insurance Quote app allows an insurance agent or underwriter to create a new insurance quote in FS-QUO and issue the quote, if accepted by an Underwriter, to FS-PM.

Developer Guide 22 PUBLIC Working with the Development Toolkit The project and code structure for this app follows SAP UI5 development standards and leverages the SAP UI5 scaffolding framework.

fs.ipw.mstrinspolicy.create The Create Master Insurance Quote FS-IPW application.

fs.ipw.mstrinsquote.create The Create Insurance Quote from Master FS-IPW application.

fs.ipw.myinsworklist The Insurance Work List app allows an insurance agent or underwriter to manage the insurance quote that they have created in a work list type of view. The project and code structure for this app follows SAP UI5 development standards and leverages the SAP UI5 scaffolding framework.

fs.ipw.myuwworklist The Underwriting Work List app allows insurance underwriters to manage underwriting cases based on insurance quotes and effectively make decisions on whether or not to accept or decline insurance quotes.

fs.ipw.grpinsquote.create The Create Group Insurance Quote FS-IPW application.

fs.ipw.myinstasks The My Insurance Tasks FS-IPW application.

FS-QUO-dev A module containing artifacts, such as a local , required to run FS- QUO in the integrated development environment.

FS-QUO-ear An enterprise application module that creates the Enterprise Archive (EAR) file for the FS-QUO application. Artifacts from this project aren't actually used directly, but instead used for packaging by the FS-QUO-sca module.

FS-QUO-install A module containing the content for FS-QUO and creating the package for deployment.

FS-QUO-IPW-wildfly-ear An enterprise application module running within the integrated FS-QUO development environment on WildFly.

FS-QUO-sca A module that creates the Software Component Archive (SCA) for the FS-QUO application which is deployed to NetWeaver AS Java.

InsurableObjectIntegration This module provides the client code to call FS-PM to access Insurable Object Enterprise Services.

IntegrationMessageSpec This module contains the generated XML objects from the AS Web Service WSDLs in ASLibrary.

IPWUILaunchPad A project allowing local testing of FS-IPW on WildFly, so that deployment to FLP isn't needed. Not packaged with the Tookit as built.

IPWWeb The web container for the FS-IPW back end.

MultiLevelRiskRenderer The MultiLevelRiskRenderer project contains the source code for the Multi-Level Risk Renderer for the legacy e-App.

QUOEnterpriseServices The QuoEnterpriseService project is an EJB project (JEE 5), which exposes FS-QUO back-end services and functionality through SAP Enterprise Services. This project is built as an EJB JAR module and is assembled into the FS- QUO.ear.

QUOLibrary The QuoODataWeb project is a dynamic web project, which exposes FS-QUO back-end functionality and services as OData services.

Developer Guide Working with the Development Toolkit PUBLIC 23 This project is built as a WAR module and assembled into the FS-QUO.ear with web context root, 'quo-odata'.

QUOODataLibrary The QuoODataWeb project is a dynamic web project, which exposes FS-QUO back-end functionality and services as OData services. This project is built as a WAR module and assembled into the FS-QUO.ear with web context root, 'quo-odata'.

UWCMSService This module contains the Content Management System functionality used by the Underwriter Worklist app. The default implementation uses SAP Mobile Documents for content management and Netweaver VSI for virus scanning of file attachments.

UWEnterpriseServices The UWEnterpriseService project is an EJB project (JEE 5), which exposes FS-QUO Underwriting back-end services and functionality through SAP Enterprise Services. This project is built as an EJB JAR module and is assembled into the FS- QUO.ear.

UWLibrary This project provides business and data access services specific to FS-QUO Underwriting. The business services contained within this module are primarily consumed by the OData processors in UWODataLibrary. This project builds as a JAR UWModel. This module provides the central location for UW bean definitions.

UWModel This module provides the central location for Underwriting bean definitions.

UWODataLibrary This project contains the Underwriting specific extensions and implementations of PQMODataLibrary. The OData processors defined within this library primarily consume the core FS-QUO and Underwriting business services contained within ASLibrary and UWLibrary, respectively.

3.2 Installing the FS-QUO Toolkit

This topic describes, at a high-level, the steps involved in installing the FS-QUO toolkit.

You need to perform the following steps in order to install the FS-QUO toolkit:

● Creating the FS-PRO Designer Runtime Database ● Installing and Configuring Eclipse ● Installing and Configuring WildFly ● Generating the Keystore and Enabling SSL in WildFly ● Installing and Configuring the FS-QUO Toolkit ● Copying and Deploying Insurance Product JAR Files from Product Configurator ● Configuring the FS-QUO Toolkit for FS-QUO ● (Optional) Installing and Configuring Standalone SAP JCo ● Validating the Complete FS-QUO Toolkit Installation

Developer Guide 24 PUBLIC Working with the Development Toolkit 3.2.1 Prerequisites for Installing the FS-QUO Toolkit

This topic details the software that is required before you can install the FS-QUO toolkit.

Before you install the toolkit, you will need to download and install the following software:

Java 8 The Java 8 Development kit is required for FS-PQM Development and to run Eclipse. Development Kit Either the SAP or Oracle implementation of Java may be used.

SAP JVM 8 for Windows on x64 64bit Download the software here .

Oracle Java Development Kit SE8 for Windows x86_64 Download the software here .

Eclipse Eclipse 2019-09 R IDE for Enterprise Java Developers Download the software here Windows x86_64 .

WildFly The WildFly application server is used to host the FS-QUO application on the local development system.

WildFly 22.0.0.Final Download the software here .

Apache Maven Apache Maven version 3.6.0 Download the software here .

JDBC driver SAP HANA 2.0 This file is necessary only if you are using an SAP HANA database. SPS04 JDBC Install the SAP HANA JDBC driver 2.4, ngdbc.jar. The JDBC driver driver will be located under \client\JDBC.TGZ. Download the driver here .

IBM DB2 11.5 This file is necessary only if you are using an IBM DB2 database. JDBC driver Install the IBM DB2 11.5 JDBC driver, db2jcc4.jar. Download the driver here .

Microsoft SQL This file is necessary only if you are using a Microsoft SQL Server Server 2019 JDBC database. driver Install the Microsoft JDBC driver 4.0 for SQL Server, mssql- jdbc-8.2.2.jre8, for SQL Server 2012 or SQL Server 2014. Download the driver here .

Oracle 19c JDBC This file is necessary only if you are using an Oracle database. driver Install the Oracle JDBC driver, ojdbc8.jar, that corresponds to your Oracle 19c version. Download the driver here .

Java Connector SAP Java Connector (JCo) Download the Windows 64-bit x86 software available in the 3.0 Cloud Connector area here .

Developer Guide Working with the Development Toolkit PUBLIC 25 3.2.2 Creating the FS-PRO Designer Runtime Database

Using the steps described in the Overview of the Installation Process for the FS-QUO Toolkit topic, the solution architect in the FS-QUO development team responsible for setting up the FS-QUO development infrastructure for the first time will create an FS-QUO development database to be shared by the development team.

 Note

Record the JDBC information including the JDBC URL and development database user credentials to configure the FS-QUO toolkit database connection.

3.2.3 Installing and Configuring Eclipse

You can install and configure Eclipse for use with the FS-QUO toolkit.

Procedure

1. Unzip the eclipse-jee-2019-09-R-win32-x86_64.zip package to a local directory, which will be referred to as in this guide. 2. In Windows Explorer, open Eclipse by browsing to and running eclipse.exe. 3. When prompted to select a workspace, either use the default path or provide a temporary path to open Eclipse. 4. If you are working behind a network proxy, configure Eclipse with the proxy server information as follows:

a. Select Window Preferences in the top menu bar. b. Expand the left menu tree to General Network Connections . c. Select the Manual proxy configuration option in the configuration pane and enter the HTTP proxy and SSL proxy details. If you don't have this information, contact your system or network administrator. d. Choose OK. Your changes are saved. 5. Install any other Eclipse features, such as for source control, as appropriate for your development environment.

Developer Guide 26 PUBLIC Working with the Development Toolkit 3.2.4 Installing WildFly and Creating a New Server Profile

You can install WildFly and create a new server profile based on the default profile.

Procedure

1. Unzip the wildfly-preview-22.0.0.Final.zip package to a local directory, which will be referred to as throughout this document. 2. Create a new directory with a name of your choice in \server.

If the /server directory doesn't exist, you will have to create it.

 Note

Don't use a directory containing spaces in its path.

The name of this new directory will be referred to as throughout this document. 3. Copy the contents of \standalone and paste into \server \.

3.2.5 Generating the Keystore and Enabling SSL in WildFly

You can create a default keystore for HTTPS use with WildFly and update the WildFly configuration.

Context

FS-QUO requires HTTPS to be enabled in WildFly, which in turn requires a keystore.

Procedure

1. Open a command prompt window. 2. If the SAP JVM 8 bin directory isn't defined in the PATH environment variable, use the cd command to change the directory to your JDK bin directory. 3. Run the following command and answer the questions in the console when prompted to generate a keystore and self-signed certificate: keytool -genkey -keyalg RSA -alias selfsigned - keystore \server\\configuration\keystore.jks -storepass -validity 9999 -keysize 2048 Where is a password of your choice to the default keystore.

Developer Guide Working with the Development Toolkit PUBLIC 27 4. Open \server\\configuration\standalone- full.xml with a text editor. 5. Add a new Security Realm by adding a new entry under:

[..] [...] [...] [...]

6. Find the following entry in the file: and change the security- realm value from ApplicationRealm to SSLRealm: 7. Save your changes. 8. Close the file in the text editor.

3.2.6 Installing and Configuring the FS-QUO Toolkit

After the initial Eclipse and WildFly setup is complete, you can set up the FS-QUO toolkit as an Eclipse workspace by following the instructions in this section.

3.2.6.1 Unzipping the FS-QUO Toolkit

The FS-QUO toolkit is provided in the form of an Eclipse workspace directory.

Unzip FS-QUO-toolkit-...zip to a local directory, referred to as .

 Note

Don't use a directory containing spaces in its path.

Developer Guide 28 PUBLIC Working with the Development Toolkit 3.2.6.2 Setting up a Development Profile

Context

To provide a consistent development environment to all developers, the FS-QUO toolkit introduces a concept called development profile. A development profile contains artifacts that are common across the development project, including the following items:

● JDBC driver and data source XML file ● WildFly data source XML file ● FS-QUO configuration files in ● Insurance product JAR files and flowlet group binaries in

Procedure

1. Create the new directories \FS-QUO-toolkit\FS-QUO-dev\src\profiles and \FS-QUO-toolkit\FS-QUO-dev\src\profiles\, where is the name of the development profile of your choice. 2. Create the following subdirectories: ○ home ○ server\deployments 3. Copy the relevant JDBC driver file for your DBMS that you downloaded as a prerequisite, to \FS-QUO-toolkit\FS-QUO-dev\src\profiles\\server \deployments. 4. Depending on the DBMS used, copy one of the following sample WildFly data source XML files in \FS-QUO-toolkit\FS-QUO-dev\src\samples to \FS-QUO- toolkit\FS-QUO-dev\src\profiles\\server\deployments and rename it to FS-QUO-ds.xml: ○ Oracle: sample-oracle-FS-QUO-ds.xml ○ Microsoft SQL Server: sample-mssql-FS-QUO-ds.xml ○ SAP HANA: sample-hana-FS-QUO-ds.xml ○ IBM DB2: sample-db2-FS-QUO-ds.xml 5. Open the new \FS-QUO-toolkit\FS-QUO-dev\src\profiles \\server\deploy\FS-QUO-ds.xml file with a text editor. 6. Replace the placeholder texts surrounded by ### signs with information specific to the FS-QUO Designer Runtime database which you created earlier in the XML file. 7. Save your changes. 8. Close the file in the text editor.

Developer Guide Working with the Development Toolkit PUBLIC 29 3.2.6.3 Initializing the FS-QUO Toolkit Workspace in Eclipse

Once the workspace is configured in the file system, initialize the workspace within Eclipse by importing projects and creating a WildFly server.

Prerequisites

● You have JDK 1.8 installed ● You have Apache Maven version 3.6.0 installed.

Procedure

1. Create a parent directory for the directory, which will be your Eclipse workspace location. 2. Open Eclipse and provide the parent directory created in the previous step as the workspace location when prompted. 3. Verify the JRE and compiler settings:

a. Choose Window Preferences from the menu bar. b. Select Java Installed JREs in the left menu tree. c. If you have multiple JDKs installed (for example, one 1.6 and one 1.8), Eclipse might select a non-1.8 JDK. In this case, add and select the 1.8 JDK as follows: ○ Choose Add… ○ Select Standard VM and choose Next. ○ Choose Directory… and browse to the 1.8 JDK installation directory. ○ Choose Finish. ○ Select the newly added 1.8 JDK to the list. d. Select Java Compiler in the left menu tree. e. Set Compiler compliance level to 1.8 if it's not already set. f. Choose OK. Your changes are saved. g. When prompted to rebuild the workspace, choose Yes. h. Choose Window Preferences from the menu bar. i. Select Java Installed JREs Execution Environments in the left menu tree. j. Under Execution Environments, select JavaSE-1.8 and check the 1.8 JDK that was previously added. k. Select Maven Installations in the menu tree. l. Ensure the apache-maven-3.6.0 installation is selected. m. Select Maven Java EE Integration in the menu tree. n. Under Select active Java EE configurators, deselect all three configurator options. o. Choose OK. Your changes are saved.

Developer Guide 30 PUBLIC Working with the Development Toolkit 4. Select Window Perspective Open Perspective Other… from the menu bar, then select Java EE to open the Java EE perspective. 5. Import the projects into the workspace as follows:

a. In the menu bar, select File Import… , then select Maven Existing Maven Projects into Workspace… and choose Next. b. Choose Browse… for the Select root directory field and select (which should be selected by default). c. Choose OK. d. Ensure that Select All has been chosen by default and choose Finish.

 Note

Immediately after import, the workspace will contain numerous build path errors. The next few steps will provision Maven dependencies properly and resolve these errors.

There are also errors in the following categories that will persist but can be ignored: ○ WSDL Problem ○ XML Schema Problem ○ XSL Problem

6. In the Project Explorer view, select FS-QUO-toolkit and choose Maven Update Project... from the popup menu. In the new dialog, choose OK, then wait for the workspace to be updated and built.

7. In the Project Explorer view, select FS-QUO-toolkit and choose Run As... Maven install from the popup menu. Maven will install binary artifacts from the FS-QUO-toolkit to your local Maven repository as part of the initialize phase, compiling, running unit tests, and installing artifacts on all projects. When the update is completed, ensure that there are no Java problems in the Markers view. 8. Initialize the directory and the development profile as follows:

a. In the Project Explorer view, select FS-QUO-dev and choose Run As... Maven build... from the popup menu. b. Enter compile in the Goals field. c. Add the following parameters:

wildfly.server.dir: /server/

profile:

d. Choose Run to run the Maven configuration. 9. Perform the following steps to generate an encryption key required by FS-QUO: a. Ensure system variable JAVA_HOME is set in your system properties to point to a Java directory. b. Open the following file with a text editor and change the properties according to the file comments to set a passphrase: \FS-QUO-toolkit\FS-QUO-dev\target\home\bin \genkey.properties The key will be generated by converting characters to a series of numbers in 0-255 range.

The passphrase can be of any length and contain any characters (including Unicode). The recommended size is at least 16 characters for a 128-bit key.

Developer Guide Working with the Development Toolkit PUBLIC 31 c. Run the toolkit_dir\FS-QUO-toolkit\FS-QUO-dev\target\home\bin\genkey.bat command and follow the displayed instructions to generate a key. The key.config file is generated in \FS-QUO-toolkit\FS-QUO-dev\target \home\system\config.

10. In the Project Explorer view, select FS-QUO-toolkit and choose Maven Update Project... from the popup menu. In the new dialog, choose OK, then wait for the workspace to be updated and built. At this point, all Java build path problems should be resolved. 11. If you don't already have a server defined, create one in the Servers view: a. Unpackage wildfly-preview-22.0.0.Final.zip. b. Go to the Servers perspective and choose New Server from the popup menu.

The New Server wizard opens. c. Look for WildFly 22.0 in the Server Type list. If it's not available, download the server adapter by performing the following steps:

○ Choose the Download additional server adapters link. ○ Once Eclipse loads the server adapters that are available for download, select JBoss AS, WildFly & EAP Server Tools and choose Next. ○ On the Review Licenses page, accept the license and choose Finish. ○ Choose OK on the restart prompt. ○ Wait for the software to be installed. When prompted with a security warning about unsigned content, choose OK to continue. ○ When you are prompted to restart Eclipse, choose Yes to restart and open the same workspace when prompted again. d. Select WildFly 22.0 and give it a Server name of your choosing. e. Choose Next. f. In the Create a new Server Adapter wizard page, choose Create new runtime from the dropdown and click Next. g. On the following page, enter the following: ○ In the Runtime JRE section, select the Alternate JRE radio button. ○ Ensure that JDK 1.8 is selected as the Alternate JRE. ○ For the server base directory, enter server/. ○ For the Configuration file name, enter standalone-full.xml. h. Choose Finish. i. On the Define a New Server wizard page, select WildFly 22.0 in the JBoss Community folder as the server type and choose Next. 12. Configure the server JVM system properties for and EMF as follows: a. In the Servers view, open the server in the server editor. b. Open the new server by double clicking it. c. Select the Timeouts tab and set the Start and Stop to 600. d. Select Open Launch Configuration. e. Under VM arguments, ensure that the following are included: -Xmx1024m – DCSI.home=/src/home.

If an -Xmx265m argument already exists, be sure to replace it with -Xmx1024m.

Developer Guide 32 PUBLIC Working with the Development Toolkit  Note

Ensure that forward slash is being used.

f. Go to the Deployment tab. g. Under Default Settings, ensure that Use the JBoss deploy folder is selected. h. Ensure that Deploy Directory is set to server\\deployments. i. Save your changes. 13. Choose OK. Your changes are saved. 14. Close the server editor. 15. Add the EAR module to the WildFly server for deployment. a. Select WildFly 22.0 in the Servers view and choose Add and Remove... from the popup menu. b. Select FS-QUO-IPW-wildfly-ear(FS-QUO) from the Available list and choose Add. c. Choose Finish. Your changes are saved. d. Select WildFly 22.0 again in the Servers view and choose Publish from the popup menu. 16. If they following tags aren't present in the /server// configuration/standalone-full.xml file, add them: a. To prevent a TimeoutException during WildFly server startup, include the following system property:

[…]

[…]

b. Register the JMS Queues used by FS-QUO:

[…]

[…]

c. Register the JMS Connection Factory used by FS-QUO: Change:

[…]

[…]

Developer Guide Working with the Development Toolkit PUBLIC 33

to

[…]

[…]

d. Register JNDI lookup bindings used by FS-QUO:

[…]

e. Enable remote access for WildFly by changing /server/ /configuration/standalone-full.xml from

[...]

to

[...]

17. Extract the resource-1.38.16.jar and utils-1.38.16.jar files from \server \\deployments\FS-QUO.ear\sapui5-sdk-dist-1.38.16.war\WEB- INF\lib and install them in \server\\deployments\FS- QUO.ear\lib.

Developer Guide 34 PUBLIC Working with the Development Toolkit 3.2.6.4 Validating Initial Configuration of the FS-QUO Toolkit

With the initial configuration completed, start the server and verify that the FS-QUO application is running.

Procedure

1. In the Servers view, select WildFly 22.0 at localhost and choose Start from the popup menu. 2. Wait for the server to start. When the start process is completed, check the Console view to ensure that the application starts without errors. 3. In Internet Explorer, go to the FS-QUO Administrative Console at http://localhost:8080/csiroot/ admin. 4. Log in using admin as the user name and password as the password. The application has started successfully if you can access the FS-PRO Administrative Console. 5. Choose Logout.

3.2.7 Copying and Deploying Insurance Product JAR Files from Product Configurator

Prerequisites

To avoid potential errors with some folders required for successful deployment, follow the steps defined in the Building Imported Flowlets with the BatchFlowBuildServlet Tool topic of the SAP Underwriting for Insurance Installation Guide prior to performing the next steps.

Context

The FS-QUO toolkit requires insurance products to be deployed to provide meaningful contents in runtime. Meanwhile, your organization should already have a Product Configurator instance set up and insurance products imported or developed.

Developer Guide Working with the Development Toolkit PUBLIC 35 Procedure

1. In Product Configurator, ensure that the products selected for deployment have been published. You will find the deployed insurance product JAR files in the /ps/product directory of the Product Configurator instance. 2. Copy the product JAR files from the above location to the system where the FS-QUO toolkit is set up. 3. Open Eclipse using the FS-QUO toolkit workspace, and start the server. 4. Open an Internet Explorer browser window and launch the FS-PRO Administrative Console at the following URL: http://localhost:8080/csiroot/admin. 5. Log in using admin as the user name and password as the password.

6. Select Product Deploy Products from the menu bar. 7. For each insurance product JAR file to be deployed, perform the following actions: a. Browse to the location of the JAR file. b. Select the file. c. Choose Upload. 8. Verify that the product JAR files are deployed and registered successfully by validating that the same set of insurance product JAR files now exist in \FS-QUO-toolkit\FS-QUO-dev\target \home\ps\product.

3.2.8 Configuring the FS-QUO Toolkit for FS-QUO

Context

At this point, the FS-QUO development environment is only set up as the runtime engine, but it doesn't yet have the complete setup necessary for underwriting. Follow the sub-topics listed below in the Configuring Designer/Runtime for Underwriting topic of the SAP Underwriting for Insurance Installation Guide to complete the FS-QUO setup.

If your product requires FS-PM and ERP-BP integration, refer to the Integration Guide for instructions to configure integration settings in the FS-QUO Administrative Console.

Note that the and placeholder variable used in the SAP Underwriting for Insurance Installation Guide refers to localhost and 8080, corresponding to your local FS-QUO development environment setup.

Procedure

1. Importing the flowlet groups in Designer

Developer Guide 36 PUBLIC Working with the Development Toolkit 2. Importing and deploying the scheme 3. Building imported flowlets with the BatchFlowBuildServlet tool 4. Updating configuration settings 5. Synchronizing product flowstores 6. Updating objects and loading data for underwriting in the Designer environment

 Caution

While updating the FS-QUO database, be sure to select the option to create test users. The test users will be used in later steps to validate the installation.

3.2.9 Installing and Configuring Standalone SAP JCo (Optional)

 Note

Installing and configuring SAP JCo is applicable only for FS-PM and ERP-BP integrations.

SAP JCo is required by FS-QUO to make RFC and APIF calls to FS-PM and ERP-BP in an integrated landscape. For an insurance product requiring integration, such as the Sample Household Product, you must install SAP JCo and make it available to the standalone server to write new business.

Previous versions of FS-QUO supported the use of JCo version 2.1. FS-IPW version 1.0 SP05 and FS-QUO version 3.0 SP03 and later require JCo version 3.0. It's highly recommended that you upgrade your use of JCo 2 to JCo 3, although it is still possible to continue using JCo 2 with some metadata and configuration changes.

You will need to perform the following tasks:

● Install SAP JCo ● Configure the JCo Standalone Settings in FS-QUO ● Test the RFC Destinations

3.2.9.1 Installing SAP JCo

Prerequisites

You must have authorization to download SAP software from the SAP web site.

Developer Guide Working with the Development Toolkit PUBLIC 37 Procedure

1. Go to ONE Support Launchpad. . 2. Choose Downloads from the dropdown list. 3. Enter SAP Java Connector in the search field. The search results will be displayed. 4. Download the 64bit x86 Windows and Windows Server version of the SAP JCo 3.0.14 zip file. 5. Unzip the downloaded file to a local directory and copy the sapjco3.jar and sapjco3.dll files to the \server\\lib directory.

3.2.9.2 Configuring JCo Standalone Settings in FS-QUO

Since RFC destinations can only be used on NetWeaver AS Java, the FS-QUO toolkit must use JCo in standalone mode to connect to integrated SAP systems.

Context

The configuration method for JCo 3 is also different for that of JCo 2 in earlier version of FS-QUO toolkits.

Procedure

1. Confirm the destination names for FS-PM and ERP-BP RFC connectivity that's defined in the RFC reference object in FS-PRO Product Configurator. They will be referred to as and respectively in the following steps. For more information, see Configuring RFC Destinations in Products in the Integration Guide.

2. Go to Configuration Destinations . 3. Copy \FS-QUO-toolkit\FS-QUO-dev\target\home\ppms\app\pa\custom\web \resource\rfcdestination\sample-pm-rfc.jcoDestination to the same directory and rename it to .jcoDestination. 4. Configure the file. a. Open \FS-QUO-toolkit\FS-QUO-dev\target\home\ppms\app\pa\custom \web\resource\rfcdestination\.jcoDestination in a text editor. b. Update the JCo client settings in the file with connection details for the FS-PM system. c. Save your changes. d. Close the text editor. 5. Repeat step 3 and step 4 for for ERP-BP JCo connectivity.

Developer Guide 38 PUBLIC Working with the Development Toolkit 6. Open the FS-QUO toolkit workspace in Eclipse and start the WildFly server. 7. In Internet Explorer, go to the FS-QUO Administrative Console at http://localhost:8080/csiroot/ admin. 8. Log in using admin as the user name and password as the password.

 Note

If you have the following entries: ○ FSPM_DEST_STANDALONE_PWD ○ BP_DEST_STANDALONE_PWD already configured within Configuration System Env RFC Standalone Credential then you don't need to proceed with steps 11 and 12 unless you are altering the existing names.

9. Choose System Edit Configuration Settings from the menu bar.

10. Select Configuration System from the configuration tree. 11. Add a new configuration variable for your FS-PM connection password entry. a. In the editor pane, select RFC Standalone Credential from the Configuration dropdown list. b. Choose the Add Config Variable button. c. Enter _STANDALONE_PWD in the Name field. d. Enter the password for in the Display Name field. e. Enter the password for in the Description field. f. Ensure that the Mandatory checkbox is unselected. g. Enter Encrypt Text in the Control field. h. Ensure that the Enumeration field is blank. i. Ensure that the Default field is blank. j. Save your changes. 12. Add a new configuration variable for your ERP-BP connection password entry. a. In the editor pane, select RFC Standalone Credential from the Configuration dropdown list. b. Choose the Add Config Variable button. c. Enter _STANDALONE_PWD in the Name field. d. Enter the password for in the Display Name field. e. Enter the password for in the Description field. f. Ensure that the Mandatory checkbox is unselected. g. Enter Encrypt Text in the Control field. h. Ensure that the Enumeration field is blank. i. Ensure that the Default field is blank. j. Save your changes.

13. Go to Configration System Env in the configuration tree and select RFC Standalone Credential. 14. Enter the password of the user for the RFC connection to the FS-PM system in the Override field of the _STANDALONE_PWD property and choose Save. 15. Enter the password of the user for the RFC connection to the ERP-BP system in the Override field of the _STANDALONE_PWD property and choose Save.

16. Select System Reload Configuration Setting from the menu bar and choose Reload All Config for the new password settings to take effect.

Developer Guide Working with the Development Toolkit PUBLIC 39 3.2.9.3 Testing RFC Destinations

You need to verify that the connectivity defined in the destinations is functional:

Procedure

1. Login to the Administrative Console.

2. Select System Test SAP Server Connectivity . 3. Select the Test JCo3 Feature tab. 4. Choose the destination and choose Connect to test the connection. A pop up message will indicate whether the connection is valid or invalid. 5. Repeat these steps for all destinations.

3.2.10 Validating the Complete FS-QUO Toolkit Installation (Fiori)

When the FS-QUO toolkit setup has been completed, you can validate the installation.

Context

This procedure applies SAP UI5 Fiori-based applications only. There is a separate topic for Sencha-based applications.

 Note

When working with FS-PM and ERP-BP, review the connection configurations. If these connections aren't configured properly, the Sencha-based UI flow will work but the SAP Ui5 Fiori app will fail.

Procedure

1. Open the FS-QUO toolkit workspace in Eclipse and start the WildFly server. 2. In Internet Explorer, go to the Fiori Launchpad login page at http://localhost:8080/ipw-launch- pad 3. Log in using uw2 as the user name and password as the password. 4. After successful login you should see the Fiori Launchpad which will display tiles representing the various Fiori applications available.

Developer Guide 40 PUBLIC Working with the Development Toolkit 3.2.11 Validating the Complete FS-QUO Toolkit Installation (Sencha)

When the FS-QUO toolkit setup has been completed, you can validate the installation.

Context

This procedure applied to Sencha-based applications only. There is a separate topic for SAP UI5 Fiori-based applications.

 Note

When working with FS-PM and ERP-BP, review the connection configurations. If these connections aren't configured properly, the Sencha-based UI flow will work but the SAP Ui5 Fiori app will fail.

Procedure

1. Open the FS-QUO toolkit workspace in Eclipse and start the WildFly server. 2. In Internet Explorer, go to the FS-QUO runtime application at http://localhost:8080/csiroot. 3. Log in using uw2 as the user name and password as the password. 4. Initially, the work list view should be empty. Complete a new business flow with the deployed product to ensure that it is successful.

3.2.12 Copying the Artifacts to the Development Profile

After the local FS-QUO toolkit set up is complete, you should update the development profile with the artifacts from the directory. Copy the following directories from \FS-QUO-toolkit\FS- QUO-dev\target\home to \FS-QUO-toolkit\FS-QUO-dev\src\profiles \\home:

● ppms\app\runtime ● ps\product

The FS-QUO toolkit is now completely set up for the first time. For team development, you should check into your source control system so it can be accessed by your development team. As you have already done most of the setup, each subsequent developer would only need to perform the following steps to set up their own FS-QUO development environment:

1. Installing and configuring Eclipse. 2. Installing and configuring WildFly.

Developer Guide Working with the Development Toolkit PUBLIC 41 Follow only the Installing WildFly and Creating a New Server Profile topic. 3. Installing and configuring the FS-QUO toolkit. For Unzipping the FS-QUO toolkit topic, replace the instruction with checking out the toolkit directory from source control. 4. Validating the complete FS-QUO toolkit installations

After that, the development team can verify the integrated SCM tools within Eclipse and link each project to your source control system for updates and commits.

3.2.13 Administrative Console Changes

Context

Since the toolkit uses the Windows environment, the UNIX classpath parameter must be changed to reflect the Windows environment in the Administrative Console.

Procedure

1. Log into the Administrative Console.

2. Navigate to System Configuration System Env System Environment . 3. Modify the classpath.

3.2.14 Debugging UI Changes

When developing and debugging UI changes, delete the Component-preload.jsfile. These files are generated based on the view XML files. If the Component-preload.js file isn't deleted, you will have to re- package and deploy every time the view code is changed.

Developer Guide 42 PUBLIC Working with the Development Toolkit 3.2.15 Building the Custom FS-QUO SCA and Package

Extensions and customizations made in the FS-QUO toolkit must be built and packaged so that they can be deployed to an FS-QUO runtime environment. There are generally two custom artifacts to be generated for deployment:

1. \FS-QUO-toolkit\FS-QUO-sca\target\FS-QUO-sca- ...sca 2. \FS-QUO-toolkit\FS-QUO-install\target\FS-QUO-install- ...zip

However, instead of generating artifacts for deployment manually from the FS-QUO-toolkit, you should implement a build process that does the following:

1. Check out the FS-QUO toolkit source code from your source control system. 2. Run Maven install on the FS-QUO-toolkit Maven reactor module to generate the build artifacts. 3. Archive the build artifacts to a central location, such as a Nexus repository or in the Jenkins project, for deployment.

3.2.15.1 Generating a Custom Build Number

Users can provide custom build information for the custom FS-QUO SCA and CSI Home package built from the FS-QUO toolkit. The custom build information, which includes version and build date for both the application and , is displayed in the Help About page in the FS-QUO Administrative Console.

By default, the custom version is set to the Maven POM version of the ASLibrary and FS-QUO-install modules, both of which are inherited from the FS-QUO-toolkit parent POM.

To provide your own custom version, simply provide the property quo.custom.version using the -D option when running the mvn command.

3.2.16 Updating the FS-QUO Toolkit

Prerequisites

● Before the update, you must review the documentation of the new SP or PL to determine if there are API and framework changes affecting your current customizations. It is very important to assess the impact and allocate sufficient time and resources to address these changes as part of the overall FS-PQM update plan. ● You must have the list of files in the FS-QUO toolkit which you have customized (added and changed). The code that was changed in modified files must also be marked with comments wherever possible, so that

Developer Guide Working with the Development Toolkit PUBLIC 43 customizations can easily be identified within the files. You can generally obtain this information by comparing your custom FS-QUO toolkit and the original FS-QUO toolkit from the FS-QUO assembly of the same version with a data comparison program. ● FS-PRO is already updated with the new SP or PL source code and insurance product bootstraps, so that the product JAR files can be deployed and tested in the FS-QUO toolkit after the update.

Context

If you have FS-QUO customizations, when updating FS-QUO with new support packages (SP) and patch levels (PL), you must first update the FS-QUO toolkit so that you can locally verify the update and be able to generate the custom SCA and CSI Home packages before deploying to FS-QUO runtime environments.

Procedure

1. Update your FS-QUO toolkit Eclipse workspace with the latest code from your source control system. 2. Obtain the new FS-QUO toolkit package from the FS-QUO assembly and unzip it to a local directory. 3. Port all customizations from the custom FS-QUO toolkit to the new FS-QUO toolkit using the general rules below. For productivity, you can use a data comparison program to visualize the changes for porting. ○ Copy all new files and modules to the new FS-QUO toolkit. ○ For files that have been customized, compare each file and port the changes to the file in the new FS- QUO toolkit as appropriate. ○ For trivial changes, simply copy the custom code. ○ For non-trivial changes due to significant changes to the file or change of API and framework in the new SP or PL, manually complete the merge within Eclipse (see below). 4. Replace the FS-QUO-toolkit project in the FS-QUO toolkit Eclipse workspace with the FS-QUO-toolkit project from the new FS-QUO toolkit directory which now has the customizations merged. 5. Open the updated FS-QUO toolkit Eclipse workspace in Eclipse. 6. If there are remaining customizations that couldn't be merged in earlier steps because they are non-trivial, complete the merge within Eclipse by doing more analysis and adapting the code. 7. Run Maven install to ensure that newly merged code builds successfully. 8. Run Maven compile on the FS-QUO-dev module to update the local directory in FS-QUO-dev \target\home. 9. Follow the topics below in the SAP Underwriting for Insurance Support Package Upgrade Guide to update the database, flowlet groups, and insurance products: ○ Migrating the Database ○ Making Updates in the Administrative Console ○ Updating Process Flowstores ○ Rebuilding Flowlets with the BatchFlowBuildServlet Tool ○ Synchronizing Product Flowstores ○ Updating Database Objects for Underwriting ○ Configuring the HttpOnly Flag

Developer Guide 44 PUBLIC Working with the Development Toolkit 10. Publish the FS-QUO-IPW-wildfly-ear file and start the toolkit, then perform some sanity tests to locally verify that the upgrade has been done successfully. 11. If necessary, update the development profile in FS-QUO-dev/src/profiles with any changes such as Administrative Console settings resulting from the upgrade. 12. Check the updated FS-QUO toolkit source code into source control.

Results

With the FS-QUO toolkit updated, you can now create the custom FS-QUO SCA and CSI Home package for updating the FS-QUO runtime environment. For details, follow the SAP Underwriting for Insurance Support Package Upgrade Guide.

Related Information

PTTO Removal [page 384]

3.3 Additional Software Management Tools

Optionally, you can set up automated build and verification testing processes to manage your FS-QUO extension changes. For example, you can install the following tools on a server to manage source control and builds:

● Subversion ● TortoiseSVN ● Jenkins

When you build the code, you compile and package your extension changes out of Subversion (or any other version control software that you are using). This helps you deploy the data for integration testing with product changes and maintain continuous integration.

To track the extension changes, you can also use a change management process.

 Note

For more information about best practices, contact SAP support.

Developer Guide Working with the Development Toolkit PUBLIC 45 3.4 Changing Default Error Report Settings

The error report on the Exception screen contains a summarized description of the errors. If you want to view more details, you must override the default flag in local environments by changing the flag from Yes to No.

You can find the flag, SuppressErrorinAS in the following location: Application SAP Product Lifecycle Management for Insurance Env Application Environment .

Developer Guide 46 PUBLIC Working with the Development Toolkit 4 Extensibility Best Practices

4.1 Understanding Extensibility

Extensibility generally refers to the ability to customize an SAP system in a supported way.

Because release 3.0 of FS-PQM has introduced a number of new concepts to the architecture (such as Fiori applications, Enterprise Services, and UI5 eApps), it is best to think of FS-QUO extensibility as being composed of two parts:

Extensibility for This refers to implementations/frameworks that existed in FS-QUO prior to this release, legacy areas of the such as Sencha (Ext-JS), Spring MVC, Spring Web Flow, EMF Policy Model, Spring-based system. business services, and Spring-based integration framework. There is no change to the extensibility of these areas.

Extensibility for This refers to implementations/frameworks that didn't exist in FS-QUO prior to this areas that are new release, such Fiori launchpad, UI5, OData, and Enterprise Services. in 3.0. Because these new areas largely follow standard SAP design practices, there is less of a need to distinguish between extension and customization. Any configurability for a feature will be described as part of that feature's documentation (as opposed to being covered under "Extensibility"). The Toolkit continues to include all source code for the FS-QUO implementation, available for the customer to analyze or customize. During an upgrade of FS-QUO, the customer is responsible for reapplying any customizations. Depending on the invasiveness of the customization, this may involve re- work for the customization. The recommended best practice is to minimize customizations in the FS-QUO code itself, and to keep the majority of custom logic separate (such as in a separate Toolkit project) in order to reduce the effort of reapplying customizations during upgrade.

The following topics in this section describe each part in more detail.

It should be noted that, as with any SAP system, customers should seek guidance from SAP before making a significant customization to FS-QUO. This is to ensure that the customization is in line with the architecture of the system and will continue to be supported in future releases.

Developer Guide Extensibility Best Practices PUBLIC 47 4.2 Extensibility Best Practices (Version 3.0 and Later)

4.2.1 Understanding Design Time

The following diagram shows the various systems and roles involved during Design Time for FS-PQM. Any customizations are made in this environment.

4.2.2 Customization Site Map

The following diagram outlines what types of customizations are possible and the steps involved. The next section contains extensibility scenarios that provide examples for making each of these types of customization.

Developer Guide 48 PUBLIC Extensibility Best Practices 4.2.3 Extensibility Scenarios by Area

Before you begin, you must have a successfully installed FS-QUO Toolkit in order to perform these scenarios. These scenarios should work both locally in WildFly as well as on NetWeaver.

4.2.3.1 Example: Modifying the General Information Screen in the FS-QUO Fiori App

This topic details a sample scenario to demonstrate FS-QUO extensibility.

Context

The purpose of this example is to add a new field, Producer License, to the General Information screen. This field will trigger a message when its value changes. Its value will be populated from the back-end.

Developer Guide Extensibility Best Practices PUBLIC 49 Procedure

1. In the QUOUINewBusiness project, open the GeneraInfo.view.xml file. 2. Find the input element with the id value inputTextforProducerCode. After that element, add the following text:

3. Open the GeneraInfo.controller.js file.

 Note

This Controller declares it’s binding to the above View

4. Above the function handleDateChange, add the following text:

handleProducerLicenseChange: function(oEvent) { sap.m.MessageBox.show("Producer License is set to: " + oEvent.getSource().getValue() ,{ icon: sap.m.MessageBox.Icon.WARNING, title: this.oBundle.getText("WARNING" ) , actions: [fs.ipw.insquote.create.util.Formatter.i18nFormatter("BTN_OK")] } ) ; },

5. In the QUOODataLibrary project, open class com.sap.fs.quo.odata.model.Producer and create a new field under producerName, as follows:

@EdmProperty protected String producerLicense;

6. Add getter and setter methods for this new field and update methods equals() and hashCode() to include this new field.

 Note

This can be done automatically in Eclipse by going to Source Generate hashCode() and equals() .

7. Open class com.sap.fs.quo.odata.model.mapper.ProducerMapper and modify method mapModelToEntity(2 args) – under the line containing producer.getAgencyName(), add the following line: mappedEntity.setProducerLicense("XYZ"); 8. Build the toolkit. 9. Test the change in runtime: a. Start a new quote. b. Search for and select a Producer. c. The Producer Details should be populated on the General Information screen.

Developer Guide 50 PUBLIC Extensibility Best Practices d. Check that the new Producer License field appears as part of the Producer Details. e. Check that an alert appeared, due to the fact that the Producer License field value changed when the Producer was selected.

4.2.3.2 Example: Modifying the UW Case Screen in the UW Fiori App

This topic details a sample scenario to demonstrate FS-QUO extensibility.

Procedure

1. Create a new template: a. Create the viewer and controller for your new template under the path ./view/pool/common. In this case create a new template which called SAPMAP.

 Note

If you use controls included in a special library, you should specify the library in component.js.

b. If you create a common template, define the validation rule for its own data binding. 2. Create a new block: a. Create the viewer and controller for your block.

 Note

This code was copied from violation.controller.js and modified.

b. Specify the templates in the block. c. Specify the data binding for the templates in the block. 3. Configure the block into a section: a. Add the block as a child node under the sections list.

 Note

If you use a router, configure the new section into your routers.

b. Your new module displays in the detail information page.

Developer Guide Extensibility Best Practices PUBLIC 51 4.2.3.3 Example: Using Property Valuations in the Enterprise Service

This topic details a sample scenario to demonstrate FS-QUO extensibility.

Context

The purpose of this example is to pass a custom value as a Property Valuation to the Create Quote enterprise service. The value will be stored in the database, and also returned in subsequent Retrieve Quote enterprise service calls.

Procedure

1. Update the interface-to-data field mapping in Product Configurator. Create a new product named Test ES Customization Global Reference Object based on product SAP Global Reference Object. 2. In this new product, go to component Business Object Mapping and expand the value row with Business Object Name = PropertyAndCasualtyInsuranceContract. 3. In the child component Business Object Attribute Mapping, add a new value row as follows:

Business Object Attribute Name = "PropertyValuation.TestCustomAttribute" Column Name = "SUBJECT"

 Note

The table ABDAPOLPR is implied.

4. In the Extended Underwriting Application Configuration product, go to the Configuration/ Config component and change the value row with Key = "BusinessObjectMappingReferenceObjectName" to have Value = "Test ES Customization Global Reference Object". 5. Test the enterprise server change by locating the WSDL URL for the Quotation Enterprise Service on your FS-QUO server. It should be: http://;/ InsuranceQuoteProcessingManageInsuranceQuoteIn_Service/ InsuranceQuoteProcessingManageInsuranceQuoteInImplBean?wsdl 6. In the web service test client, open the WSDL URL shown in the previous step and create a request for operation CreateInsuranceQuote, pasting in the sample request XML but don't send send the request. 7. Inside the PropertyAndCasualtyInsuranceContract element of the request, add the following element:

TestCustomAttribute HelloTesting123

Developer Guide 52 PUBLIC Extensibility Best Practices 8. Send the request. In the response, note the Quote ID contained in the InsuranceQuote/ID element. 9. Create a request for the RetrieveInsuranceQuote operation, setting the above Quote ID in InsuranceQuote/ID element. 10. Send the request. In the response, check that the PropertyValuation snippet from the previous step appears inside the PropertyAndCasualtyInsuranceContract element. 11. Query the database with the following statement:

select ABDAPOLPR.SUBJECT from POLICY_QUOTE, ABDAPOLICY, ABDAPOLPR

where POLICY_QUOTE.PK_ID =

and ABDAPOLICY.PARENT_ID = POLICY_QUOTE.PK_ID and ABDAPOLPR.PARENT_ID = ABDAPOLICY.PK_ID

There should be only one row.

4.2.3.4 Example: Adding a Custom Entry to the Schema

This topic details a sample scenario to demonstrate FS-QUO extensibility.

Context

The purpose of this example is to pass a custom value as part of a custom entity. The value will be stored in the database, and also returned in subsequent Retrieve Quote enterprise service calls.

Procedure

1. Change the Service Implementation to pick up the new field by creating a custom java project named QUOEnterpriseServicesImpl_. 2. Update project dependencies so that the QUOEnterpriseServices project depends on this new project. 3. In this new project, create a class named com.customer.quo.es.CreateQuoteServiceImpl containing one method as follows:

public static void customStep ( InsurQteFSCrteReqInsurQte insuranceQuote, UpdateableResultSet abdaPolicyUrs ) { String customValue = insuranceQuote.getCurrencyCode(); abdaPolicyUrs.setString ( "SUBJECT", customValue + "_Testing" ); }

4. In the QUOEnterpriseServices project, open the InsuranceQuoteCreateServiceImpl class. At the bottom of the createInsuranceQuote method (before the return statement), add the following line:

Developer Guide Extensibility Best Practices PUBLIC 53 com.customer.quo.es.CreateQuoteServiceImpl.customStep ( insuranceQuoteRequest, abdaPolicyUrs );

 Note

insuranceQuoteRequest is the variable name for the InsuranceQuote object.

5. Build the toolkit and test the enterprise service change. Locate the WSDL URL for the Quotation Enterprise Service on your FS-QUO server. It should be: http://:/ InsuranceQuoteProcessingManageInsuranceQuoteIn_Service/ InsuranceQuoteProcessingManageInsuranceQuoteInImplBean?wsdl 6. In the web service test client, open the WSDL URL from the previous step and create a request for the CreateInsuranceQuote operation, pasting in the sample request XML. Don't send the request yet. 7. In the response, note the Quote ID contained in the InsuranceQuote/ID element. 8. Query the database with the following statement:

select ABDAPOLICY.SUBJECT from POLICY_QUOTE, ABDAPOLICY

where POLICY_QUOTE.PK_ID =

and ABDAPOLICY.PARENT_ID = POLICY_QUOTE.PK_ID

There should be only one result row.

4.2.3.5 Example: Creating a Custom eApp Renderer

This topic details a sample scenario to demonstrate FS-QUO extensibility.

Procedure

1. In the FS-QUO-install project (CSI_HOME contents), create a folder named /src/main/resources/ ppms/app/as/custom/web/eapp/renderer/myCustomRenderer1. 2. Open the camilionweb.war archive and copy the contents of the /resources/eapp/ui5/renderer/ splitApp folder and paste them into the folder you created in the previous step. 3. Open the …/myCustomRenderer1/view/Detail.view.xml file. Add the following text in the file; place the new text before the Button element with the id = dtlSave, :