Initializing help system before first use

ScenarioProperties

Contains information about a scenario and provides methods to load and execute it

Method summary

name description
cancel Cancel any execution of this scenario.
execute Submits this scenario for execution.
getAppId The ID of the app this scenario belongs to.
getCreationDate The date this scenario was created.
getCurrentExecutionStatus Gets the current execution status of this scenario.
getId The ID for this scenario.
getModelSchema The model's schema for this scenario.
getName The name of this scenario.
getNotes The notes associated with this scenario.
getOwnerId The username of the user that owns this scenario.
getPath The path to this scenario in the Insight Repository.
getProjectId Use ScenarioProperties#getAppId instead.
getScenarioType The type of this scenario.
getShareStatus The share status of this scenario.
setNotes Set notes on this scenario.
setOwnerId Change the ownership of this scenario.

Methods

method
cancel ( ) → {Promise}

Cancel any execution of this scenario.

details
Returns:
returns table
Type Description
type
Promise
promise, resolves when the scenario is successfully cancelled, or the scenario is not in the execution queue
Example
examples
var cancelledPromise = scenario.cancel();

cancelledPromise
     .then(function () {
         // at this point scneario has been cancelled.
     })
     .catch(function (err) {
         // scenario failed to cancel
     });
Back to Top
method
execute ( executionMode, options ) → {Promise}

Submits this scenario for execution, either to load the input data of a scenario, or to run it.

Parameters:
params
Name Type Argument Default Description
executionMode
type
string
optional  insight.enums.ExecutionType.RUN the mode of execution to perform
options
type
Object
optional  execution options
Properties
params
Name Type Argument Description
suppressClearPrompt
type
boolean
optional  whether, on using an execution mode that clears input data, to suppress the confirmation prompt
details
Returns:
returns table
Type Description
type
Promise
promise, resolves when the scenario is successfully queued for execution
Example
examples
var runPromise = scenario.execute(insight.enums.ExecutionType.RUN, 'SLOW');
runPromise
     .then(function () {
         // scenario has been queued for execution
     })
     .catch(function (err) {
         // scenario could not be executed.
     });
Back to Top
method
getAppId ( ) → {string}

The ID of the app this scenario belongs to.

details
Returns:
returns table
Type Description
type
string
The ID of the app this scenario belongs to
Example
examples
var appId = scenario.getAppId();
Back to Top
method
getCreationDate ( ) → {Date}

The date this scenario was created.

details
Returns:
returns table
Type Description
type
Date
The date this scenario was created
Example
examples
var creationDate = scenario.getCreationDate();
Back to Top
method
getCurrentExecutionStatus ( ) → {Promise.<ScenarioExecutionStatus>}

Gets the current execution status of this scenario.

details
Returns:
returns table
Type Description
type
Promise.<ScenarioExecutionStatus>
promise containing the current execution status
Example
examples
var statusPromise = scenario.getCurrentExecutionStatus();
statusPromise
     .then(function (status) {
             // status available here
         });
Back to Top
method
getId ( ) → {string}

The ID for this scenario.

details
Returns:
returns table
Type Description
type
string
The ID for this scenario
Example
examples
var scenId = scenario.getId();
Back to Top
method
getModelSchema ( ) → {ModelSchema}

The model's schema for this scenario.

details
Returns:
returns table
Type Description
type
ModelSchema
The model's schema for this scenario
Example
examples
var modelSchema = scenario.getModelSchema();
Back to Top
method
getName ( ) → {string}

The name of this scenario.

details
Returns:
returns table
Type Description
type
string
The name of this scenario
Example
examples
var name = scenario.getName();
Back to Top
method
getNotes ( ) → {string}

The notes associated with this scenario.

details
Returns:
returns table
Type Description
type
string
The notes associated with this scenario
Example
examples
var notesTxt = scenario.getNotes();
Back to Top
method
getOwnerId ( ) → {string}

The username of the user that owns this scenario.

details
Returns:
returns table
Type Description
type
string
The username of the user that owns this scenario
Example
examples
var username = scenario.getOwnerId();
Back to Top
method
getPath ( ) → {string}

The path to this scenario in the Insight Repository.

details
Returns:
returns table
Type Description
type
string
The path to this scenario in the Insight Repository
Example
examples
var pathString = scenario.getPath();
Back to Top
method
getProjectId ( )
details
  • Deprecated since Js Api 4.5
Back to Top
method
getScenarioType ( ) → {insight.enums.ScenarioType}

The type of this scenario.

details
Returns:
returns table
Type Description
type
insight.enums.ScenarioType
the type of this scenario
Example
examples
if (scenario.getScenarioType() === insight.enums.ScenarioType.SCENARIO) {
     // do something if this scenario has type 'SCENARIO'
}
Back to Top
method
getShareStatus ( ) → {insight.enums.ShareStatus}

The share status of this scenario.

details
Returns:
returns table
Type Description
type
insight.enums.ShareStatus
The share status of this scenario
Example
examples
if (scenario.getShareStatus() === insight.enums.ShareStatus.FULLACCESS) {
     // do something if share status is 'FULLACCESS'
}
Back to Top
method
setNotes ( notes ) → {Promise}

Set notes on this scenario.

Parameters:
params
Name Type Description
notes
type
string
Notes to set against the scenario
details
Returns:
returns table
Type Description
type
Promise
Promise object
Example
examples
scenario
     .setNotes('A short note about this scenario')
     .then(function () {
         // notes have been set.
     })
     .catch(function () {
         // notes could not be set.
     });
Back to Top
method
setOwnerId ( newOwnerId ) → {Promise}

Change the ownership of this scenario.

Parameters:
params
Name Type Description
newOwnerId
type
string
the username of the new owner for this scenario
details
Returns:
returns table
Type Description
type
Promise
Promise object
Example
examples
scenario
     .setOwnerId('userid')
     .then(function () {
         // ownership has changed.
     })
     .catch(function (err) {
         // ownership could not be changed.
     });
Back to Top

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.