< Previous | Next >

Task 1-2: Defining the events and entities

In this task, you define the model for the solution.

About this task

In this tutorial, the business model needs to include the following elements:
  • Customers and their identifying information, such as name and telephone number
  • Customer accounts, including an account rating and a balance
  • Account transactions, such as a purchase amount
  • Authorization responses, which contain messages or exceptions
  • Initialization statements for the creation of accounts and customers and an initial account balance

You model entities and events in a business model definition (.bmd) file. Insight Designer simplifies the modeling process by providing an editor that proposes available constructs that are based on the context of the definition.

In the following steps, you define the events and entities, and then use initialization statements to create them.

Procedure

  1. Select the MyCreditCardSolution solution project, and then in the solution map, click Define events and entities.
    The solution map contains the link to define events and entities
  2. In the BOM project field of the Business Model Definition page, ensure that MyCreditCardSolutionBOM is specified. This folder is the container that you created in the previous lesson.
  3. In the Package field, type creditcard. The package name applies to the entities and events that are modeled in the .bmd file and is used to define the folder structure for the business model definition.
  4. Leave the Name field with its default value of BusinessModel, and click Finish. An empty BusinessModel.bmd editor opens, in which you can start to define the model.
  5. Define the account entity:
    1. Type an account and press the space bar to open the completion menu.
      The completion menu in the business model definitions editor
    2. Double-click is a business entity. The next set of possible options is displayed in the completion menu.
    3. Double-click identified by <id>.
    4. Double-click an.
    5. Instead of selecting one of the displayed options, type id. By typing this word, you define how the account entity is identified.
    6. Type . to finish the statement and then press Enter. Each line must end with a period.
    The completed line is as follows.
    an account is a business entity identified by an id.
  6. Define the status attribute for the account:
    1. On the second line of the .bmd editor, type an account and press the space bar.
    2. Double-click has, in the completion menu.
    3. Double-click a.
    4. Type status and press the space bar.
    5. Double-click ( ....
    6. Double-click an.
    7. Type account status and press the space bar.
    8. Double-click ) ....
    9. Double-click . and click outside the completion menu to deactivate it.

      The line temporarily displays an error because the account status enumeration is not yet defined.

    The completed line is as follows.
    an account has a status (an account status).
  7. Continue to model the entities and events one by one, or copy the complete model into your .bmd file.
    The complete model is as follows.
    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. Click Save.

    Notice that as you create your business object model, the Outline view shows the elements and their properties in a hierarchical view. You can click items in the Outline view to highlight them in the business model definition file.

    The Outline view shows the items in the business model definition file

  9. Now that the events and entities are defined, you can specify how some of them are initialized:
    1. In the window for the BusinessModel.bmd file, click the Statements tab.
    2. Enter the following initialization statements for the account and the customer entities, either by using the completion menus or by copying and pasting:
      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. Click Save.
    The values of the entities are initialized automatically when required.
  10. Optional: View the verbalizations for an item. The verbalizations are the words and terms that you use in business rules and are based on the underlying Java™ classes and members.
    1. Click the Vocabulary view and expand the transaction class:
      The Vocabulary view shows the verbalizations for the items in the business model definition file
    2. Double-click the {the country code} of {a transaction} member. A model window opens in which you can see detailed information about the element and its verbalization.
    3. Close the model window.
< Previous | Next >