i am trying to save some details in policy center. i am getting those details from billing center and immediately trying to save it but it is giving me exception.
i have called "issuePolicyPeriod" function of billingAPI and returned some values and i need to save this in Policy center.
Exception: Exception came while saving commision detais: java.lang.RuntimeException: com.guidewire.pl.system.exception.TransactionException: commitBundle must not be called in a transaction.
Code /** * Issue a policy period in Billing Center * @param period: the policy period * @param transactionID: the unique transaction id to make this call idempotent */
override function createPolicyPeriod(period: PolicyPeriod, transactionID : String) : String { var issuePolicyInfo = new IssuePolicyInfo() issuePolicyInfo.sync(period) PCLoggerCategory.BILLING_SYSTEM_PLUGIN.info("Sending policy ${period} to Billing System")
var commissionList = callUpdate(\ b -> b.issuePolicyPeriod(issuePolicyInfo, transactionID))
gw.transaction.Transaction.runWithNewBundle(\ bundle -> {
var commission = new CommissionDetails()
bundle.add(commission)
commission.Commission_SI = new BigDecimal( commissionList.get(1))
commission.CommissionGST_SI = new BigDecimal(commissionList.get(2))
commission.CommissionRate_SI = commissionList.get(3).toString()
})
return commissionList.get(0)
}
I am calling issuePolicyPeriod() function from PC using BillingAPI and returning commission details from BC and trying to save it in PC entity immediately.
Hi, thank you for your answer. I tried the above code but it is not saving to entity and nor giving any exception. I have a doubt here will current bundle still available? because here we are calling billing center and don't know when BC responds. in web service calls will guidewire hold the current bundle until response comes back? When guidewire commits the current bundle in web service calls?