< 前へ | 次へ >

タスク 1-2: イベントおよびエンティティーの定義

このタスクでは、ソリューションのモデルを定義します。

このタスクについて

このチュートリアルでは、ビジネス・モデルは以下のエレメントを含む必要があります。
  • 顧客および顧客識別情報 (名前、電話番号など)
  • 顧客口座 (口座の格付けと残高を含む)
  • 口座取り引き (購入金額など)
  • 与信応答 (メッセージまたは例外を含む)
  • 口座および顧客の作成と初期口座残高用の初期化ステートメント

ビジネス・モデル定義 (.bmd) ファイル内で、エンティティーとイベントをモデル化します。Insight Designer は、 モデル化プロセスを簡単にするために、使用可能な構成体を定義のコンテキストに基づいて提案するエディターを備えています。

以降のステップでは、イベントおよびエンティティーを定義してから、初期化ステートメントを使用してそれらを作成します。

手順

  1. MyCreditCardSolution ソリューション・プロジェクトを選択してから、ソリューション・マップで「イベントおよびエンティティーの定義」をクリックします。
    ソリューション・マップには「イベントおよびエンティティーの定義」へのリンクが含まれています
  2. 「ビジネス・モデル定義」ページの「BOM プロジェクト」フィールドに MyCreditCardSolutionBOM が指定されていることを確認します。 このフォルダーは、前の演習で作成したコンテナーです。
  3. 「パッケージ」フィールドに creditcard と入力します。 このパッケージ名は、.bmd ファイル内のモデル化されたエンティティーおよびイベントに適用され、ビジネス・モデル定義のフォルダー構造を定義するために使用されます。
  4. 「名前」フィールドはデフォルト値 BusinessModel のままにして、「終了」をクリックします。 空の BusinessModel.bmd エディターが開き、ここでモデルの定義を始めることができます。
  5. Account (口座) エンティティーを定義します。
    1. an account と入力し、スペース・バーを押して入力メニューを開きます。
      ビジネス・モデル定義エディターの入力メニュー
    2. is a business entity をダブルクリックします。 次の選択可能オプション・セットが入力メニューに表示されます。
    3. identified by <id> をダブルクリックします。
    4. an をダブルクリックします。
    5. 表示されるオプションの 1 つを選択する代わりに、id と入力します。 この語を入力することで、account エンティティーの識別方法を定義します。
    6. このステートメントを終了するために . を入力し、Enter を押します。 各行は、ピリオドで終わる必要があります。
    完成した行は次のようになります。
    an account is a business entity identified by an id.
  6. 口座の状況属性を定義します。
    1. .bmd エディターの 2 行目に an account と入力し、スペース・バーを押します。
    2. 入力メニューで has をダブルクリックします。
    3. a をダブルクリックします。
    4. status と入力し、スペース・バーを押します。
    5. ( ... をダブルクリックします。
    6. an をダブルクリックします。
    7. account status と入力し、スペース・バーを押します。
    8. ) ... をダブルクリックします。
    9. . をダブルクリックし、入力メニューの外側をクリックして入力メニューを非アクティブ化します。

      まだ account status 列挙が定義されていないため、この行には一時的にエラーが表示されます。

    完成した行は次のようになります。
    an account has a status (an account status).
  7. エンティティーおよびイベントのモデル化を 1 つずつ続行するか、または、完成したモデルを .bmd ファイルにコピーします。
    完成したモデルは次のようになります。
    an account is a business entity identified by an id.
    an account has a status (an account status).
    
    an account is related to a customer.
    an account has a balance (numeric).
    an account has a last check time (date & time).
    
    an account status can be one of: Excellent, Good, Fair, Poor, Risky.
    
    a customer is a business entity identified by an email with a first name, a last name, a phone number.
    a customer is related to some accounts.
    
    a transaction is a business event time-stamped by a date.
    a transaction is related to an account.
    a transaction has an amount (a number).
    a transaction has a country code.
    
    an exception is a concept.
    an exception has a reason.
    an exception has a code.
    
    an authorization response is a business event time-stamped by a date.
    an authorization response is related to an account.
    an authorization response has a message.
    an authorization response has a transaction.
    an authorization response has an exception.
    
    an account initialization is a business event time-stamped by a date.
    an account initialization is related to an account.
    an account initialization is related to a customer.
    an account initialization has a balance (a number).
    an account initialization has a status (an account status).
  8. 「保存」 をクリックします。

    ビジネス・オブジェクト・モデルを作成するにつれて、「アウトライン」ビューにエレメントとそのプロパティーが階層ビューで表示されます。「アウトライン」ビューで項目をクリックすると、ビジネス・モデル定義ファイルでそれらを強調表示にすることができます。

    「アウトライン」ビューに、ビジネス・モデル定義ファイル内の項目が表示されます。

  9. これでイベントおよびエンティティーが定義されたので、以下のように、その一部を初期化する方法を指定できます。
    1. BusinessModel.bmd ファイルのウィンドウで、「ステートメント」タブをクリックします。
    2. 入力メニューを使用するか、コピー・アンド・ペーストによって、口座エンティティーおよび顧客エンティティーに対して以下の初期化ステートメントを入力します。
      an account is initialized from an account initialization , where this account comes from the account of this account initialization : 
      	- set the customer of this account to the customer of this account initialization 
      	- set the balance of this account to the balance of this account initialization 
             - set the status of this account to the status of this account initialization .
      	
      a customer is initialized from an account initialization , where this customer comes from the customer of this account initialization . 
    3. 「保存」 をクリックします。
    エンティティーの値が、必要に応じて、自動的に初期化されます。
  10. オプション: 項目の言語化を表示します。 言語化はビジネス・ルールで使用する用語で、根底にある Java™ クラスおよびメンバーに基づいています。
    1. 「語彙」ビューをクリックし、transaction クラスを展開します。
      「語彙」ビューに、ビジネス・モデル定義ファイル内の項目の言語化が表示されます。
    2. {the country code} of {a transaction} メンバーをダブルクリックします。 「モデル」ウィンドウが開き、エレメントおよびその言語化についての詳細情報が表示されます。
    3. 「モデル」ウィンドウを閉じます。
< 前へ | 次へ >