Build Your Own Wizard

Build Your Own Wizard
by Rollie Stephens

In the October issue, I described some of the new features in QAT Wizard 4.5.  Since then, I’ve been testing the new release and experiencing what we can accomplish with the product. I’ve realized that this release is packed with so many new features and capabilities that it’s really more like a new product than an upgrade.
As I mentioned in the last article, this new release is intended for customers to create their own interviews and custom patterns.  The previous versions did not allow customers to create their own interviews.  This limited the amount of customization the customer could make to the pattern model.  In addition, the developer was only able to customize code using the available features and techniques in the Gen Action Diagram.  This release of the Wizard adds a new capability called Wizard Actions.  With that, let’s briefly explore a few of the new Wizard Actions.
What are Wizard Actions?
Wizard Actions are directives that you encode into the Action Diagrams using a combination of Notes and Action Diagram statements that direct the Wizard Plug-in to perform various customizations for you.  The Wizard Actions start with a particular Action Diagram Note statement with a specified syntax.  Some Wizard Actions require specific Gen statements to immediately follow the note in order to direct the Action at a specific view or other model object.
Here are a few examples:

  1. Deleting Views– Sometimes, depending on choices made during the Wizard Interview, views are deleted because these views are no longer needed.  For example, you could create a Wizard Option (that’s a question in the Wizard Interview) asking if a dropdown list should be populated using an available component.  If the user chooses not to use that component, then the views required for that component are no longer needed.This Wizard Action will delete the views referenced by the empty IF statements that follow.  After the views are deleted, the empty IF statements are removed.QAT Wizard - Delete Views
  2. Setting Group View Sizes– As you may know, the size of group views must be set within the Action Diagram. However, when a Wizard Interview is executed, it may be necessary to adjust the size of the group view depending on the business requirements for a particular window or web page.This Wizard Action will change the size of the group view referenced by the empty IF statement to match the value entered into the Wizard Interview. The empty IF statement is removed by the Wizard Plug-in after the action is executed.QAT Wizard - Set Group SizeOf course, this also indicates that the Wizard Interview must prompt the user for the value named Drop1GroupSizesomewhere in the interview.  These types of questions are easily created within the Interview Manger, but that’s another topic.To continue this example, it may then be necessary to adjust the size of the group view up and down the call chain.  For example, if the group view size is changed in a particular action diagram, it must also be changed in all action diagrams that match against that group view.This Wizard Action will adjust all group views in the action blocks being generated by the Wizard that have a matching group view name (note that the first node of the name is not considered in the name match so it will adjust both the Import and the Export group views as long as their names match past the first node of the name).  For all matching group views, the group view size and the contents of the view will be set to match the source view referenced in the empty IF statements.  The empty IF statement is removed after the Wizard executes the action. This Wizard Action works for single views (vs. Group Views) as well, but of course that would only synchronize the contents without regard for a group view size.QAT Wizard - Sync Views
  3. Prompting For Hard Coded Parameters– There are times when the pattern must set an attribute view to a specific value in the Action Diagram.  The value of that parameter might require a value that is known at the time of the Wizard Interview.  The Wizard can automatically prompt the user at the end of the Wizard Interview to enter all such values.This Wizard Action will cause the Wizard Plug-in to prompt for this value named Drop1CodeName at the end of the interview.  The Wizard Plug-in will then set the literal to the value of the entry in all statements that prompt for this named value.QAT Wizard - 3) Prompting For Hard Coded Parameters

Consider these examples only a start.  Stay tuned next month or contact us directly to learn more about Wizard Actions!

For more information, please visit QAT Wizard.