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
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 theTermNumbercolumn 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
TermNumberbehaves, the safest way would be to create another columnTermNumber_Extwhich is managed by you and can easily map to the out of the boxTermNumber. For example, if the carrier requires the term number to start from001instead of 1, you can make the Ext field aStringand be responsible for setting it's value at all the right places inJobProcessand 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.