ilog.rules.dvs.core

Interface IlrScenarioProvider

  • All Superinterfaces:
    IlrInitializable
    All Known Subinterfaces:
    IlrParallelScenarioProvider, IlrRBTScenarioProvider
    All Known Implementing Classes:
    IlrExcel2003ScenarioProvider, IlrRBTScenarioProviderBase


    public interface IlrScenarioProvider
    extends IlrInitializable

    Scenario providers retrieve the input data for your tests and simulations from a custom data source.

    Overview

    You can create custom scenario providers, for example to access scenarios from a database.

    The ilog.rules.dvs.core package description gives more information on scenarios, scenario providers, and how they interact with IlrScenarioSuiteResourcesRenderer.

    Example

    The following code example shows how to define a scenario provider that reads the input parameters from a derby database. Database management is delegated to the DatabaseApi class.

    This class gets from the database all scenarios with borrowers having an income inferior to a given parameter.

     public class HistoricalScenarioProvider implements IlrScenarioProvider {
     protected DatabaseApi  m_databaseApi;
    
     // This function gets from the context the user given maximum income and
     // initializes the DatabaseApi instance with this parameter.
     public void initialize(IlrScenarioSuiteExecutionContext arg0) {
         IlrScenarioSuiteDescriptor desc = arg0.getScenarioSuiteDescriptor();
         Object o = desc.get("maxIncome");
         String maxIncome = "90000" ;
         m_databaseApi = new DatabaseApi();
         if (o != null) 
              maxIncome = new String(((byte[])desc.get("maxIncome")));
         m_databaseApi.initialize(maxIncome);
     }
    
     public void close() {
          m_databaseApi.close();
     }
    
     public int getScenarioCount() {
         return m_databaseApi.getCount();
     }
    
     public IlrScenario getScenarioAt(int indx) throws IlrScenarioProviderException {
          if (indx > getScenarioCount())
              throw new IlrScenarioProviderException("index " + indx + " is  out of range");
          return  m_databaseApi.getNextScenario();
     }
    
     public DatabaseApi getDatabaseApi() {
        return m_databaseApi;
     }
    }
     

    About the DVS API

    Decision Validation Services provides business rule testing and simulation solutions to developers and business users.

    You use the DVS API to:

    • Run an existing scenario suite (a test suite or simulation).
    • Create key performance indicators (KPIs) to display the business outcomes of simulations.
    • Customize the scenario providers, which determine how input data is provided to the test & simulation engine for execution.
    • Read and write test and simulation data using the default Excel 2003 formats.
    Since:
    7.0
    • Method Detail

      • getScenarioCount

        int getScenarioCount()
                             throws IlrScenarioProviderException
        Returns the number of scenarios contained in this provider.
        Throws:
        IlrScenarioProviderException - if an error occurs computing the scenario number.
        Returns:
        The number of scenarios contained in this provider.
      • close

        void close()
        Closes the scenario provider.

© Copyright IBM Corp. 1987, 2017