Sometimes when you are writing TEC rules it would be useful to know all the templates or predicates that are available in the version of the TEC you are currently using. This can be accomplished by adding a simple rule into your current rule base which will create an ASCII file which will list all predicates currently available.
Therefore this weeks tip explains this simple procedure.
Create a file called templates.rls and add the following rule into the file.
rule: list_templates:
|
rule_set(templates, 'templates.rls', active).
e.g.
rule_set(templates, 'templates.rls', active).
rule_set(forward, 'forward.rls', active).
rule_set(ov_default, 'ov_default.rls', active).
rule_set(log_default, 'log_default.rls', active).
rule_set(tecad_snaevent, 'tecad_snaevent.rls', inactive).
wcomprules <rule_base>
wloadrb <rule_base>
wstopesvr
wstartesvr
Wait until the templates.txt file stops growing before attempting to open it, you can then view the listing of the templates in the file /tmp/templates.txt.
Part of the templates.txt file is shown below.
forward_event( _event ) :-
|
Once you have the list you can remove the rule from the rule base.