package gw.api.history uses gw.api.util.LocaleUtil uses java.util.Date uses java.util.concurrent.Callable class PolicyCustomHistoryImpl extends AbstractCustomHistoryImpl { var policy : Policy construct(owner : Policy) { super() policy = owner } override function createCustomHistoryEvent(type : CustomHistoryType, description : Callable) : History { var history = new History(policy) history.Account = policy.Account history.Policy = policy history.User = User.util.CurrentUser history.EventTimestamp = Date.CurrentDate history.Type = HistoryType.TC_CUSTOM history.CustomType = type if (description != null) { LocaleUtil.runAsCurrentLanguage(LocaleUtil.toLanguage(policy.PrimaryLanguage), \ -> { history.Description = description.call() }) } return history } }