GetFromString Method (.NET)

The GetFromString method returns a RuleEngine instance based on the XML data in the string passed into this method.   The same RuleEngine instance can be used simultaneously in multiple threads. This method is useful if the XML rules are obtained from a place other than a file, such as a database.

There is a robust backing cache so calling this method frequently is fine.  However, for the best performance, consider caching your database call that is responsible for obtaining the XML string passed into this method.

 

Syntax:

RuleEngine engine = RuleEngine.GetFromString(string xmlAsString);

xmlAsString: The XML that contains the rules to be executed.  The XML must conform to the RET file format standards, as specified in the Rules Enforcement Technology Users Guide (distributed separately).

 

Returns:

engine: A RuleEngine instance ready for execution.

 

C# Example:

        <%

        ...

        RuleEngine engine = RuleEngine.GetFromString("<tests> <test id='browser' name='Browser Check'><pass>...");

        ...

       %>

 

Tip: See the numerous RET samples included with BrowserHawk and the Rules Enforcement Technology Users Guide (available separately) for more information.

 

Note: This method requires the Enterprise Edition of BrowserHawk.

 

See Also:

GetDataSet Method (.NET)

RuleEngine GetExtendedOptions Method (.NET)

GetFromFile Method (.NET)

GetLogOptions Method (.NET)

GetResult Method (.NET)

About the RuleEngineResult Class

About the RuleEngine Class

About Rule Enforcement Technology (RET)