Part 06 – A More Complex Data Model Entity Framework and MVC NTPCUG Tom Perkins.
Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state...
Transcript of Entity-Based State Management for Complex Event Processing … · 2011-08-16 · • Complex state...
Entity-Based State Management for Complex Event Processing Applications
Hannes ObwegerUC4 Senactive
RuleML 2011 @ Europe
Sense-and-Respond Infrastructure
24.07.2011 2
… works well for detecting situations of a defined length and structure… faces difficulties when the state of an entity shall be derived from
a stream of low-level, incremental updates
CEP using Event Condition Action (ECA) Rules
24.07.2011 3
> 4h
• Durable entity state– vs. sliding time windows– Specific data management for non-volatile data– Ex-post analysis
• Complex state calculation logic– Goal: Keep rules thin and understandable
• Active entity monitoring– vs. pull-based approach
• Context-aware data access– Integegration with contexts, correlation sets, …
• Ease of use– Accessible to business users
Challenges
24.07.2011 4
• Encapsulate state calculation logic• Manage data as system-wide data structures• Plugged into application• Expose easy-to-use interfaces• Updated and queried using ECA rules
Business Entity Providers
24.07.2011 5
Business Entity Providers
24.07.2011 6
→ Exploit CEP also in entity-centric environments→ Simplify rule logic→ Separation of concerns
• Low-level processing logic, high-level business logic→ Full integration with rule model
• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion
Outline
24.07.2011 7
• Provider per „kind“ of entity– E.g., queues (de facto: sets)
• Generic framework: You may implement a provider in whichever way is appropriate for your purposes– E.g., RDBMS + SQL statements, Hadoop/Cassandra,
Business Rule Engine, …
• BUT: Must adhere to a basic structure
Business Entity Provider Model
24.07.2011 8
• Business Entity Type– E.g., Task queue– Key properties (→ composite key)
• Business Entity– E.g., Task queue #42– Unique, immutable key tuple
• Update and query interfaces– Query properties, update functions
Business Entity Provider Model
24.07.2011 9
Business Entity Provider
Key Property
Business Entity Type1
*
Appl
icat
ion-
Spec
ific
Conf
igur
atio
n
Business Entity
1
* conforms to
Update Function
Query Interface
Query Property*
is derived from
1
11
Update Interface
*
accesses
Appl
icat
ion-
Spec
ific
Even
t Pro
cess
ing
Logi
c
• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion
Outline
24.07.2011 10
• Base Entity– Key → Set of typed entity properties– E.g., Customer– Update / Query: 'setter' and 'getter' for all entity properties
• Scores– Key → Numeric score value– E.g., Alarms per server– Update: set, increment, decrement– Query: current value, aggregates
• Sets– Key → Collection of set elements– E.g., FIFO queue, priority queue, stack– Update: insert, remove– Query: Current set of elements → calculations
Exemplary Business Entity Providers
24.07.2011 11
• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion
Outline
24.07.2011 12
• Separation:
Rule Model: Basics
24.07.2011 13
Event Correlation
Group events that are generally related to each other; e.g., all events of
a transport process
Pattern Detection
From the resulting situations, pick those that are noteworthy;
e.g., all transports longer than 4h
and
Rule Model Basics: Correlation Model
24.07.2011 14
Rule Model Basics: Decision Graph Model
24.07.2011 15
• Event Conditions• Response-Event
Actions• Associated with a
Correlation Set
• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion
Outline
24.07.2011 16
• Generalization: Let users define relations between events, events and business entities, and different kinds of entities
• Events: Correlated based on event attributes• Business Entities: Correlated based on key properties
Rule Model Extensions: Correlation Model
24.07.2011 17
Whenever activated: Update correlated business entities
Rule Model Extensions: Business Entity Action
24.07.2011 18
• Business entity provider• Business entity type• Key property expressions• Update function (e.g., increment)• Function parameter expressions (e.g., 1)
Rule Model Extensions: Business Entity Action
24.07.2011 19
Evaluate a query on all correlated business entitiesa. whenever activated (on-demand access)b. whenever an update occurs (continuous access)
Rule Model Extensions: Business Entity Condition
24.07.2011 20
• Provider, type, key property expressions• Boolean condition (e.g., Value > 100)• Binary connective (all, at least one, exactly one)• Execution mode (on demand vs. continuous)
Rule Model Extensions: Business Entity Condition
24.07.2011 21
Rule Model Extensions: Business Entity Condition
24.07.2011 22
• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion
Outline
24.07.2011 23
Implementation: Basics
24.07.2011 24
• Provided as .NET assemblies• Referenced in an XML file• On start up: Parsed by SARI, instantiations
Business Entity ProviderImplementations
SARI
Implementation: On Demand Access
24.07.2011 25
• Added to globally accessible provider management service• Called directly and synchronously from rule services
Implementation: Continuous Access
24.07.2011 26
On start up: Register as listener at provider management1. Update occurs2. Special notification event is sent to all registered services3. Use basic correlation mechanism to active decision graph4. Evaluate key property expressions5. Evaluate query as with on-demand access
• Introduction• Business Entity Provider Model• Exemplary Business Entity Providers• Rule Model: Basics• Rule Model: Extensions• Implementation• Conclusion
Outline
24.07.2011 27
• Novel approach to state management for ECA-based CEP• Business Entity Providers
– Encapsulate custom state-calculation logic– Plugin-based implementation model– Fully integrate with SARI rule model
• Durability entity state, comple state calculation • Active entity monitoring • Context-aware data access • Ease of use
Conclusion
24.07.2011 28
Thanks for your attention!
24.07.2011 29