Creating the wizard
The wizard prompts the user for information when the user tries to insert a questionnaire wizard item in UNICOM Intelligence Author. When the user has entered the information, the wizard generally changes an in-memory version of the source. This changed version of the source is then inserted into the target (the .mdd file currently open in UNICOM Intelligence Author).
The wizard can also modify the target directly.
One or more source .mdd files point to a wizard by using the WizardPath parameter. Because more than one source .mdd file can point to a single wizard, you can use the same wizard to gather details for multiple source files.
See:
Variable definitions that are inserted by the wizard
The wizard inserts the following variable definitions into the routing script:
source_mdm
A document object that references the source document that is being inserted. The object is an in-memory copy of the document that is inserted into the source.mdd file upon completion of the wizard.
target_mdm
A document object that references a copy of the target.mdd file. The object is provided only for information; changes to this document do not affect the actual target file.
target_url
The full path, including the file name for the target.mdd file. The path is useful if the wizard must write a file to the project directory.
routing_items_selected[]
An array of IRoutingItem objects that represent the routing items that are currently selected in the UNICOM Intelligence Author Routings pane. These are the routings, chosen by the user, that are modified or used as the basis for a new routing. The array is empty if no routings are selected. The array might contain routings that are of no use for the wizard and must be checked before use.
questions_selected[]
An array of IMDMField objects that represent the questions that are currently selected in the UNICOM Intelligence Author Questions pane. These are the questions, chosen by the user, that are modified or used as the basis for a new question. The array is empty if no questions are selected. The array might contain questions that are of no use for the wizard and must be checked before use.
routing_items_added[]
An empty array that the wizard updates if it adds routing items directly to the target_mdm instead of by using the source_mdm. UNICOM Intelligence Author uses this array to decide which routing items to refresh in the Routings pane (or questions to refresh in the Questions pane if it is visible) for items not added by using the source_mdm. The array indicates which routing items should be refreshed in the user interface.
questions_added[]
An empty array that the wizard updates if it adds questions directly to the target_mdm instead of by using the source_mdm. The UNICOM Intelligence Author interface uses this array to decide which routings to refresh in the Routings pane (or questions to refresh in the Questions pane if it is visible) for items not added by using the source_mdm. The array indicates which questions should be refreshed in the user interface.
Wizard actions
The wizard can update the target_mdm, which means that UNICOM Intelligence Author must be notified of the wizard changes so that it can update the user interface and track the changes that are required for undo and redo support. The possible wizard changes are specified in a comma-separated list of actions in the WizardActions property at the metadata’s Document level. The possible WizardActions are as follows:
InsertsMetadata
Associated: source_mdm
Inserts the metadata added to the source_mdm variable. This is the default action.
AddsRoutingItems
Associated: routing_items_added[]
Set if the wizard will add routing items directly to the target_mdm. The wizard must add the routing items to the routing_items_added[] array.
AddsQuestions
Associated: questions_added[]
Set if the wizard will add questions directly to the target_mdm. The wizard must add the questions to the questions_added[] array.
DisableUndoRedo
The wizard is requesting that undo and redo are disabled so that the changes before and after the wizard are not stored. Use this action sparingly. It displays a warning in the user interface.
UpdatesAll
Set if the wizard makes extensive changes to the target_mdm that would force the entire document to be reloaded in the user interface.
UpdatesAll does not perform well with large MDM documents, so use it only if necessary.
UpdatesSelectedRoutingItems
Associated: routing_items_selected[]
Set UpdateSelectedRoutingItems if the wizard will make any changes to an existing routing item.
UpdatesSelectedQuestions
Associated: questions_selected[]
Set if the wizard will make any changes to an existing question.
Testing wizards
To test a wizard, you must create the variables and set them as specified; this is because UNICOM Intelligence Author wizards are created in UNICOM Intelligence Professional, and UNICOM Intelligence Professional cannot set wizard variables implicitly. After you have tested the wizard, and it is ready to be deployed, comment out those lines of code.
Tracking errors in wizards
When an error occurs, UNICOM Intelligence Author wizards should display an error page, and then stop with a Stopped signal. This tells UNICOM Intelligence Author that no changes have been made.
When you run a wizard from UNICOM Intelligence Author, debugging logs and error logs are written to the IVW log in the Logs directory (if user encounters an error, you might find more information there). Alternatively, you can catch all errors in the wizard script, and then display a more detailed error message.
See also