I need to create a new business data which needs to be exposed and used in the Rule. I have the logic and code with me.
Ideally data points are added as dynamic data and tied to your rules through configuration. However if you are adding persistent variables to the entire Wynsure implementation you will need to:
Example: We have a city code that is used in a particular implementation of Wynsure. This project is Individual life and the client would like to make available to all the rules engines that deal with their life projects. We need to override the Rules engine class, and the individual product class:
; aCUS_RuleEngine (aWLIRuleEngine) (Def Version:2) (Implem Version:3)
uses CUS_Types, aWLIContract, aListOfInstances, aMethodDesc
memory Master : aCUS_RuleEngine override
v_Subscriber__TrinCityCode : tCUS_ParishDynamicEnum
Subscriber__TrinCodeUpdated : Boolean
v_Subscriber__TriniID : CString
Subscriber__TriniIDUpdated : Boolean
function Subscriber__TriniID return CString
uses aCUS_Person
if self.Master <> Nil
return self.Master.Subscriber__TriniID
else
if not self.Subscriber__TriniIDUpdated and not self.Test
self.v_Subscriber__TriniID = aCUS_Person(self.ForContract.Subscriber).IDNumber
self.Subscriber__TriniIDUpdated = True
endIf
return self.v_Subscriber__TriniID
endIf
endFunc
function Subscriber__TrinCityCode return tCUS_ParishDynamicEnum
uses aCUS_Person
if self.Master <> Nil
return self.Master.Subscriber__TrinCityCode
else
if not self.Subscriber__TrinCodeUpdated and not self.Test
self.v_Subscriber__TrinCityCode = aCUS_Person(self.ForContract.Subscriber).BirthParish
self.Subscriber__TrinCodeUpdated = True
endIf
return self.v_Subscriber__TrinCityCode
endIf
endFunc
procedure DeclareSubscriberAsPersonBusinessFunctions(List : aListOfInstances) override
inherited self.DeclareSubscriberAsPersonBusinessFunctions(List)
List.AppendObject(MetaModelEntity(self.Subscriber__TrinCityCode))
List.AppendObject(MetaModelEntity(self.Subscriber__TriniID))
endProc
; aCUS_LifeIndividualProduct (aWLI_LifeIndividualProduct) (Def Version:3) (Implem Version:4)
uses aCUS_IndividualCoverage, aClassDef
Options : listOf [O] aCUS_IndividualCoverage inverse MyOwner override
function RuleEngineClassDef return aClassDef override
uses aCUS_RuleEngine
_Result = MetaModelEntity(aCUS_RuleEngine)
endFunc