Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 23 Next »

Engine Compatibility

This library has not yet been ported to the New Pico Engine. However, the pico engine currently recognizes these:

  • meta:eci  the event channel identifier on which the current event was raised
  • meta:rid  the ruleset ID of the currently running ruleset
  • meta:picoId  the ID of the currently running pico
  • meta:rulesetName  the name from the meta section of the current ruleset
  • meta:rulesetDescription  the description from the meta section of the current ruleset
  • meta:rulesetAuthor  the author from the meta section of the current ruleset
  • meta:rulesetURI  the URL from which the currently running ruleset was registered/installed
  • meta:ruleName  the name of the rule currently being evaluated
  • meta:host – the public DNS name of the machine running the engine, including port number
  • meta:inEvent is true when running in response to an event
  • meta:inQuery  is true when running in response to a query

Notice that these are values, and not functions


The meta library provides information about the running ruleset. The following functions are available:

  • meta:rid() - returns the ruleset ID of the current running ruleset.
  • meta:version()-returns the version of the currently running ruleset.
  • meta:callingRID()- returns the RID of the calling ruleset if running in a module, or the current ruleset ID otherwise.
  • meta:callingVersion()- returns the version of the calling ruleset if running in a module, or the current ruleset version otherwise.
  • meta:moduleRID()- returns the RID of the module if running in a module, or the current ruleset ID otherwise.
  • meta:moduleVersion()- returns the version of the module if running in a module, or the current ruleset version otherwise.
  • meta:inModule()- returns a Boolean value indicating whether the current code is running in a module.
  • meta:host() - returns the hostname of the rules engine evaluating the ruleset. Note: this is the public name, not the individual machine name. 
  • meta:rulesetName() - returns the name from the meta sections of the current ruleset
  • meta:rulesetAuthor() - returns the author from the meta sections of the current ruleset
  • meta:rulesetDescription() - returns the description  from the meta sections of the current ruleset
  • meta:ruleName() - returns the names of the rule being evaluated. 
  • meta:eci() - returns the event channel identifier on which the current event was raised
  • meta:errorCount() - returns the number of errors for current rule execution. Reset to 0 for each new rule execution. 
  • meta:txnId() - return the transaction ID for the current evaluation. This is mostly useful for debugging. 

Note, in the case of meta:moduleRID(), meta:moduleVersion(), and meta:inModule(), care has been taken to preserve static behavior. So, for example, if you do the following, you should get the result you expect based on static function semantics:

ruleset my_module {
 
  ...
  global {
    myRid = function() { meta:moduleRID() }
  }
}
 
ruleset use_my_module {
  meta {
    use module my_module
  }
  global {
    x = my_module:myRid();
    // x = my_module, not use_my_module
  }
}



  • No labels