This feature is new in Q 4.8.
RulesManager
Allows you to create new
Rule objects, or replace and reorder them. This object is always accessed via
project.rules. The order of rules is fixed for the entire project, and can only be adjusted here. To determine the parameters required for rules in the functions below, use Q to build a rule and click the QScript button.
list
Lists all rules applied to items in this project.
Returns: | An array of Rule objects. |
moveAfter(to_move, after)
Reorders Rules applied to items in the project.
to_move | The rule to move. |
after | The rule after which it should be placed, or null to indicate it should be placed first. |
newBuiltIn(rule_name, parameters)
Creates a new Rule, ready for adding to a table using table.rules.add(). Find the parameters for this function by creating the appropriate rule in Q and clicking on the QScript button.
rule_name | Q's internal name for the rule. |
parameters | An object containing any required parameters, with their values. Use null if no parameters are needed. |
Returns: | A new Rule object. |
Example: | project.rules.newBuiltIn('CellsContain', {relationship: 'less than', value1: 20});
|
newCustomRule(java_script, parameters)
Creates a new Rule from Table JavaScript source code. Find the parameters for this function by creating the rule in Q and clicking on the QScript button.
java_script | The source code for the rule. |
parameters | An object containing any required parameters, with their values. Use null if no parameters are needed. |
Returns: | A new Rule object. |
newFromLibrary(title, parameters)
Creates a new Rule by loading it from the online library. Find the parameters for this function by creating the rule in Q and clicking on the QScript button.
title | The title of the rule in the online library. |
parameters | An object containing any required parameters, with their values. Use null if no parameters are needed. |
Returns: | A new Rule object. |
replace(old_rule, new_rule)
Replaces a Rule with a new one. The new rule will be applied to all the tables and plots that the old one was applied to, and will be in the same position.
old_rule | A Rule object that is applied to some tables or plots in the project. |
new_rule | A new rule to replace it. |
type
Returns the name we use to refer to this class in the documentation.