Class

Rules

Rules(props) → {React.Component}

Overview

The rules tab in RuLeStudio. Presents the list of all rules generated for information table from current project.
Constructor

# new Rules(props) → {React.Component}

Parameters:
Name Type Description
props Object
objectGlobalName string

The global visible object name used by all tabs as reference.

onDataUploaded function

Callback fired when tab receives information that new data was uploaded.

onRulesUploaded function

Callback fired when tab receives information that rule set was uploaded.

onTabChange function

Callback fired when a tab is changed and there are unsaved changes in this tab.

project Object

Current project.

serverBase string

The host and port in the URL of an API call.

showAlert function

Callback fired when results in this tab are based on outdated information table.

value number

The index of a selected tab.

View Source Body/Project/Tabs/Rules.js, line 50

React.Component

Methods

# static getRules()

Overview

Makes an API call on rules to receive current copy of rule set from server. Then, updates state and makes necessary changes in display.

View Source Body/Project/Tabs/Rules.js, line 89

# static onCalculateClick()

Overview

Makes an API call on rules to generate new rule set from current information table and parameters. Then, updates state and makes necessary changes in display.

View Source Body/Project/Tabs/Rules.js, line 274

# static onFilterChange(event)

Overview

Filters items from Rules' state and then sorts them if any order was declared. Method uses filterFunction to filter items.
Parameters:
Name Type Description
event Object

Represents an event that takes place in DOM.

View Source Body/Project/Tabs/Rules.js, line 549

# static onSaveRulesToTXTClick()

Overview

Makes an API call to download current rule set in TXT format.

View Source Body/Project/Tabs/Rules.js, line 483

# static onSaveRulesToXMLClick()

Overview

Makes an API call to download current rules set in XML format.

View Source Body/Project/Tabs/Rules.js, line 467

# static onSortChange(items)

Overview

Sorts provided items and saves results in Rules' state. Method uses simpleSort function to sort items.
Parameters:
Name Type Description
items Array.<Object>

A list of objects that will be sorted.

View Source Body/Project/Tabs/Rules.js, line 604

# static onUploadFileChanged(event)

Overview

Makes an API call on rules to upload user's rule set. Then, updates states and makes necessary changes in display.
Parameters:
Name Type Description
event Object

Represents an event that takes place in DOM.

View Source Body/Project/Tabs/Rules.js, line 361

# static updateAlerts(validityRulesContainer)

Overview

Used when changes in Rules had an impact on results in Unions or Classification. Updates classification and unions in current project, makes necessary changes in display.
Parameters:
Name Type Description
validityRulesContainer Object

The part of response from server

View Source Body/Project/Tabs/Rules.js, line 438

# componentDidMount()

Overview

A component's lifecycle method. Fired once when component was mounted.

Goal

Method calls getRules.

View Source Body/Project/Tabs/Rules.js, line 163

# componentDidUpdate(prevProps, prevState, snapshot)

Overview

A component's lifecycle method. Fired after a component was updated.

Goal

If type of unions was changed to monotonic and consistency threshold is equal to 1, method changes value of threshold to 0.

If type of rules was changed to possible, method changes consistency threshold to 0.

If project was changed, method saves changes from previous project and calls getRules to receive the latest copy of rule set.
Parameters:
Name Type Description
prevProps Object

Old props that were already replaced.

prevState Object

Old state that was already replaced.

snapshot Object

Returned from another lifecycle method getSnapshotBeforeUpdate. Usually undefined.

View Source Body/Project/Tabs/Rules.js, line 190

# componentWillUnmount()

Overview

A component's lifecycle method. Fired when component was requested to be unmounted.

Goal

Method saves changes from current project.

View Source Body/Project/Tabs/Rules.js, line 245