System Information Model

From RuleCore Support

Jump to: navigation, search

The ruleCore System Information Model (SIM) contains information about the live state of the ruleCore CEP Server as it executes.

The content in the SIM is automatically maintained to reflect the current state of the ruleCore CEP Server.



The SIM is used for various purposes, for example:

  • Listing available definitions - All definitions of items such as rules, situations and actions can be found in the SIM. Definitions are created using the systems events AddRuleDef, AddSituationDef and AddActionDef and are made available immediately in the SIM.
  • Listing defined user events - Before an user event can be sent into ruleCore it must be defined using the AddEventDef system event. The SIM contains all defined user events.
  • List rule instances - When a rule instance is created it's state and internal data structures can be monitored by finding them in the SIM. For example, it's easy to list the contents of a rule instance tracking a particular business entity such as a long running transaction.
  • Monitoring situation progress - As a situation develops its progress can be monitored by querying the SIM.
  • Examine view contents - Each rule instance is executed in an unique context of events called the event stream view. The view contains a window into the inbound stream of events and contains commonly only semantically related events.
  • Referencing items - When an item such as a rule needs to reference other items it is done using references through the SIM.
  • Component internals - Each plug-in component creates an entry in the SIM and add any component specific information.


The SIM consists internally of dynamic data structures which are updated as needed. These data structures have an external representation which is the user's view of the SIM.

The SIM is represented externally using XML and have the appearance of a single XML document. This external representation of the SIM can be treated as a DOM document which can be queried using XPath and transformed using XSLT. XPath queries can be executed against the SIM using the SysInfoQuery system event.

The SIM calls rules, situations, actions and their definitions for Items. Note that definitions for items are also items themselves.

Plug-in components can dynamically define new types of items and register them into the SIM. A number of pre-defined containers are used as place holders at the top level of the SIM to provide fixed and easy to find locations for items.

Overall Structure

The external representation of the SIM is organized as an XML document with <SysInfo> element as its root node. The entire SIM structure is defined in the SysInfo namespace.

The first level contains a number of fixed elements serving as place holders for all the dynamic information in the SIM.

The <Items> element contains a number of <Type> elements which serve as containers for items as they are created. The name attribute of Type is used to identify the type of items present in the container.

The RuleDef, SituationDef, ActionDef, ViewDef, EventDef, EntityDef and ZoneDef contains definitions of items. The item instances created from these definitions can be found under Rule, Situation, Action and View.

The <Components> contains information about the currently loaded plug-in components. Each component is represented with an element with the same name as the component. The component can create any suitable structure of elements under its root element.

Containers in the SIM

Locations of elements in the SIM are specified using XPath expressions.

A number of fixed and predefined containers exist in SIM. These are filled with dynamic information as the user creates new definitions and when item instances are created in response to inbound events.

Fixed Containers in the SIM
Description Location Contains
Container for all items /SysInfo/Items items
Container for event definitions /SysInfo/Items/Type[@name="EventDef"] <EventDef>
Container for entity definitions /SysInfo/Items/Type[@name="EntityDef"] <EntityDef>
Container for rule definitions /SysInfo/Items/Type[@name="RuleDef"] <RuleDef>
Container for situation definitions /SysInfo/Items/Type[@name="SituationDef"] <SituationDef>
Container for action definitions /SysInfo/Items/Type[@name="ActionDef"] <ActionDef>
Container for event view definitions /SysInfo/Items/Type[@name="ViewDef"] <ViewDef>
Container for geographic zone definitions /SysInfo/Items/Type[@name="ZoneDef"] <ZoneDef>
Container for rule instances /SysInfo/Items/Type[@name="Rule"] <Rule>
Container for situation instances /SysInfo/Items/Type[@name="Situation"] <Situation>
Container for action instances /SysInfo/Items/Type[@name="Action"] <Action>
Container for entity instances /SysInfo/Items/Type[@name="Entity"] <Entity>
Container for list definitions /SysInfo/Items/Type[@name="List"] <List>
Container for dynamically loaded plug-in components /SysInfo/Components component elements


A newly booted ruleCore CEP Server can have a SIM with the following structure:

    <Type name="EntityDef"/>
    <Type name="RuleDef"/>
    <Type name="SituationDef"/>
    <Type name="EventDef"/>
    <Type name="ViewDef"/>
    <Type name="ZoneDef"/>
    <Type name="Rule"/>
    <Type name="ActionDef"/>
    <Type name="Action"/>
    <Type name="Situation"/>
    <Type name="View"/>
    <Type name="Entity"/>
    <Type name="List"/>
    <ActionDefManager name="ActionDefManager"/>
     some elements removed for clarity...
    <TreeNodeCreator name="TreeNodeCreator"/>

Note the actual configuration can be different from this example as plug-in components can register new item types and the actual components loaded can vary.

SIM Elements

The default SIM contains a number of elements. These elements contain information about defined items and their instances.

A plug-in component can add its own information to the SIM so the actual information available might differ from this documentation.


All rule definitions can be found under


Each situation definition is defined with a RuleDef element.


<Type name="RuleDef" xmlns:rc=""
  <RuleDef id="ab12224d-1123-4350-902b-3bfa9a9fa18f" name="S1">
      <ViewRef name="V1" default="true"><base:XPath>...</base:XPath></SituationRef>
      <SituationRef name="S1"><base:XPath>...</base:XPath></SituationRef>
      <SituationDetected situationName="S1">
        <ActionRef name="A1"><base:XPath>...</base:XPath></ActionRef>
      <UndetectableSituation situationName="S1">
        <ActionRef name="A2"><base:XPath>...</base:XPath></ActionRef>


All situation definitions can be found under


Each situation definition is defined with a SituationDef element.


  <SituationDef id="abd4684d-4ca1-4350-962b-3bf0456fa18f" name="S1">
      <Within name="" evalMode="once" timeframe="00:00:10">
        <SequenceSearch name="" evalMode="once">
          <Pickup see="all" keep="last" name="A" evalMode="once"><base:XPath>View/Event[@type="A"]</base:XPath></Pickup>
          <Pickup see="all" keep="last" name="B" evalMode="once"><base:XPath>View/Event[@type="B"]</base:XPath></Pickup>
          <Pickup see="all" keep="last" name="C" evalMode="once"><base:XPath>View/Event[@type="C"]</base:XPath></Pickup>


All action definitions can be found under


Each action definition is defined with a ActionDef element.


<Type name="ActionDef"
  <ActionDef id="f00a9212-c09a-ffa1-1231-3bf04533318f" name="A1">
          <!-- XSLT stylesheet here... -->


All user event definitions (user, system and control class) can be found under


Each user event definition is defined with a EventDef element.


All entity definitions can be found under


Each entity definition is defined with an EntityDef element.


All view definitions can be found under


Each view definition is defined with a ViewDef element.


All geographic zone definitions can be found under


Each zone definition is defined with a ZoneDef element.


<ZoneDef name="Gothenburg City">
    <Description>This is zone Gothenburg City</Description>
        list of coordinates...
  <ZoneDef name="Gothenburg">
    <Description>This is zone Gothenburg</Description>
    <Circle center="11.5782, 57.9190" radius="15000"/>


Information about all current rule instances can be found by selecting


The Rule element and all its sub-elements are described in full detail here.


Information about all current situation instances can be found by selecting


The Situation element and all its sub-elements are described in full detail here.


Information about all current action instances can be found by selecting


The Action element and all its sub-elements are described in full detail here.


Information about all current view instances can be found by selecting


The View element and all its sub-elements are described in full detail here.


Information about all current entity instances can be found by selecting


The Entity element and all its sub-elements are described in full detail here.

<Entity entityId="Driver2" entityType="Driver" id="ac914e39-334e-4446-8913-85ebb8357007">
  <Property name="Ranking">
  <Property name="Zone">
  <Property name="Position">

Querying the SIM

The SIM can be queried by using a SysInfoQuery system event. It's body contains a single Query element with the XPath query expression.

The query returns a SysInfoQueryResponse system event with the result of the query.

Example Queries

<?xml version="1.0" encoding="UTF-8"?>
  xsi:schemaLocation=" TreeQuery.xsd"


The SIM can be extended to include information from user supplied plug-in components. A component can register itself in the SIM and has full control over how its internal data is presented in the SIM.


<Rule id="a8a9b8e9-a476-4fcc-9fe3-3dd1000723f4" name="R1">
  <Situation ruleId="a8a9b8e9-a476-4fcc-9fe3-3dd1000723f4" id="6dc3219c-7301-492d-ab8e-cfaac6924338" name="S1">
    <PickupSets pickupNode="D">
        <Event timestamp="2008-02-04T12:00:56.501511" type="D" id="1d6bcb60-4fee-487d-9e2f-b5a982f037f7">
    <PickupSets pickupNode="B">
        <Event timestamp="2008-02-04T12:00:56.497946" type="B" id="c36d1b07-e4d5-4ac4-abc5-f5873b5a20df">
    <Detector value="true:const">
      <SequenceSearch completionDegree="1.0" evalMode="once" name="" value="true:const" evalCount="4">
        <Pickup completionDegree="0.5" evalMode="once" name="C" value="true:const" evalCount="1"/>
        <Pickup completionDegree="0.5" evalMode="once" name="D" value="true:const" evalCount="1"/>
        <Pickup completionDegree="0.5" evalMode="once" name="B" value="true:const" evalCount="1"/>
        <Pickup completionDegree="0.5" evalMode="once" name="A" value="true:const" evalCount="1"/>
    <PickupSets pickupNode="C">
        <Event timestamp="2008-02-04T12:00:56.499731" type="C" id="6f795041-180c-4147-8b35-3ce941e2aa1a">
    <PickupSets pickupNode="A">
        <Event timestamp="2008-02-04T12:00:56.495647" type="A" id="d14ebeab-9f6f-49f7-8eb2-c6c303575d53">
Personal tools