Skip to main content
Pentaho Documentation

Using the Build Model Job Entry for SDR


The Build Model job entry can be used to create Data Source Wizard data sources, which includes both a Metadata and a Mondrian model. It works by searching upstream for an output step or data service to base the model on, or you can select an existing DSW or Analysis model from the BA Server to base your model on. Note that if you are using a data service as the source in your Build Model job entry, you must be connected to a DI repository to successfully publish your model.

After you have run this job entry, a data model is created and can be published to the BA Server for the creation of Analysis reports in the Pentaho User Console. Business users will also be able to refine the data model with the Data Model Editor. If you selected an Analysis model to build from, the Build Model job entry will only create an Analysis model.

These are the operations that happen during the Build Model job entry.

  1. Builds the model.
  2. Sets variables into the job that can be modified or picked up by the Publish Model job entry.

Here is an example workflow.


After the Build Model job runs successfully, you can publish the data source to the BA Server.

Creating a Build Model Job Entry

Use the Build Model job entry to create a model for publishing directly to the BA Server. This task assumes you are in the Job canvas in Spoon.

  1. In the Design tab, click the Modeling folder, and then double-click the Build Model job entry. Alternatively, you can drag the job entry icon on to the job canvas.

Build Model Icon

  1. Double-click the Build Model icon to open the Build Model dialog box.
  2. Enter a name for the entry in the Entry Name field.

The following characters are not valid in Data Source Wizard source names: '%', '/', ':', '[]', '*', '\t', '\r', '\n'.

  1. In the Source field, select an output step or a Pentaho Data Service from the drop-down menu, or press CTRL + Space to select a variable. The selected output step or data service provides the source data in the model. If no data is written to the table by the selected source, then the Build Model job entry will not build a model.

When you select a Pentaho Data Service as the source, previously defined link dimensions will not be linked to your model. Link dimension annotations are dependent on shared dimensions, and shared dimensions cannot use a data service for their source. See Connecting to a Pentaho Data Service for more information about data services.

  1. Enter a name for your data model in the Model Name field. Optionally, click in the field and press CTRL + Space to select a variable. The model name entered here will appear in the list of data sources in the BA Server.
  2. In the Modeling Method section, you can choose either Auto Model or Use Existing for the entry.
    • Select Auto Model if you want to build a new model. Note that when you choose to auto model, your annotations will be applied to the model when it is opened in Analyzer.
    • Select Use Existing if you want to base your model on one which already exists in the BA Server. Click the Select button below to enter the name of an existing model from your BA server in the required field. See Selecting Existing Model Options. Note that when you use an existing model, your annotations will not be applied to the model when it is opened in Analyzer.

When you select Auto Model and you have modified a measure in Analyzer, the inline model editing changes you made in Analyzer will take priority over any annotations added to the measure in PDI. In addition, annotations you add in PDI will not be visible for that measure when viewed in Analyzer.

  1. Click OK to save your changes and close the dialog box, or click Cancel to discard your changes and close the dialog box.

Selecting Existing Model Options

If you selected to use an existing model to build upon, you will need to be connected to the BA Server. Once you are connected, you can select an existing model with the same physical schema to base your new model on.

If you select Use Existing, your annotations are not applied to the model when it is opened in Analyzer. If you want to apply your annotations to the model in Analyzer, select Auto Model.

  1. Fill in or edit the fields in the BA Server Connection section.
Field Description
URL The base URL string used to connect to the server.
User Name The user name required to access the server.
Password The password associated with the provided user name which is passed during the authentication process.
  1. Click the Connect button to connect to the server using the information provided in the above fields. If the connection was successful, the Existing Models drop-down menu will be available for selection with a list of models to choose from.
  2. Select a model from the Existing Models drop-down menu. If no models are listed, verify that you are connected to the BA Server.
  3. Optionally, select the Create model if not found check box to generate a model if the system cannot find an existing model with the entered name.
  4. When finished, click OK to save your changes and close the dialog box, or Cancel to close the dialog box without saving your changes.

This is an example of the Select Existing Model dialog box.



Variables for Build Model Job Entry

These variables are generated when the the model is created. You can only see these specific variables for the Build Model job entry if you press CTRL + Space after the first run.

You can use these variables to know more about the model you created. For example, if you have scheduled a job to run at regular intervals, you can include these variables in the Mail job entry to alert you to any issues during the run.

Variable Variable Type Definition
JobEntryBuildModel.DatabaseConnection.<Model Name> String Returns the name of the database connection used by the transformation on the Source. This connection information is specified in the Build Model job entry.
JobEntryBuildModel.XMI.<Model Name> String Returns all the contents of the XML file published on the BA Server. (It may or may not contain the OLAP components.)
JobEntryBuildModel.XMI.DSW.<Model Name> Boolean (True or False) Indicates if the XMI should be delivered as a Data Source Wizard (DSW) data source. Typically, when this is 'true', we only generate the DSW data source and no other contents.