更改哪种方法以在 ewam 中公开业务数据?
Which method to change to expose Business data in ewam?
我需要创建一个需要在规则中公开和使用的新业务数据。我有逻辑和代码。
理想情况下,数据点作为动态数据添加并通过配置绑定到您的规则。但是,如果您要将持久变量添加到整个 Wynsure 实施中,您将需要:
- 创建一个自定义规则引擎,它源自与相关规则类别相关的主规则引擎,即 aWLIRuleEngine(适用于所有规则)aWLIClaimRuleEngine(适用于索赔规则)aWLO_LoanRuleEngoine(适用于贷款规则)等等。
- 在新的或重新实现的规则引擎中,添加一个变量来保存您要公开的每个数据点。这应该与类型中的业务变量相匹配。
- 添加第二个布尔变量来跟踪第一个变量是否已加载。
- 创建一个函数以从 Wynsure 业务中检索数据 class 并将该数据复制到规则引擎占位符(并更改布尔值以验证是否已完成此操作)。
- 覆盖声明所有检索函数的 Proc(继承父类中的所有先前版本,然后附加您自己的)。
- 覆盖您的主要业务对象以使用您的自定义规则引擎而不是原始客户端。
示例:我们有一个城市代码用于 Wynsure 的特定实施。这个项目是个人生活,客户希望处理他们生活项目的所有规则引擎都可用。我们需要覆盖规则引擎 class,以及单个产品 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
我需要创建一个需要在规则中公开和使用的新业务数据。我有逻辑和代码。
理想情况下,数据点作为动态数据添加并通过配置绑定到您的规则。但是,如果您要将持久变量添加到整个 Wynsure 实施中,您将需要:
- 创建一个自定义规则引擎,它源自与相关规则类别相关的主规则引擎,即 aWLIRuleEngine(适用于所有规则)aWLIClaimRuleEngine(适用于索赔规则)aWLO_LoanRuleEngoine(适用于贷款规则)等等。
- 在新的或重新实现的规则引擎中,添加一个变量来保存您要公开的每个数据点。这应该与类型中的业务变量相匹配。
- 添加第二个布尔变量来跟踪第一个变量是否已加载。
- 创建一个函数以从 Wynsure 业务中检索数据 class 并将该数据复制到规则引擎占位符(并更改布尔值以验证是否已完成此操作)。
- 覆盖声明所有检索函数的 Proc(继承父类中的所有先前版本,然后附加您自己的)。
- 覆盖您的主要业务对象以使用您的自定义规则引擎而不是原始客户端。
示例:我们有一个城市代码用于 Wynsure 的特定实施。这个项目是个人生活,客户希望处理他们生活项目的所有规则引擎都可用。我们需要覆盖规则引擎 class,以及单个产品 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