Apama 10.3 | Apama Documentation | Developing Apama Applications | Developing Apama Applications in Event Modeler | Overview of Using Event Modeler | Basic view of rule processing
Basic view of rule processing
Expanded view of rule processing
Scenario monitoring stage
Summary of adding rules when a variable value changes
Consider the set of rules shown in this screen.
This example scenario has four variables, called Variable1 (number), Variable2 (text), Variable3 (condition) and Message (text). These variables could have any value when execution enters NewState 1. Their initial values would normally have been set by a user on creation of the scenario instance, or else they could have been set and modified by some rule in the start state.
Consider NewState 1, which specifies four rules. When the scenario instance's execution first enters NewState1, its rules will be processed as follows:
1. New Rule 1 will be examined first.
2. If the value of Variable1 is less than 10 then its condition will be true, its action part will be processed, and this will move the scenario's execution to NewState 2 right away. New Rule 2, New Rule 3 and New Rule 4 will be ignored, and the rest of the steps outlined here would not apply.
3. If the value of Variable1, however, was greater than or equal to 10, then the condition of New Rule 1 will be false. In this case, New Rule 2 will be examined.
4. In New Rule 2, if Variable1 was actually greater than 20, then the action part of New Rule 2 gets processed, and this time the scenario moves to NewState 3. New Rule 3 and New Rule 4 will be ignored. No further steps apply.
5. On the other hand, in New Rule 2, if the condition was false, we move to New Rule 3.
6. In New Rule 3, if the value of Variable3 was false, then not Variable3 would be true, and the condition of New Rule 3 would be true. In this case, Message would get set to the text “Hello”. Since the state transition statement is continue, then New Rule 4 will be processed.
7. Had the condition of New Rule 3 been false, Message would not get set to the text “Hello”. However, New Rule4 would have been processed anyway.
8. The condition of New Rule 4 checks whether Variable2 contains the text “World”. If so, execution proceeds to the end state. If not, then all rules would have been processed and the scenario would go into a monitoring stage. This will be described later.
This illustrates the way in which rules are processed, in order, from top to bottom.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.