Hi guys need some help with this issue, i have one formula string (PerilRateP001_0+PerilRateP002_1+PerilRateP003_2+PerilRateP004_3)*SumInsured*1*(0.01) and also i have given json
scope {
BasicRate: '0.0512',
PerilRate: [ { 'Perils Code': 'AIRCRAFT DAMAGE', 'Basis Indicator': 'P' } ],
ClauseRate: [
{
ClauseCode: 'SMOKE DAMAGE',
'Basis Indicator': 'P',
ApplyTo: 'F&L'
}
],
'Questionnaire 1': [ { QuestLoading1: 'Yes' } ],
SumInsured: '100000',
ClauseFactorRate: '0.002925',
PerilRateP001_0: '0.0060',
ClauseRateC022_0: '10.0000',
Loading: '10',
productId: 'FNL0001',
BasicPremium1: 51.2
}
now what i want to do is i want to substitute value of variables in formula string from given json.the json does not have all the variables present in the formula string so what i want to do is if the variable is associated with + or - sign substitute it with 0 and if the variable is associated with * or / sign then substitute it with 1. Any idea how can i achieve it. Have been struggling with it from 2 days and still unable to figure out the solution any help is greatly appreciated