Morning Mark,
That was a useful exercise!!, from a sampled set it looks like the RightTuple instances are coming from a single rule package (nccf).
This rule package comes from a large decision table of that is maintained by our business users. This results in a large DRL file being generated containing 2371 rules.
Below I have included some of the rules that were referenced in the data structures, I have also attached the generated DRL file.
The exact same file processes in Drools 5 but fails in Drools 6.
31usd_lng_corp_bnd_cr_bbb_usd_over0y_under5y_2
// rule values at A650, header at A644
rule "31usd_lng_corp_bnd_cr_bbb_usd_over0y_under5y_2"
salience 64886
when
p: Position(positionDetail!=null && positionDetail.valuation != null && positionDetail.valuation.mtmValue >=0)
Position(positionDetail.productHierarchy != null && positionDetail.productHierarchy.rbcProductClass == "securities")
Position(positionDetail.instrument != null && positionDetail.instrument.maturityDate >=positionDetail.riskBusinessDate)
Position(positionDetail.instrument != null && positionDetail.instrument.maturityDate <positionDetail.riskBusinessDate+157680000000)
Position(positionDetail.Valuation!= null && positionDetail. Valuation.ValuationCurrency == "USD")
Position(positionDetail.instrument != null && positionDetail.instrument.marketSectorDescription == "corp")
Position(positionDetail.instrument != null && positionDetail.instrument.typeOfBond != null && positionDetail.instrument.typeOfBond not in ('convertible','covered' ,'jumbo pfandbriefe'))
Position(positionDetail.overallCreditQualityStep == 2)
Position(positionDetail.valuationType in ('Valuation','Both'))
Position(positionDetail.riskProductType == 'UNKNOWN')
then
result.add(classification=new ActionParametersImpl('BaselineClassification'));
classification.setBaseline('NCCF');
classification.setLineId("NCCF0100579");
classification.setObject(p);
classification.setPositionId(p.getPositionId());
classification.setDataStatus(p.getDataStatus());
classification.setCountry(p.getPositionDetail().getBook().getTransit().getLegalEntityCountry());
classification.setRulePath(ruleHistory.getActivationPath());
classification.add(a=new ActionParametersImpl( 'BaselineValue'));
a.setValueName( 'Balance');
a.setValue( p.getPositionDetail().getValuation().getMtmValue());
a.setCurrency( p.getPositionDetail().getValuation().getValuationCurrency());
a.setNettingType('Security');
a.setAdjustmentType('Fungible Long covers Fungible Short,Fungible Short covers Fungible Long');
a.setBucket('Total');
classification.add(a=new ActionParametersImpl( 'BaselineTimeBucket'));
a.setBaselineType( 'MB');
a.setValue(p.getPositionDetail().getValuation().getMtmValue());
a.setCurrency(p.getPositionDetail().getValuation().getValuationCurrency());
a.setNettingType('Security');
a.setAdjustmentType('Fungible Long covers Fungible Short,Fungible Short covers Fungible Long');
a.setBucket('Total');
end
31usd_lng_corp_bnd_cr_bbb_usd_over0y_under10y_2
// rule values at A652, header at A644
rule "31usd_lng_corp_bnd_cr_bbb_usd_over5y_under10y_2"
salience 64884
when
p: Position(positionDetail!=null && positionDetail.valuation != null && positionDetail.valuation.mtmValue >=0)
Position(positionDetail.productHierarchy != null && positionDetail.productHierarchy.rbcProductClass == "securities")
Position(positionDetail.instrument != null && positionDetail.instrument.maturityDate >=positionDetail.riskBusinessDate+157680000000)
Position(positionDetail.instrument != null && positionDetail.instrument.maturityDate <positionDetail.riskBusinessDate+315360000000)
Position(positionDetail.Valuation!= null && positionDetail. Valuation.ValuationCurrency == "USD")
Position(positionDetail.instrument != null && positionDetail.instrument.marketSectorDescription == "corp")
Position(positionDetail.instrument != null && positionDetail.instrument.typeOfBond != null && positionDetail.instrument.typeOfBond not in ('convertible','covered' ,'jumbo pfandbriefe'))
Position(positionDetail.overallCreditQualityStep == 2)
Position(positionDetail.valuationType in ('Valuation','Both'))
Position(positionDetail.riskProductType == 'UNKNOWN')
then
result.add(classification=new ActionParametersImpl('BaselineClassification'));
classification.setBaseline('NCCF');
classification.setLineId("NCCF0100581");
classification.setObject(p);
classification.setPositionId(p.getPositionId());
classification.setDataStatus(p.getDataStatus());
classification.setCountry(p.getPositionDetail().getBook().getTransit().getLegalEntityCountry());
classification.setRulePath(ruleHistory.getActivationPath());
classification.add(a=new ActionParametersImpl( 'BaselineValue'));
a.setValueName( 'Balance');
a.setValue( p.getPositionDetail().getValuation().getMtmValue());
a.setCurrency( p.getPositionDetail().getValuation().getValuationCurrency());
a.setNettingType('Security');
a.setAdjustmentType('Fungible Long covers Fungible Short,Fungible Short covers Fungible Long');
a.setBucket('Total');
classification.add(a=new ActionParametersImpl( 'BaselineTimeBucket'));
a.setBaselineType( 'MB');
a.setValue(p.getPositionDetail().getValuation().getMtmValue());
a.setCurrency(p.getPositionDetail().getValuation().getValuationCurrency());
a.setNettingType('Security');
a.setAdjustmentType('Fungible Long covers Fungible Short,Fungible Short covers Fungible Long');
a.setBucket('Total');
end
31usd_lng_corp_bnd_cr_bbb_usd_over5y_under10y_1
// rule values at A651, header at A644
rule "31usd_lng_corp_bnd_cr_bbb_usd_over5y_under10y_1"
salience 64885
when
p: Position(positionDetail!=null && positionDetail.valuation != null && positionDetail.valuation.mtmValue >=0)
Position(positionDetail.productHierarchy != null && positionDetail.productHierarchy.rbcProductClass == "securities")
Position(positionDetail.instrument != null && positionDetail.instrument.maturityDate >=positionDetail.riskBusinessDate+157680000000)
Position(positionDetail.instrument != null && positionDetail.instrument.maturityDate <positionDetail.riskBusinessDate+315360000000)
Position(positionDetail.Valuation!= null && positionDetail. Valuation.ValuationCurrency == "USD")
Position(positionDetail.instrument != null && positionDetail.instrument.marketSectorDescription == "corp")
Position(positionDetail.instrument != null && positionDetail.instrument.typeOfBond != null && positionDetail.instrument.typeOfBond not in ('convertible','covered' ,'jumbo pfandbriefe'))
Position(positionDetail.overallCreditQualityStep == 2)
Position(positionDetail.valuationType in ('Valuation','Both'))
Position(positionDetail.riskProductType != 'UNKNOWN')
then
result.add(classification=new ActionParametersImpl('BaselineClassification'));
classification.setBaseline('NCCF');
classification.setLineId("NCCF0100581");
classification.setObject(p);
classification.setPositionId(p.getPositionId());
classification.setDataStatus(p.getDataStatus());
classification.setCountry(p.getPositionDetail().getBook().getTransit().getLegalEntityCountry());
classification.setRulePath(ruleHistory.getActivationPath());
classification.add(a=new ActionParametersImpl( 'BaselineValue'));
a.setValueName( 'Balance');
a.setValue( p.getPositionDetail().getValuation().getMtmValue());
a.setCurrency( p.getPositionDetail().getValuation().getValuationCurrency());
a.setNettingType('Security');
a.setAdjustmentType('Fungible Long covers Fungible Short,Fungible Short covers Fungible Long');
a.setBucket('Total');
classification.add(a=new ActionParametersImpl( 'BaselineCashflow'));
a.setCashflowType( 'SETTLEMENT, Settlement');
a.setList(p.getPositionDetail().getCashFlows());
a.setDefaultDaysToCashFlow (1);
classification.add(a=new ActionParametersImpl( 'BaselineCashflow'));
a.setBaselineType( 'CB');
a.setCashflowType( 'Principal, Interest');
a.setList(p.getPositionDetail().getCashFlows());
a.setDefaultDaysToCashFlow (15000);
classification.add(a=new ActionParametersImpl( 'BaselineTimeBucket'));
a.setBaselineType( 'MB');
a.setValue(p.getPositionDetail().getValuation().getMtmValue());
a.setCurrency(p.getPositionDetail().getValuation().getValuationCurrency());
a.setDate(p.getPositionDetail().getInstrument().getMaturityDate());
a.setDefaultDaysToCashFlow (15000);
a.setNettingType('Security');
a.setAdjustmentType('Fungible Long covers Fungible Short,Fungible Short covers Fungible Long');
a.setBucket('Total');
end
08eur_la_lng_qual_mkt_sec_agncy_dbt_7y_Under_10Y_5
// rule values at A954, header at A921
rule "08eur_la_lng_qual_mtk_sec_agncy_dbt_7Y_under_10Y_5"
salience 64582
when
p: Position(positionDetail!=null && positionDetail.valuation != null && positionDetail.valuation.mtmValue >=0)
Position(positionDetail.productHierarchy != null && positionDetail.productHierarchy.rbcProductClass == "securities")
Position(positionDetail.valuationType in ('Valuation','Both'))
Position(positionDetail.instrument != null && positionDetail.instrument.countryOfDomicile in ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR' ,'GB','GR' ,'HU' ,'IE' ,'IS' ,'IT' ,'LI' ,'LT' ,'LU' ,'LV' ,'MT' ,'NL' ,'NO' ,'PL' ,'PT' ,'RO' ,'SE' ,'SI' ,'SK'))
Position(positionDetail.instrument != null && positionDetail.instrument.countryOfIncorporation in ('AT' ,'BE' ,'BG' , 'CY' ,'CZ' ,'DE' , 'DK' ,'EE' ,'ES', 'FI' ,'FR' ,'GB' , 'GR' ,'HU' ,'IE' , 'IS' ,'IT' ,'LI' , 'LT' ,'LU' ,'LV' , 'MT' ,'NL' ,'NO' , 'PL' ,'PT' ,'RO','SE' ,'SI' ,'SK'))
Position(positionDetail.Valuation!= null && positionDetail. Valuation.ValuationCurrency == "EUR")
Position(positionDetail.instrument != null && positionDetail.instrument.collateralType in ('govt liquid gtd','us govt guarant','u.s. government guarantee'))
Position(positionDetail.instrument != null && positionDetail.instrument.maturityDate >=positionDetail.riskBusinessDate+220752000000)
Position(positionDetail.instrument != null && positionDetail.instrument.maturityDate <positionDetail.riskBusinessDate+315360000000)
Position(positionDetail.valuationType in ('Valuation','Both'))
Position(positionDetail.riskProductType != 'UNKNOWN')
then
result.add(classification=new ActionParametersImpl('BaselineClassification'));
classification.setBaseline('NCCF');
classification.setLineId("NCCF0100405");
classification.setObject(p);
classification.setPositionId(p.getPositionId());
classification.setDataStatus(p.getDataStatus());
classification.setCountry(p.getPositionDetail().getBook().getTransit().getLegalEntityCountry());
classification.setRulePath(ruleHistory.getActivationPath());
classification.add(a=new ActionParametersImpl( 'BaselineValue'));
a.setValueName( 'Balance');
a.setValue( p.getPositionDetail().getValuation().getMtmValue());
a.setCurrency( p.getPositionDetail().getValuation().getValuationCurrency());
a.setNettingType('Security');
a.setAdjustmentType('Fungible Long covers Fungible Short,Fungible Short covers Fungible Long');
a.setBucket('Total');
classification.add(a=new ActionParametersImpl( 'BaselineCashflow'));
a.setCashflowType( 'SETTLEMENT, Settlement');
a.setList(p.getPositionDetail().getCashFlows());
a.setDefaultDaysToCashFlow (1);
classification.add(a=new ActionParametersImpl( 'BaselineCashflow'));
a.setBaselineType( 'CB');
a.setCashflowType( 'Principal, Interest');
a.setList(p.getPositionDetail().getCashFlows());
a.setDefaultDaysToCashFlow (15000);
classification.add(a=new ActionParametersImpl( 'BaselineTimeBucket'));
a.setBaselineType( 'MB');
a.setValue(p.getPositionDetail().getValuation().getMtmValue());
a.setCurrency(p.getPositionDetail().getValuation().getValuationCurrency());
a.setDate(p.getPositionDetail().getInstrument().getMaturityDate());
a.setDefaultDaysToCashFlow (15000);
a.setNettingType('Security');
a.setAdjustmentType('Fungible Long covers Fungible Short,Fungible Short covers Fungible Long');
a.setBucket('Total');
end
18cad_lng_sec_iss_prov_over10Y_under35Y_2
// rule values at A152, header at A138
rule "18cad_lng_sec_iss_prov_over10y_under35y_2"
salience 65384
when
p: Position(positionDetail!=null && positionDetail.valuation != null && positionDetail.valuation.mtmValue >=0)
Position(positionDetail.productHierarchy != null && positionDetail.productHierarchy.rbcProductClass == "securities")
Position(positionDetail.instrument != null && positionDetail.instrument.maturityDate >=positionDetail.riskBusinessDate+315360000000)
Position(positionDetail.instrument != null && positionDetail.instrument.maturityDate <positionDetail.riskBusinessDate+1103760000000)
Position(positionDetail.instrument != null && positionDetail.instrument.issuerTicker in ('BRCOL','BcpIPB','ALTA','SCDA'
,'MP','MANPAC','MPTB','ONTW'
,'ONT','ONTB','ONTPAC','Q'
,'QTB','QUEPAC','QW','NBRNS'
,'NS','PRINCE','NF','NFTB'))
Position(positionDetail.Valuation!= null && positionDetail. Valuation.ValuationCurrency == "CAD")
Position(positionDetail.instrument != null && positionDetail.instrument.issuerIndustry == "govt regional")
Position(positionDetail.instrument != null && positionDetail.instrument.marketSectorDescription == "govt")
Position(positionDetail.valuationType in ('Valuation','Both'))
Position(positionDetail.riskProductType == 'UNKNOWN')
then
result.add(classification=new ActionParametersImpl('BaselineClassification'));
classification.setBaseline('NCCF');
classification.setLineId("NCCF0100341");
classification.setObject(p);
classification.setPositionId(p.getPositionId());
classification.setDataStatus(p.getDataStatus());
classification.setCountry(p.getPositionDetail().getBook().getTransit().getLegalEntityCountry());
classification.setRulePath(ruleHistory.getActivationPath());
classification.add(a=new ActionParametersImpl( 'BaselineValue'));
a.setValueName( 'Balance');
a.setValue( p.getPositionDetail().getValuation().getMtmValue());
a.setCurrency( p.getPositionDetail().getValuation().getValuationCurrency());
a.setNettingType('Security');
a.setAdjustmentType('Fungible Long covers Fungible Short,Fungible Short covers Fungible Long');
a.setBucket('Total');
classification.add(a=new ActionParametersImpl( 'BaselineTimeBucket'));
a.setBaselineType( 'MB');
a.setValue(p.getPositionDetail().getValuation().getMtmValue());
a.setCurrency(p.getPositionDetail().getValuation().getValuationCurrency());
a.setNettingType('Security');
a.setAdjustmentType('Fungible Long covers Fungible Short,Fungible Short covers Fungible Long');
a.setBucket('Total');
end
I'll get that to you on Monday