When a Scripted Loader or Scripted Data Source includes parameters, those parameters are normally passed to Pentaho as environment variables. Version parameters cannot be passed to Pentaho as environment variables. You must pass version parameters to the agent as dimension parameters. Once a dimension parameter for a version is created, you can over ride it at runtime, making it possible to choose from a list of versions.
- Create a new Dimension Parameter within the Scripted Data Source.
- Give the parameter a display name like “Planning Version to Load.”
- Select the member to be within the chosen dimension. Selecting the top level node of the Version dimension is the same as selecting the Default planning version dimension value.
- The data designer can associate the dimension parameter with specific scripted loaders and specific scripted data sources by dragging the parameter into the Parameters area of the canvas for them.
- If a scripted data source has a dimension parameter associated with it, when a user clicks Import Data in the Data Designer screen, they will be prompted with the selected member from step 3. The default value can be overridden by choosing a different version. The same behavior exists on the Integration Operator launch task screen within Adaptive Integration.
- if the selected dimension is the Planning Version then a special value “[Default Version]” will be included. This means use the planning application’s currently selected default version. The “folder” style members from the dimension tree cannot be selected if the Planning Version is selected.
- When the Pentaho Kettle script is executed, the kettle environment will have 3 variables available for each of the Dimension Parameters: <display name>.DimensionIsSelected, <display name>.DimensionName, <display name>.MemberName. The Pentaho Kettle script can make use of these in any way that is applicable to the script.
Dimension Version Parameter Within Scripted Data Source Example
In the example below, Planning Version to Load is the display name of the parameter as configured in the data designer in step 2.
- Planning Version to Load.MemberName: The display name of the member selected.
- If the root level member (the dimension itself) is selected, then this value will be blank.
- Planning Version to Load.DimensionName: The display name of the dimension associated with the parameter.
- Planning Version to Load.DimensionIsSelected: Will have the value of true or false, and indicates whether the selected member is the root level member, which is the dimension itself.
A common usage of the version dimension value would be on an Adaptive Planning Output step in Spoon, as shown below.