Run-Time Parameters Tags
The factory top-level runtime-parameters tag declares parameters to use in the factory. They can be used in calculations, measure definitions, or expressions in the factory configuration file. These parameters are not assigned values during the factory build; instead, they are assigned values when queries are made against the built factory. This example declares the parameter Selected Planet and assigns Earth as the default value.
measure-factory { runtime-parameters { parameter "Selected Planet" { default "Earth" } } ... }
The runtime-parameters tag is similar to the take-parameters tag in Dive and cPlan scripts. The only difference is that the default sub-tag is required for the runtime-parameters tag. As in the Dive and cPlan scripts' take-paramenter tag, the runtime-parameters tag can use the selection=true attribute, which allows the parameter to take multiple values and "All Values".
For more information, see Parameter Overview.
There are three Spectre functions that use parameters: param(), param_match(), and param_contains().
These run-time parameters can be used in:
- Measure calculations and filters
- Aux-measures calculations and filters
- Analysis summary calculations and filters
- Scope filters
They cannot be used in rule calculations and filters because rules are evaluated at build time.
This example uses a parameter in a measures tag within a param_match() function.
After the factory is built and you open a generated cPlan in ProDiver from either the factory.dbk or all-measures.dvp, the default parameter value is used. To make the parameter dynamic, you need a QuickView that matches the parameter. You can do this by making a QuickView portlet using a non-factory data source. In a different project you make a qvset file based on some other data. This example shows a QuickView Set file.
Open that QuickView Set in a QuickView portlet, and it automatically controls the Selected Planet run-time parameter in the factory. For example, a Matrix portlet showing the Selected Planet Mass measure changes based on the Selected Planet QuickView.