2017-09-21 2 views

答えて

1

理想的にはデータポイントが動的データとして追加され、設定によってルールに関連付けられます。しかし、あなたがする必要があります全体Wynsure実装に固定変数を追加する場合:

  1. カスタムは、関連するルールのカテゴリすなわちaWLIRuleEngine(すべてのルールについて)aWLIClaimRuleEngine(のために結ばれ、メインルールエンジンから下降エンジンルール作成クレームルールの場合)aWLO_LoanRuleEngoine(ローンルールの場合)など。
  2. 新規または再実装されたルールエンジンでは、公開する各データポイントに対して保持する変数を追加します。これはタイプのビジネス変数と一致する必要があります。
  3. 最初の変数がロードされているかどうかを追跡するために、2番目のブール変数を追加します。
  4. Wynsureビジネスクラスからデータを取得し、そのデータをルールエンジンのプレースホルダにコピーする機能を作成します(ブール値を変更してこれが完了したことを確認します)。
  5. すべての検索関数を宣言するProcをオーバーライドします(親のすべての以前のバージョンを継承し、独自に追加します)。
  6. 元のクライアントの代わりにカスタムルールエンジンを使用するようにメインビジネスオブジェクトを上書きします。

例:Wynsureの特定の実装で使用されている都市コードがあります。このプロジェクトは個人の生活であり、クライアントはライフプロジェクトを扱うすべてのルールエンジンを利用できるようにしたいと考えています。 Rulesエンジンクラスと個々の製品クラスをオーバーライドする必要があります。

; 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 
関連する問題