Define the Account and History Concepts

In this task, you define the Account and History concepts.

The Account concept holds basic information about an account: an identifier, a balance, a status, an average monthly balance, and recent debit activity. You also learn some useful information about concepts and how they are used.

The History concept contains record of a debit against a specific account. This information is used to detect fraud.

What is a concept? A concept type is a definition of a set of properties that represent the data fields of an entity. Concept types are like Java classes, and concept instances are like Java objects.

How are concept instances created? Concept instances are created by rules, rule functions, or directly in Java. Information from event properties or payloads is often used to create concept instances, but other information can be used, for example, the results of a query or a calculation.

Keys Concepts can have application specific keys. Unique and non-unique keys are supported. Keys can be ordered or unordered. The property identifier is defined as an unordered unique key for the Account concept. This identifier must be unique for all Account concepts. The History concept has a non-unique ordered key on the identifier and at properties. The identifier is the account that is associated with the History concept. This is called a foreign key in database terminology. The at property is used to ordered the History concepts based on time.

Concept Relationships Concepts can have containment and reference relationships with other concepts. You set these up as concept properties, and define the kind of relationship by selecting an appropriate data type for the property. For example, a car concept can contain Wheel concepts, and can have a reference relationship to a Dealership concept.

Inheritance Concepts can also inherit from other concepts (as events can inherit from other events). Inheritance is a programming relationship and not an ontology relationship. It enables you to extend a base type for more efficient project management. See the section called “Define AccountOperation, Create, Debit, and Enable Events” for important information about inheritance.

How are concepts persisted? Instances of concepts (and events) are also known as “facts” and “entities.” They are persisted in shared memory and optionally replicated to one more more nodes.

[Note]

See Concepts in TIBCO BusinessEvents® Extreme Application Architect’s Guide.

See Concepts in TIBCO BusinessEvents® Extreme Application Developer’s Guide.

Define the History Concept

  1. Right click the Concepts folder, and select New > Concept.

  2. You see the New Concept Wizard. In the Filename field, type History. In the Description field, type Maintain debit history for an account. Click Finish.

  3. In the History concept editor Properties section, add the following properties:

    Table 2.3. History Concept Properties

    NameTypeDescription
    amountdoubleDebit amount.
    atDateTimeWhen debit occurred.
    identifierStringAccount identifier

  4. In the History concept Keys section, define a new non-unique, ordered key named ByAccount by clicking on the Add button. Update the key to have these values:

    • Key Name - ByAccount

    • Unique - Unchecked

    • Ordered - Checked

    • External Identifier - Unchecked

    • Properties - identifier at

  5. Save and close the resource.

Define the Account Concept

  1. Right click the Concepts folder, and select New > Concept.

  2. You see the New Concept Wizard. In the Filename field, type Account. In the Description field, type This concept maintains history for account transactions. Click Finish.

  3. In the Account Concept Editor Properties section, add the following properties:

    Table 2.4. Account Concept Properties

    NameTypeDescription
    identifierStringUnique account identifier.
    balancedoubleCurrent account balance.
    statusStringCurrent account status - Enabled or Disabled.
    averageMonthlyBalancedoubleAverage monthly balance.
    recentDebitBalancedoubleRecent debit activity on this account

  4. In the Account concept Keys section, define a new unique, unordered key named ByIdentifier by clicking on the Add button. Update the key to have these values:

    • Key Name - ByIdentifier

    • Unique - Checked

    • Ordered - Unchecked

    • External Identifier - Unchecked

    • Properties - identifier

  5. Save and close the resource.

Summary and Next Steps

You have defined a concept type to hold information about bank accounts. The next step is to add a preprocessor.