MicroStrategy ONE

WebPrompts

The WebPrompts interface is primarily a read-only collection of WebPrompt objects. Other than providing access to individual prompt objects, this interface is mainly used for applying certain actions such as answering prompts in the collection instead of individual prompt objects.

Prompts associated with reports and documents can be obtained using the getPrompts() method found in the WebReportInstance and WebDocumentInstance interfaces. Prompts can also be built from XML strings using getPrompts(String xml) methods found in those interfaces. It is possible to obtain prompts from the report or document instance even if the report or the document has been resolved by answering all prompts. The prompt answers can still be modified by calling answerPrompts again. The SDK recognizes that those answers are from the resolved report and refreshes the report before sending the answers.

The WebPrompts interface exposes methods to persist the prompt objects via XML definitions. The prompt definition comprises three main parts— generic information, information about possible answers to the prompt, and answers to the prompt–current, default, and previous answers. The getXML()and getXML(boolean encode) provide the persistence functionality for the prompt collection. The default value for the boolean (encode) parameter is false. The loading functionality is provide by the getPrompts(String xml) method of the WebReportInstance and WebDocumentInstance interfaces.

The WebPrompts interface also introduces the concept of the Answer XML. The current answer specified by the user is represented by Answer XML of the prompt definition. It is important to distinguish the answer component from the definition component because the answer may not be available on MicroStrategy Intelligence Server and may be local to the WebPrompts or WebPrompt instance. By providing a persistence mechanism for the answer component of the prompt definition, this allows the user to minimize the amount of data needed to persist the prompt objects. The getAnswerXML(), getAnswerXML(boolean encode), and populateAnswers(String answerXML) provide the necessary calls to persist and load the answer component of the prompt definition. The default value for the boolean (encode) parameter is false.

The WebPrompts interface also includes the getShortAnswerXML methods to support the answer formats used in MicroStrategy Narrowcast Server. The setCancelledAll method allows cancellation of all prompts in the collection.