タスク 1-2: イベントおよびエンティティーの定義
このタスクでは、ソリューションのモデルを定義します。
このタスクについて
このチュートリアルでは、ビジネス・モデルは以下のエレメントを含む必要があります。
- 顧客および顧客識別情報 (名前、電話番号など)
- 顧客口座 (口座の格付けと残高を含む)
- 口座取り引き (購入金額など)
- 与信応答 (メッセージまたは例外を含む)
- 口座および顧客の作成と初期口座残高用の初期化ステートメント
ビジネス・モデル定義 (.bmd) ファイル内で、エンティティーとイベントをモデル化します。Insight Designer は、 モデル化プロセスを簡単にするために、使用可能な構成体を定義のコンテキストに基づいて提案するエディターを備えています。
以降のステップでは、イベントおよびエンティティーを定義してから、初期化ステートメントを使用してそれらを作成します。
手順
- MyCreditCardSolution ソリューション・プロジェクトを選択してから、ソリューション・マップで「イベントおよびエンティティーの定義」をクリックします。

- 「ビジネス・モデル定義」ページの「BOM プロジェクト」フィールドに MyCreditCardSolutionBOM が指定されていることを確認します。 このフォルダーは、前の演習で作成したコンテナーです。
- 「パッケージ」フィールドに creditcard と入力します。 このパッケージ名は、.bmd ファイル内のモデル化されたエンティティーおよびイベントに適用され、ビジネス・モデル定義のフォルダー構造を定義するために使用されます。
- 「名前」フィールドはデフォルト値 BusinessModel のままにして、「終了」をクリックします。 空の BusinessModel.bmd エディターが開き、ここでモデルの定義を始めることができます。
- Account (口座) エンティティーを定義します。
- an account と入力し、スペース・バーを押して入力メニューを開きます。

- is a business entity をダブルクリックします。 次の選択可能オプション・セットが入力メニューに表示されます。
- identified by <id> をダブルクリックします。
- an をダブルクリックします。
- 表示されるオプションの 1 つを選択する代わりに、id と入力します。 この語を入力することで、account エンティティーの識別方法を定義します。
- このステートメントを終了するために . を入力し、Enter を押します。 各行は、ピリオドで終わる必要があります。
an account is a business entity identified by an id. - an account と入力し、スペース・バーを押して入力メニューを開きます。
- 口座の状況属性を定義します。
- .bmd エディターの 2 行目に an account と入力し、スペース・バーを押します。
- 入力メニューで has をダブルクリックします。
- a をダブルクリックします。
- status と入力し、スペース・バーを押します。
- ( ... をダブルクリックします。
- an をダブルクリックします。
- account status と入力し、スペース・バーを押します。
- ) ... をダブルクリックします。
- . をダブルクリックし、入力メニューの外側をクリックして入力メニューを非アクティブ化します。
まだ account status 列挙が定義されていないため、この行には一時的にエラーが表示されます。
an account has a status (an account status). - エンティティーおよびイベントのモデル化を 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). - 「保存」 をクリックします。
ビジネス・オブジェクト・モデルを作成するにつれて、「アウトライン」ビューにエレメントとそのプロパティーが階層ビューで表示されます。「アウトライン」ビューで項目をクリックすると、ビジネス・モデル定義ファイルでそれらを強調表示にすることができます。

- これでイベントおよびエンティティーが定義されたので、以下のように、その一部を初期化する方法を指定できます。
- BusinessModel.bmd ファイルのウィンドウで、「ステートメント」タブをクリックします。
- 入力メニューを使用するか、コピー・アンド・ペーストによって、口座エンティティーおよび顧客エンティティーに対して以下の初期化ステートメントを入力します。
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 . - 「保存」 をクリックします。
- オプション: 項目の言語化を表示します。 言語化はビジネス・ルールで使用する用語で、根底にある Java™ クラスおよびメンバーに基づいています。
- 「語彙」ビューをクリックし、transaction クラスを展開します。

- {the country code} of {a transaction} メンバーをダブルクリックします。 「モデル」ウィンドウが開き、エレメントおよびその言語化についての詳細情報が表示されます。
- 「モデル」ウィンドウを閉じます。
- 「語彙」ビューをクリックし、transaction クラスを展開します。
関連概念: