DataManager

  • Updated

Provides access to Inline Tables and Value Lists. This is accessed via the RuleSession.

getValueList(name, version, queryParameters) Returns: ValueList

Parameters:

name

Type: string

The name of the ValueList instance to return

version

Type: string

If the value list is a Query Value List and the List Source is an InlineTable, the version name is used to determine what version of the table to use. If it's null the default version is used.

If the value list is a Query Value List and the List Source is a SQL Query, the version name is used to determine what version of the inline table the query will be executed against. If it's null the default version is used.

queryParameters

Type: array of PassThruQueryParameter

This parameter, an array of PassThruQueryParameters, is only needed if the value list is a Query Value List and the List Source is an SQL Query and has Passthru Parameters. If Passthru parameters are required but not provided, an exception will be thrown.

Description:

Returns the ValueList specified

Code Sample:

var session = inrule.createRuleSession(); 
var dataManager = session.dataManager; var valueList = dataManager.getValueList("ValueList1");

 

getInlineTable(name, versionName) Returns: Array of object

Parameters:

name

Type: string

The name of the Inline Table to return

 versionName

Type: string

The version name of the Inline Table requested

Description:

Returns the inline table specified by name and optionally by version name. In InRule for JavaScript, Inline Tables are represented by an Array of objects, each object has a field

Code Sample:

var session = inrule.createRuleSession(); 
var dataManager = session.dataManager; var valueList = dataManager.getInlineTable("InlineTable1");

 

createPassThruQueryPar ameter(name, value) Returns: PassThruQueryParameter

Parameters:

name

Type: string

The name of the query parameter

 value

Type: string

The value of the query parameter

Description:

Returns a PassThruQueryParameter to be used when calling getValueList.

Code Sample:

var session = inrule.createRuleSession(); 
var dataManager = session.dataManager; var parameter = dataManager.createPassThruQueryParameter("Parameter1", "1");

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.