Learn R Programming

Rdrools (version 1.0.3)

rulesSession: Creates a session of the rules engine

Description

The rulesSession creates a session that interfaces between R and the Drools engine. The session is utilized by the runRules function for executing a data frame against a set of rules.

Usage

rulesSession(rules, input.columns, output.columns)

Arguments

rules

a character vector consisting of lines read from a rules file of format drl(drools rules file) This character vector is eventually collapsed into a character vector of length 1, so the way you read the file could potentially be just about anything

input.columns

a character vector of a set of input column, for example input.columns<-c('name', 'class', 'grade', 'email')

output.columns

a character vector of a set of expected output columns, for example output.columns<-c('address', 'subject', 'body')

Value

rules.session.object

Returns a session to the rules engine

Details

An active drools rules session. This promotes re-usability of a session, i.e. you can utilize the same session repetitively for different data sets of the same format.

See Also

runRules, Rdrools

Examples

Run this code
# NOT RUN {
library(Rdrools)
data(rules)
input.columns<-c('name', 'class', 'grade', 'email')
output.columns<-c('address', 'subject', 'body')
rules.session<-rulesSession(rules, input.columns, output.columns)
# }

Run the code above in your browser using DataLab