Rule-based event-driven solutions

To build your solution, you route events to entities by using agents.

Decision Server Insights relates events to entities by using agents. Agents process events by using correlations, aggregations, rules, or predictive models to identify risks or opportunities. Agents are often triggered by the arrival of events, but can also be scheduled for execution.

A developer of an agent is responsible for writing the business logic that updates the state of an entity that is based on an incoming event.

The business logic in an agent can undertake several types of operations, which can be combined:

A solution is represented by an Eclipse project that refers to a set of agent project dependencies. An agent is represented by a Java™ agent project, a rule agent project, or a predictive scoring agent. A solution project always has a BOM project, which contains a .bmd file and an aggregates folder.

To develop and test a solution:

  1. Create a solution project.

    Endpoints are required if the solution receives or emits events to the outside world. A project needs to specify the incoming and outgoing JMS and HTTP connections.

    Classifiers and transformations are required to transform a message into a recognized event only if the message does not conform to the XML schema of an event that is recognized by the solution.

    The solution project wizard creates a business object model (BOM) project if you do not already have one. A new BOM project contains an empty BOM.

  2. Import definitions or define the entities and events in the business model definition editor.

    Select a root XML schema file (.xsd) to import existing events into the BOM, and use the business definition language to create the required entities and concepts.

  3. If you did not use the vocabulary wizard in the previous step, generate a vocabulary for the objects in your BOM.
  4. Set relationships between the objects of the model.
  5. Create a rule agent project.

    Select from the available event types in the referenced BOM and establish the routing logic. You must define the conditions that determine which situations apply to the agent, and identify the entity on which the agent acts.

    Note: A rule agent must be bound to an entity, but a Java agent does not have to be. It is valid to create Java agents that operate over single events or a sequence of events independent of any entity.
  6. Write rule agent business logic.

    Add rules to the rule agent project. The rules can reference all types on the BOM path. The editor is aware of the event types that the agent wants to process, as well as the routing logic. You use standard stateless and stateful rule semantics to express the function of the agents. Rules can generate events themselves and emit them into and out of the system. The vocabulary within the rule agent has the following access rights:

    • Read/write on all properties of the primary entities.
    • Read-only on properties of entities that are referenced through relationships.
    • Read-only on event properties.
  7. Create an Insight Server or use the cisDev server that is installed by default.
  8. Deploy the solution artifact to the server.

    Agent descriptors allow the runtime environment to route the events to a specific agent, and load the data that is needed to execute the event processing business logic.

    Note: The deployed solution is versioned and can be deployed dynamically to the runtime environment.
  9. Use the Java API to connect to a solution gateway, instantiate the necessary entities, and send an event payload to an Insight Server.

    For more information, see Testing solutions.

  10. Run the application to submit events and see the agents execute as a result.