This shows you the differences between two versions of the page.
Next revision Both sides next revision | |||
crime:examples [2007/03/13 17:19] stijnm IN/OUT |
crime:examples [2007/03/13 22:57] stijnm Updated |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== IN/OUT Board ===== | ===== IN/OUT Board ===== | ||
- | The IN/OUT Board is a classical | + | The IN/OUT Board is a classic |
<note warning> | <note warning> | ||
The CRIME distribution contains a script file inout.sh which launches the IN/OUT Board application which internally starts a CRIME engine. The CRIME engine will evaluate the rules specified below. </ | The CRIME distribution contains a script file inout.sh which launches the IN/OUT Board application which internally starts a CRIME engine. The CRIME engine will evaluate the rules specified below. </ | ||
+ | |||
+ | ==== The Rules ==== | ||
+ | |||
+ | The IN/OUT Board consists of an application class which manages the information on which users are located where which is coupled to simple user interface class written in Java. The application also offers a few classes which subclass from the Action class offered by the CRIME engine. These classes can be used in the CRIME rules which specify when the application will be notified of changes in its environment. | ||
+ | |||
+ | The Action class is an abstract class which expects its subclasses to implement two methods: The method '' | ||
+ | |||
+ | The rule below triggers the SetBoard action whenever it detects that a particular person (''? | ||
< | < | ||
: | : | ||
person(? | person(? | ||
- | location(? | + | location(? |
- | phone(?room, ?number). | + | </ |
- | + | ||
- | + | As described in the original paper by [Dey et al.], variations in the functionality of the IN/OUT Board can be conceived where some versions may also display the last known whereabouts of a particular user on the screen. This can be achieved using the '' | |
+ | < | ||
: | : | ||
history(? | history(? | ||
- | |||
- | |||
- | : | ||
- | location(? | ||
- | person(? | ||
- | phone(? | ||
- | notify(? | ||
- | |||
</ | </ | ||
- | The rules above trigger the application events SetBoard, HistoryBoard and Notify. In CRIME all application events are to be prefixed with a colon. | + | |
+ | < | ||
+ | At present, action names in the examples are always fully qualified. The distribution of CRIME does however allow one to | ||
+ | specify the scope of these rules as follows: '' | ||
+ | </ |