Interactive tool based on a MEGA wizard
We shall now broaden our field of study; use of a MEGA wizard is not restricted to customization of object creation, but can assist in implementation of all kinds of interactive tools. The limitation of this use is the contour of what can be managed by a HOPEX standard properties page.
Such wizards can be for example tools for modification or transformation of HOPEX occurrences, or tools for import or export to third party tools.
Differences from a creation wizard
A MEGA wizard not being a creation wizard, its operation and use are different:
• the template available in the context does not represent an object in creation phase.
• there is no default page; configuration relating to this page defined in the Meta Wizard, or specified in the context of the wizard, is not taken into account.
• page sequences are not used, in particular those which reference a creation phase.
• the creation phase itself does not exist, and the OnWizRealize function of triggers is not called.
• pages do not display by default the name of the object.
Concerning use, calling a wizard is not by means of the InstanceCreator function.
In addition it is possible to redefine in greater detail the appearance and frame of such a wizard.
system process call
MEGA wizards can be called by means of the MegaWizard component.
This component can be created by the WizardRun function. This function can be called on any MegaObject, providing as parameter the absolute identifier of the Meta Wizard to be called. In Java, builders of the Wrapper MegaWizard class calling this function are made available.
The MegaObject to which the WizardRun function relates, which can be a MegaRoot, will be accessible from the context of the wizard via the template member, which in this case represents a real object.
The MegaWizard component has the following functions:
• context: makes available the MegaWizardContext of the wizard. It is therefore possible to configure the wizard before calling it.
• picture(<PictureID>): enables definition of the image displayed in the wizard; this image can be defined in wizard configuration.
• run: this function calls the wizard.
Configuring a wizard
A generic wizard is modeled in HOPEX by a Meta Wizard; however, this Meta Wizard is not associated with a MetaClass, as a creation wizard could be.
Static configuration of these wizards (defined in the _Parameterization text of the Meta Wizard) has been enhanced; in particular, it is possible for these wizards to define an image displayed in their frame, while the creation wizard, for reasons of consistency, simply displayed the icon of the MetaClass to be created.
The parameters introduced are:
[WizardFrame]
BitmapStyle = 1 or 2
Indicates that the image is displayed at top (1) or on left (2).
BitmapHorizontalMargin = n
Indicates in pixels the horizontal margin of the bitmap.
BitmapVerticalMargin = n
Indicates in pixels the vertical margin of the bitmap.
BitmapWidth = n
Indicates in pixels the width of the bitmap.
BitmapHeight = n
Indicates in pixels the height of the bitmap.
BitmapName = name
Specifies the name of the file for the bitmap. This file should be located in one of the HOPEX configuration files (Mega_Std). The .bmp file extension should not appear.
It is possible to redefine the icon of the wizard by specifying the picture in:
[Wizard]
Picture=<identifier>
Configuration example: export wizard XPDL BPMN
[WizardFrame]
BitmapStyle = 2
BitmapName = processWizard
BitmapWidth = 121
BitmapHorizontalMargin = 0
BitmapVerticalMargin = 0
[Wizard]
Picture = ~sj4c8ZPf2n40[BaseExport]
The configured frame becomes:
