Completing the agent descriptor
You must complete the agent descriptor (agent.adsc) to define the entity to bind the agent to, the events that the agent processes, and the routing logic.
Before you begin
About this task
In the agent descriptor file, you define the routing conditions to apply to the event. The descriptor has a business vocabulary that refers to the event and entity types in the business model.
This agent descriptor file contains a template that you must complete in the editor to define the agent logic.
Procedure
Results
The following agent descriptor shows an airport agent that is bound to an airport entity, and that processes two events.

- The name of the agent.
- The bound entity type.
- The priority of the agent.
- The event types that the agent listens for and processes.
- The bound entity.
- The expression to retrieve the string that corresponds to the bound entity in the event.
- The filtering on the event.
- The time horizon of the event.
- temperature reading,
where this location comes from the location of this temerature reading
with a horizon of 7 daysOne week later, the temperature
readings of the past 7 days are stored in the agent. You can then
define a rule that aggregates this data over the past week.Examples
- Agent that processes one event
- In the following example, the bound entity of the agent is a ticket,
and the agent listens for a ticket check in event. The ID of the ticket
entity is the ID that is contained in the ticket check in event.
'ticket checkin agent' is an agent related to a ticket, processing events: - ticket checkin event, where this ticket comes from the ticket of this ticket checkin eventTip: In thetargetplaceholder, you can use variables that implicitly refer to the event. For example, instead of writingthe ticket of this ticket checkin event, you can writethe ticket. - Agent that processes several events with a priority and a condition
The following agent descriptor shows an airport agent that is bound to an airport entity, and that processes two events. The priority of the agent is high. If another agent listens to the same events with a lower priority, the
AirportAgentagent processes these events first. This agent description also contains a filtering condition on the airport open event. The agent processes only airport open events that happen in August.'AirportAgent' is an agent related to an airport, whose priority is High, processing events: - airport closed event, where this airport comes from the airport of this airport closed event - airport open event when the datetime of this airport open event is in August, where this airport comes from the airport of this airport open event- Agent that processes several events, where one of the events has a specified time horizon
- The following agent descriptor shows an airport agent that is
bound to an airport entity, and that processes two events. The agent
keeps the airport open events in working memory for a period of 15
days from the time stamp of each event. When the current time reaches
the end of this period, the airport open events are removed from the
agent's memory. The agent descriptor does not specify a time horizon
for the airport closed events, so they are kept in the working memory
for the maximal time horizon of the agent or solution.
'AirportAgent' is an agent related to an airport, processing events: - airport closed event, where this airport comes from the airport of this airport closed event - airport open event, where this airport comes from the airport of this airport open event with a horizon of 15 days - Agent that processes and event where the entity ID is based on two fields of the event
- In the following example, the bound entity of the agent is a customer,
and the agent listens for a subscription event. The ID of the customer
entity is composed of the first name and last name of the main contact
that is contained in the subscription event.
'subscription agent' is an agent related to a customer, processing events: - subscription event, where this customer comes from the first name of the main contact of this subscription event + "/" + the last name of the main contact of this subscription event - Agent that processes an event where the entity is a parent type of the bound entity
- You can bind an event to the parent type of an entity. For example,
consider the following business model:
If the agent is related to a patient entity, you can bind the event to the person entity. In this example, the runtime environment checks whether the person entity of the event is an instance of a patient or a doctor. The agent processes the event only if the entity of the event is a patient.a person is a business entity identified by a string, named the name. a patient is a person . a doctor is a person . a message to person is a business event . a message to person is related to a person. a message to patient is a business event . a message to patient is related to a patient.'healthcare' is an agent related to a patient, processing events: - message to person, where this patient comes from the person of this message to person - Agent with no bound entity
A rule agent must have a bound entity, but you can develop Java agents that are not bound to an entity. An agent can receive a stream of events, and emit outbound events that are based on the event stream, without requiring access to an entity. For example, if you want to trigger an alert when a number of transactions occurred.
To create a Java agent with no entity, you omit the
is related toandwhere <mapping>clauses, as shown in the following example:'transactionagent.MyAgent' is an agent, processing events: - transaction event