Reasons for choosing Java agents

Rule agents are the default choice of agent, but there might be good reasons for you to choose a different type of agent.

In most cases, a rule agent is likely to be your first choice of agent. In a rule agent, you can express what you want to do more compactly than by using a Java™ agent. A major difference between rule agents and Java agents is that Java agents by default are stateless. Rule agents store the state of processed events and values of related entities in the working memory, and this data is available in a stateful way to rule conditions. To maintain state in a Java agent, you must add attributes to the bound entity.

The following examples give some valid reasons to use a Java agent rather than a rule agent:

The following general guideline can also be used to make your choice of agent: