Heinrich G�tzger wrote:
> Hi,
> 
> I'm planning to have a client connected to xmlBlaster which subscribes a
> certain number of messages. This client is able to publish some other
> messages. However the content of these published messages should be
> dependent on the content of the subscribed messages.
> 
> I imagine a list of rules which get the subscribed messages as an input
> and decide whether a certain message have to be published or not or a
> message has to have a certain content.
> 
> This would be like a function: activity is dependent on the airTemperature
> and waterTemperature.
> 
> for example:
> activity(airTemperature, waterTemperature)
> {
>       if airTemperature > 30C
>               if waterTemperature > 25C
>                       return "goSwimming"
>               else
>                       return "orderCoolBeer"
>       else
>               return "orderHotChocolate"
> }
> 
> But to be very flexible, I'd like to change the rules dynamically.

Yes, this is a good idea, i would prefer wodka if
waterTemperature < 5�C

> I.e. all of a sudden I don't like CoolBeer any longer and would prefer
> CoolWhiteWine. Normally the process would be stopped, and a new one can be
> started now. But I need to have a programmer, a compiler and so on. My
> imagination is that the rule can be a message itself. And therefore can be
> published and changed like every other message too.

Yes, handling the rules with messages gives you max. flexibility.

A "bath attendant" can change a rule in a browser
window and configure the system to wodka on the fly ...

> 
> How could I approach this requirement?
> Could it be just another plugin?

Yes and no. You can start the client as a separate
process or embed it natively for better performance
and one process less to handle.

See
  http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.html
and
  xmlBlaster/src/java/org/xmlBlaster/protocol/nativ
for such a plugin.

The other plugin interfaces (authenication interceptor,
mime based publish interceptor and
mime based access interceptor)
are probably not appropriate for this task.

> How could the rules be interpreted?

The Javascript approach with liveconnect (see Micheles mail)
could be a simple and powerful solution.
Every web developer knows the simple Javascript grammar,
and other can learn it in a day.

see

  xmlBlaster/demo/javaclients/svg/rhino/chessRhino.svg

where Michele talks diectly from SVG with xmlBlaster (using Javascript).
(We have the rhino javascript parser in our distribution already).

> 
> Any suggestions, ideas or comments are very welcome.

Probably a rule based language (Lisp?) or some KI stuff
is a better approach - but i don't know anything about this.

A nice GUI which allows the administrator to click the rules
graphically (a decision tree) would be a nice add on.

regards,

Marcel




-- 
Marcel Ruff
mailto:[EMAIL PROTECTED]
http://www.lake.de/home/lake/swand/
http://www.xmlBlaster.org

Reply via email to