crime:examples
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
crime:examples [2007/03/13 17:19] – IN/OUT stijnm | crime:examples [2007/03/29 23:06] (current) – Updated stijnm | ||
---|---|---|---|
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> | + | ==== Deploying the application |
- | The CRIME distribution contains a script file inout.sh which launches | + | |
+ | The CRIME distribution contains a script file '' | ||
+ | |||
+ | <code> | ||
+ | cd crime-1.0.0/ | ||
+ | ./server.sh & | ||
+ | ./ | ||
+ | </code> | ||
+ | |||
+ | ==== 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(? | + | </ |
- | + | ||
- | + | ||
- | : | + | |
- | history(? | + | |
- | + | ||
- | : | + | 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 '' |
- | location(?id, ?room), | + | < |
- | person(?id, ?name, ?type), | + | : |
- | phone(?room, ?number), | + | |
- | notify(? | + | history(?name, ?room, ?phone, ?time). |
- | + | ||
</ | </ | ||
- | The rules above trigger | + | |
+ | < | ||
+ | In the code snippets given above, the action names are fully qualified. The distribution of CRIME does however allow one to | ||
+ | specify the scope of these rules as follows: '' | ||
+ | </ |
crime/examples.1173802788.txt.gz · Last modified: 2007/03/13 22:57 (external edit)