Slice mode and window mode overview

There are two ways to access a branch’s subobjects: slice mode and window mode.

In most cases, a job changes its policy data effective as of a specific date in effective time. This date is stored on a PolicyPeriod as the EditEffectiveDate. Most changes for a job (and sometimes all changes for that job) will happen in effective time as of that date. Because this is the typical way to edit a PolicyPeriod and its subobjects, PolicyCenter includes a special way to view the branch as of that effective date. PolicyCenter can hide subobjects that are not effective at the desired date. This way to view the branch is called slice mode, and is the most common way PolicyCenter accesses policy data. Most edits are made at this date, called the slice date.

When working with a PolicyPeriod, the PolicyPeriod is typically already in slice mode. For example, if you access a PolicyPeriod as a reference for a job, the PolicyCenter job has probably set the slice date to the job’s effective date. This is true for almost all code that you will work with. You typically do not need to do anything special to setup the PolicyPeriod slice date if you want to work with the branch at the effective date. Simply access the properties on objects referenced from the PolicyPeriod in a job and work with it as a graph of objects. The slice date does not persist. PolicyCenter stores this only on the in-memory PolicyPeriod entity instance accessed by Gosu. PolicyCenter never stores this in the database row with the PolicyPeriod.

Note: The slice date (and more generally, the slice mode or window mode status) is stored on each in-memory copy of effective dated entities. This information is not persistent in the database row.

In contrast, sometimes you must view all versions of an object across all dates in effective time. This view is called window mode. For example, suppose a policy covered one car on an annual policy that starts at the beginning of the year. On March 1, the insured buys a new car and adds it to the policy. On March 10, she sells the old car and removes it from the policy.

  • In slice mode viewed as of February 15, the policy contains only the first car.
  • In slice mode viewed as of March 5, the policy contains two cars.
  • In slice mode viewed as of April 1, the policy contains only the newer car.
Note: When you view a policy in slice mode at any given effective date, you might not see all cars that exist at some point in that policy period.

Instead, suppose you want to display a page that lists all cars that exist on the policy for any amount of time. For each car, you want to list the effective date ranges for each car. To do this effectively:

  1. Get a list of all cars that were ever on the policy. There is one entry for each car, regardless of whether it changed over effective time.
  2. For each car, iterate across all changes to that particular car across effective time. There is exactly one row in the database for each version of that car. For example, if the car has had three different colors, there are three rows in the database that represent that car. The set of three rows that represent this one car is called a version list. From the version list, you can access every version of the car in the period. In this case, the version list contains three versions of the car, each with a different color.

When you request all cars on the policy in slice mode, PolicyCenter automatically gets the correct version of each car as of the slice date. Also, PolicyCenter only returns the cars that are effective at the slice date.

In contrast, you ask for all the cars on the policy in window mode, there is no implicit slice date. PolicyCenter gets a version list for each car.

For more details about window mode, see, Window mode API overview.

Exposures in general liability and workers’ compensation and getSlice

In the base configuration of general liability and workers’ compensation, exposures appear in the user interface in window mode because of the special way that they are rated. The line-specific implementation, including rating and sample code, handle these exposures in window mode. If you get exposures on a policy period in slice mode, all exposures on the policy period are returned regardless of effective date.

You can use the following methods in the sample code as a model for how to handle these exposures in window mode. These methods do not use the generic getSlice method to get the exposures. For sample code, see:
General liability
GLExposuresWM and AllGLExposuresWM methods in GeneralLiabilityLineEnhancement
Workers’ compensation
AllWCExposuresWM method in WorkersCompLineEnhancement

If you use the generic getSlice method on a PolicyPeriod or other object to access general liability and workers’ compensation exposures, you only get the exposures effective in the current slice, not all exposures in window mode. There are times where getSlice is appropriate, such as if you need to create a split in the exposure.

Avoid getSlice for viewing data on general liability and workers’ compensation exposures. For editing, you need to know what your intent is. You can use getSlice if you are getting a slice and making a split. Avoid getSlice for editing exposures in window mode.