SIM:EntityDef

From RuleCore Support

Jump to: navigation, search

Overview

Entity types are defined using the AddEntityDef system event and are found in the SIM as EntityDef items in the container located at /sim:SysInfo/sim:Items/sim:Item[@name="EntityDef"].

Contents

The EntityDef element normally contains a <Properties> element which in turn lists all the properties associated to this entity type.

  <EntityDef eventType="EntityTypeName">
    <Properties>
      <Property name="property1">
      <Property name="property2">
        ...
    </Properties>
  </EntityDef>

Example

Example 1. Querying the SIM for entity definitions might result in something like this:

<Type name="UserEventDef">
  <EntityDef eventType="Car" eventClass="user" id="1344866f-7eac-43b6-b91b-61cb26f32658">
    <Properties>
      <Position/>
      <Zone/>
    </Properties>
  </EntityDef>
  <EventDef eventType="Boat" eventClass="user" id="8bd73ab1-555e-47a7-ba1a-3b17d08fac24">
    <Properties>
      <Position/>
      <Zone/>
    </Properties>
  </EntityDef>
  <EventDef eventType="Plane" eventClass="user" id="f93633ab-1e1c-4fc9-bb00-e932177160b7">
    <Properties>
      <Position/>
      <Zone/>
    </Properties>
  </EntityDef>
</Type>

Example 2. To define an entity of type Car, sporting two properties Position and Zone the definition could look like this:

<EntityDef name="Car">
  <Description>This is entity type Car</Description>
  <Properties>
    <Property name="Position"/>
    <Property name="Zone"/>
  <Properties>
</EntityDef>
Personal tools