MicroStrategy ONE

Registering the Model Block with the Factory

The Prompts page includes a single global Factory object (mstr.controllers.Factory). Every model block instantiated on the Prompt page gets registered with the Factory. Typically the model block is passed to the Factory as JSON, which the Factory then instantiates into an actual model. The Factory looks for a scriptClass property value in the JSON.  If found, the Factory instantiates that class.

The scriptClass property is used to create an instance of the ReportInstance class as shown in the code below. This is useful for registering the JSON object with the Factory.

Copy
<assignments>
  <property name="scriptClass">mstr.models.ReportInstance</property>
  <property name="extendedProperties">
    <block name="ReportInstanceExtendedProperties" />
  </property>
  <property name="messageName">
    <block name="ConstantPromptAnswerModel" />
  </property>
</assignments>

Based on the code above, values are added to the properties in that class. For example, after instantiation, the value of ReportInstanceExtendedProperties is assigned to the extendedProperties property in that class.

These properties can be retrieved later using JUIL calls.