A simple event defines an object that represents an activity. When the term "event" is used without the qualifier advisory or time, it refers to a simple event.
In complex event processing, the term event is overloaded: it means an activity that happens, and the definition of an object that represents the activity (also known as an event type), and also an instance of that event type.See TIBCO BusinessEvents Getting Started for a short introduction to events, which explains use of default events and default destinations.
● Configuration, which can include a default destination, time to live (expiration period), and an expiry action
At runtime, event instances that are created using rules are not automatically asserted into working memory. You must explicitly assert such events, for example using the Event.assertEvent() function.Events that are created from incoming messages, on the other hand, are automatically asserted into working memory.
● The parent event’s expiry action (if set). However, an expiry action set in the child event overrides the parent event expiry action.
Events that are related to each other directly or indirectly by inheritance cannot have distinct properties that share a common name. Therefore the following restrictions apply:
● If two events are related by inheritance, you cannot create a new property in one with a name that is already used in the other.
● If two unrelated events have properties that share a name, you cannot create an inheritance relationship between the two concepts.See Message Acknowledgment Timing for Each Object Management Type for details about the timing of message acknowledgements.
● Zero (0): the event expires after the completion of the first RTC cycle. Do not set to 0 if you want to correlate the event with a future event or other future occurrences of this event, as explained below.Set the event’s time to live so that it can trigger the rules you intend. If a rule correlates different events, you must ensure that those event instances are all in working memory concurrently. For example, consider the following example:
● Rule 1 has the condition: eventA.id == eventB.id.
● Rule 2 has the condition: eventC.id != null.
1. BusinessEvents receives eventA. Because there is no eventB in the working memory, eventA doesn’t trigger any rules. BusinessEvents consumes eventA.
2. BusinessEvents receives eventB. Event A has been consumed—there is no eventA in the working memory. So eventB does not trigger any rules. BusinessEvents consumes eventB.
3. BusinessEvents receives eventC. EventC triggers Rule 2 because Rule 2 depends only on eventC.To trigger Rule 1, you must configure the time to live for eventA and eventB to ensure that both events will be in working memory concurrently. You can trigger Rule 1 in these ways:
● If you know that eventA is sent before eventB, set the TTL for eventA to a time greater than the maximum period that can elapse between sending eventA and sending eventB.
● If you don’t know the order in which eventA and eventB are sent, set the TTL for both simple events to a time greater than the maximum time between the occurrence of the two simple events.For each simple event definition, BusinessEvents allows you to specify the action(s) to take when that simple event expires, using the BusinessEvents rule language. For example, you can write an action that routes the simple event to a different destination, sends a message, or creates a new simple event. This action can be anything that is possible with the rule language. An expiry action can be inherited from the event's parent.
BusinessEvents includes two functions that allow you to send simple events out to another application: Event.sendEvent() and Event.routeTo().
● Event.sendEvent() automatically sends the event to its default destination.
● Event.routeTo takes a destination as an argument, ignoring the event’s default destination.With routeTo you can direct an event to a destination on a different channel from the event’s default destination. You can also override the properties of the destination, for example, the subject.You cannot, however, override the properties of the channel, for example, the network field (which is visible in the Channel Configuration tab if you select Properties as the method of configuration).
Copyright © TIBCO Software Inc. All Rights Reserved.