When an Automatic Rewrite is triggered from Billing center, when and where does the term number gets updated for the rewrite transaction in code level

When I checked in PC code, I did not find any explicit code where we are incrementing the term number

1

There are 1 best solutions below

6
Abhijay Kumar On

You will not be able to see this code in Gosu classes or enhancements since the logic to increment TermNumber on Renewal or Rewrite is obfuscated in Guiderwire's internal methods and jars. My best guess would be that it happens in the function generated/entity/PolicyPeriod#updateTermNumber(). The documentation and description of the TermNumber column suggest that the initial value for this column is 1 and keeps getting incremented by 1 at a renewal or rewrite.

While you can override or customize this behavior by blocking this method call and replacing it with your own implementation, attempting to do so will give rise to a plethora of issues. In case you want to customize or configure the way TermNumber behaves, the safest way would be to create another column TermNumber_Ext which is managed by you and can easily map to the out of the box TermNumber. For example, if the carrier requires the term number to start from 001 instead of 1, you can make the Ext field a String and be responsible for setting it's value at all the right places in JobProcess and its subclasses. This approach may not be as easy as it sounds, but avoids conflicts with platform level code and keeps your customer logic isolated.