Skip to main content

Pentaho+ documentation has moved!

The new product documentation portal is here. Check it out now at docs.hitachivantara.com

 

Hitachi Vantara Lumada and Pentaho Documentation

Use the Build Model job entry for SDR

Parent article

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 upon which to base your model, or you can select an existing Data Source Wizard or Analyzer model from the Pentaho Server. Note that if you are using a data service as the source in your Build Model job entry, you must be connected to a Pentaho Repository to successfully publish your model.

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

A Build Model job entry builds the model and sets variables into the job that can be modified or picked up by the Publish Model job entry. An example workflow is shown below.

SDR basic workflow

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

Create a Build Model job entry

Before you begin

This task assumes you are in the job canvas of the PDI client.
Use the Build Model job entry to create a model for publishing directly to the Pentaho Server.

Procedure

  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 job entry
  2. Double-click the Build Model icon to open the Build Model dialog box.

  3. Enter a name for the entry in the Entry name field.

    NoteThe following characters are not valid in Data Source Wizard source names:
    % ? : [] * \t \r \n
  4. In the Source field, select an output step or a Pentaho Data Service from the drop-down menu, or press CTRLSpace 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.
    NoteWhen 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 Pentaho Data Services for more information about data services.
  5. Enter a name for your data model in the Model Name field. Optionally, click in the field and press CTRLSpace to select a variable.

    The model name entered here will appear in the list of data sources in the Pentaho Server.
  6. In the Modeling Method section, you can select the modeling method for the entry.

    • Auto Model if you want to build a new model. When you choose to auto model, your annotations will be applied to the model when it is opened in Analyzer.
    • Use Existing if you want to base your model on one which already exists in the Pentaho Server. Click the Select button below to enter the name of an existing model from the server in the required field. See Select existing model options. When you use an existing model, your annotations will not be applied to the model when it is opened in Analyzer.
    NoteWhen 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.
  7. Click OK to save your changes and close the dialog box, or click Cancel to discard your changes and close the dialog box.

Select existing model options

If you selected to use an existing model to build upon, you will need to be connected to the Pentaho Server. Once you are connected, you can select an existing model with the same physical schema to base your new model on.
NoteIf 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.

Procedure

  1. Fill in or edit the fields in the Pentaho Server Connection section.

    FieldDescription
    URLThe base URL string used to connect to the server.
    User NameThe user name required to access the server.
    PasswordThe password associated with the provided user name which is passed during the authentication process.
  2. 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.
  3. Select a model from the Existing Models drop-down menu.

    If no models are listed, verify that you are connected to the Pentaho Server.
  4. (Optional) 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.

  5. 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. Select Existing Model dialog box

Variables for Build Model job entry

These variables are generated when the model is created. You can only see these specific variables for the Build Model job entry if you press CTRLSpace 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.

VariableVariable TypeDefinition
JobEntryBuildModel.DatabaseConnection.<Model Name>StringReturns 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>StringReturns all the contents of the XML file published on the Pentaho 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 data source. Typically, when this is 'true', we only generate the DSW data source and no other contents.