Overview: Business model

You can create your business model in different ways. You can write the definitions of your entity and event types by using a business syntax. You can also import an XML schema to create the business model.

Before you develop your agents, you must design the business model. The business model is composed of entity and events types, and their attributes and relationships.

Ways of creating the business model

You have several ways of creating the business model. You can use one or more of the following ways to create the model for your entity and event types.
  • Import an XML schema (.xsd file) that contains your event or entity definitions.

    Before you import the schema, you must add some annotations to define the entity and event types, and the relationships between them. For more information, see Adding annotations to an XML schema and Importing event and entity types from an XML schema.

    There are two types of XML data representation: generic XML and typed XML. You can view the generic XML format for entities by using the REST API. Typed XML is a specific representation that is used by Insight Designer and connectivity.

  • Write the definitions for your entities and events in a business model file.

    If you do not have an XML schema that represents your events and entities, you can write business definitions for them. For more information, see Writing the business model.

  • Import a message flow file that contains monitoring events.

    If you have a flow in WebSphere® Message Broker or IBM® Integration Bus that emits monitoring events, you can import the message flow file. For more information, see Importing event types from IBM Integration Bus.

A typical scenario is to import event types from XSD because the event definitions already exist in a schema from the event source, for example IBM Integration Bus. You define the entity types in the business model definitions.

When you model your entity types, you must make sure that the data in the entity type can be populated from the events. Similarly, when you model your event types, you must make sure that they contain the data that is required to update or modify the entities.

Restriction: In the business model files, you can use the en_US language only. For more information, see Known limitations.

Entity types

An entity is data about a real-world identifiable object. In Decision Server Insights, an entity has an entity type that describes the nature of the entity. For example, "John Doe" might be an entity with the entity type "Person".

Entity types are hierarchical data containers that do not have behavior nor methods. Entity types are composed of a set of attributes and a set of relationships to other entity types or event types.

An entity type has an attribute that acts as the identifier for entity instances. The identifier must be an attribute of type String. The identifier is used to uniquely identify an instance of the entity among the set of all entities that share the same entity type. The attributes of an entity type do not exist independently of their owning entity.

Relationships are unidirectional and can be single or multiple. For example, a Bag entity type has a single relationship named Owner of type Customer. A Customer entity type has a multiple relationship named Bags of type Bag.

An agent is linked to a single entity that is referred to as the bound entity.

To create entity types, you can either import the definitions from an existing XSD into Insight Designer, or write business model definitions of your entity types. A business object model is created as a result of both of these options.

Design of entity types

In Java™, entity types are represented by Java interfaces that extend the com.ibm.ia.model.Entity interface. These Java interfaces are located in the Java Model project. All entity types can be represented by an XML schema. However, not all XML schemas can be entity types.

In the BOM, the attributes of an entity type are mapped to Java interfaces (relationship), primitive types, or certain classes from java.lang such as String and from java.time such as ZonedDateTime. The attributes can also be certain system-defined classes to express dates, durations, or locations.

Event types

An event is a message that includes an ID to identify the semantic content of that message. The event type describes the shape or schema of an event.

Event types are hierarchical data containers that do not have behavior nor methods. Event types are composed of a set of attributes and a set of relationships to entity types. An event type can contain collections of attributes and relationships. The attributes of an event are sometimes referred to as fields.

An event type contains an attribute that represents the date and time of the event.

To create event types, you can either import the definitions from an existing XSD into Insight Designer, import monitoring information from a message flow file, or write business model definitions. A business object model is created as a result of these options.

Design of event types

In Java, event types are represented by Java interfaces that extend the com.ibm.ia.model.Event interface. These Java interfaces are located in the Java Model project. All event types can be represented by an XML schema. However, not all XML schemas can be event types. Some XML schemas include features that make them difficult to map to event types.

In the BOM, the attributes of an event type are mapped to Java interfaces (relationship), primitive types, or certain classes from java.lang such as String and from java.time such as ZonedDateTime. The attributes can also be certain system-defined classes to express dates, durations, or locations.

Elements of the business model

In the business model, you can have the following elements:
Entity types
An entity type is composed of a set of attributes, and a set of relationships to other types. An entity type has an attribute that acts as an identifier for entity instances.
Event types
An event type describes the shape of an event. An event type is composed of a set of attributes, and a set of relationships to other entity types. An event has a time stamp attribute that represents a date and time.
Concepts
A concept is a simple object that is contained by one or more entity or event types.
Enumerations
An enumeration defines a list of possible values.
Attributes
An attribute is a characteristic of an entity, event, or concept. Attributes can be a primitive type, and other types such as String, date, date and time, and other geospatial types.
Derived attributes
The value of a derived attribute is calculated from the value of another attribute.
Enriched attributes
The value of an enriched attribute is supplied by a data provider and cannot be modified by agents. For example, a data provider might be given the values of other attributes to query a database or call an external service. As a result, it can then supply the values of one or more enriched attributes.
Data providers
A data provider is a service that is external to the solution and that can be used to enrich attributes.
Dictionaries
A dictionary is a set of business model definitions that specify linguistic properties. You can use a dictionary to define the translation of terms, and specify their plural form and grammatical gender.
Relationships
A relationship defines the inheritance or reference to other entities, events, and concepts.

The following example illustrates a Customer and an Account entity types, and a Change of address and a Customer moving home event types. The entities and events have relationships.

This graphic describes an entity type 'customer', a concept type 'address', and an event type 'change of address', and their relationships and attributes.