Apama 10.3 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Legacy Finance Interfaces | Understanding event protocols
 
Understanding event protocols
Apama EPL follows the actor model of asynchronous computation. The actor model is based on humans: Humans are actors and events represent the exchange of words and deeds between them. Similarly, each monitor instance plays the role of actor and events are passed as messages. Thinking about event protocols in this way will help you understand them more intuitively.
For example, suppose we model an election in Apama EPL. The actors would include:
*The nominators of candidates
*The candidates
*The voters
*The vote counters
*The independent election monitors
Necessary messages to pass between these actors might include:
*It is time to nominate candidates
*I nominate candidate X
*I, candidate X, will/will not run as a candidate
*The time for nominations has passed
*The time to vote has begun
*I vote for X
*The time to vote has ended
*The winner is X
*The election was unfair and is void
This immediately gives you a feel for the interaction, but additional rules are required to conform to electoral process:
1. Temporal Rules - When can events be sent?
*The winner cannot be declared until all the votes have been tallied.
*Votes cannot be cast after the election has closed and the result cannot be determined until the election has closed.
*Candidacy acceptance/rejection must follow a nomination
2. Authority Rules - Who can send and receive which events?
*The independent monitors cannot themselves vote.
*Voters cannot pass their votes to anyone other than the counters.
*Only actors nominated can accept/reject candidacy.
3. Cardinality Rules - How many events of each type will be sent?
*At most one vote can be cast per voter.
*At most one winner can be declared.
*Either one acceptance or rejection of candidacy will be sent in response to each nomination.
4. Value Constraint Rules - What content can be sent in events?
*You cannot vote for a candidate that was not nominated, or that did not accept the candidacy.
*The winner must be one of the actors who accepted a nomination.
Especially for Capital Markets applications, an understanding of these four types of rules is fundamental to understanding Apama EPL protocol. It is not enough to have the event definitions and to know the actors.

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.