Skip to content
mvankeulen edited this page Oct 2, 2013 · 4 revisions

TODO: incomplete

Debugging ECA rules

The primary means for debugging ECA rules is the action print. With this action, you can display the value of any expression in the Python console. For example,

EVENT: new_tweet
ACTION: ntweets+=1
   print('Value of ntweets: '+str(ntweets))

This displays the value of the variable ntweets each time it is increased, i.e., at every incoming tweet.

Debugging gadget definitions and updating

Typically, you would want to add options to a CELL definition one-at-a-time, because if there is something wrong with only one option in a CELL definition, then the entire gadget doesn’t display anymore. It is therefore hard to find the culprit.

A good way of avoiding such problems, is to start with one of the existing examples from the HighCharts documentation. In this way, you have a good set of options to start with that should function properly.

DECLARE dv = debug_publish(true)

This sets a debug switch to on/off which displays all messages sent from the ECA rule engine to the browser. You have to set it before the CELL definitions to see their initialization messages.

You can also use the Javascript console or other kinds of web development tools of your browser to get an idea of what is happening.