HeaRTDroid

HeaRTDroid is a rule-based inference engine both for Android mobile devices, and desktop solutions

User Tools

Site Tools


pub:software:heartdroid:tutorials:callbacks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
pub:software:heartdroid:tutorials:callbacks [2016/12/28 13:22]
admin [Compile and run]
pub:software:heartdroid:tutorials:callbacks [2016/12/29 06:42]
admin [Actions]
Line 94: Line 94:
  
 ===== Actions ===== ===== Actions =====
 +Actions are based on the same concept as Callbacks.
 +There are several differences though:
 +  * Actions are associated with rules and are fired when the rule fires
 +  * Each rule may have severl actions assigned
 +  * Actions should implement Action interface, instead of Callback interface
 +  * Action cannot modify the state of attributes, although have insight into the current state of the system (current values of all the attributes from the model)
 +
 +To add an action to your rule, use the ''<​nowiki>​**></​nowiki>''​ operator, like in the listing below:
 +<​code>​
 +xrule parkingReminder/​1:​
 +  [
 +     ​location eq pay_zone,
 +     ​tariff eq pay
 +  ]
 +  ==>
 +  [
 +     ​notification set start_parking_fee
 +  ]
 +  **>
 +  [
 +    '​ShowNotification',​
 +    '​StartPayment'​
 +  ].#1
 +</​code>​
 +
 +
 +
  
  
  
pub/software/heartdroid/tutorials/callbacks.txt ยท Last modified: 2019/04/10 06:54 (external edit)