Wizard flow definition

You must use an XML file to create the flow definition of your wizard. You cannot use the Extensibility Workbench to create or customize wizards. To understand the various attributes of wizard.xml, see the sample Create Order wizard XML file.

The various components of a wizard flow definition are as follows:
  • Page - The visible part of the wizard. Each page must have a unique ID within the wizard.
  • Rule - Determines the wizard flow. A rule can lead to the next page in a wizard or another rule. It can also lead to a transition that connects the wizard flow. Transition can occur for a page-to-page, page-to-rule, rule-to-page, or rule-to-rule.
  • Flow controller - Drives the wizard flow. It determines the next wizard entity that is shown or evaluated based on the current activity entity.

    Any wizard controller must extend ISCUIWizardFlowController. The default wizard controller class is com.sterlingcommerce.ui.web.platform.wizard.SCUIDefaultWizardController. The wizard flow controller utility class orchestrates the flow that is based on the definition. You can either plug in your own flow controller or use the default flow controller.

Sample: Create Order wizard XML file

<wizards>
 <wizard id="isccs.order.wizards.createOrder.CreateOrderWizard" 
flowController="com.sterlingcommerce.ui.web.platform.wizard.SCUIDefaultWizardController" 
independentPages="false" extensible="true">
 <wizardEntities>
 <wizardEntity id="Rule1" impl="java:com.ibm.isccs.order.rules.CreateOrderFirstPageWizardRule" 
start="true" last="false" type="RULE">
	 <output value="1"/> 
	 <output value="2"/> 
	 <output value="3"/> 
</wizardEntity>
 <wizardEntity id="Page1" screenId="isccs.order.create.customer.CustomerIdentification" 
impl="/platform/jsps/dojo/xapiajaxsuccesshandler.jsp" last="false" type="PAGE" 
category="Cat2"/>
 <wizardEntity id="Page2" screenId="isccs.order.create.additems.AddItems" 
impl="/platform/jsps/dojo/xapiajaxsuccesshandler.jsp"  last="false" type="PAGE" 
category="Cat1"/> 
 <wizardEntity id="Page3" screenId="isccs.order.create.additems.AddItems" 
impl="/platform/jsps/dojo/xapiajaxsuccesshandler.jsp"  last="false" type="PAGE" 
category="Cat1"/> 
 <wizardEntity id="Page4" screenId="isccs.order.create.customer.
CustomerIdentification" 
impl="/platform/jsps/dojo/xapiajaxsuccesshandler.jsp"  last="false" type="PAGE" 
category="Cat2"/> 
 <wizardEntity id="Page5" screenId="isccs.order.fulfillmentSummary.
FulfillmentSummaryDetailsScreen" 
impl="/platform/jsps/dojo/xapiajaxsuccesshandler.jsp"  last="false" type="PAGE" 
category="Cat2"/> 
 <wizardEntity id="Page6" screenId="isccs.payment.confirmation.PaymentConfirmation" 
impl="/platform/jsps/dojo/xapiajaxsuccesshandler.jsp"  last="true" type="PAGE" 
category="Cat2"/>
 <wizardEntity id="Page7" screenId="isccs.order.create.additems.AddItems" 
impl="/platform/jsps/dojo/xapiajaxsuccesshandler.jsp" 
last="false" type="PAGE" category="Cat1"/>
</wizardEntities>
<wizardTransitions>
<wizardTransition id="Transition1" source="Rule1">
	 <output target="Page1" value="1"/>
   <output target="Page2" value="2"/>
   <output target="Page7" value="3"/>
</wizardTransition>
<wizardTransition id="Transition2" source="Page1" target="Page3">
</wizardTransition>
<wizardTransition id="Transition3" source="Page2" target="Page4">
</wizardTransition>
<wizardTransition id="Transition4" source="Page3" target="Page5">
</wizardTransition>
<wizardTransition id="Transition5" source="Page4" target="Page5">
</wizardTransition>
<wizardTransition id="Transition6" source="Page5" target="Page6">
</wizardTransition>
<wizardTransition id="Transition7" source="Page7" target="Page5">
</wizardTransition>
</wizardTransitions>
</wizard>
</wizards>

Wizard element

You can specify the wizard element as follows:
<wizard id="wsc.order.wizards.createOrder.CreateOrderWizard" 
flowController="com.sterlingcommerce.ui.web.platform.wizard.
SCUIDefaultWizardController" 
independentPages="false" extensible="true">

The following table describes the attributes of a wizard element:

Table 1. XML attributes used to specify a wizard
XML Attribute Mandatory Description
id Y Indicates a unique wizard identifier.
flowController Y Indicates the flow controller for the wizard. The flow controller does the following actions:
  • Determines the next entity to be evaluated based on the current entity.
  • Provides basic navigation capabilities to the wizard.
  • Handles next and previous calls.
independantPages Y Indicates whether the wizard pages are independent of each other. The possible values are as follows:
  • True - Indicates that the wizard pages are independent.
  • False - Indicates that the wizard pages are dependant.
extensible N Indicates whether the wizard is extensible. By default all wizards are extensible. The possible values are as follows:
  • True - Indicates that the wizard is extensible.
  • False - Indicates that the wizard cannot be extended.

Wizard page entity

You can specify the wizard page entity as follows:
<wizardEntity id="Page1" screenId="isccs.order.create.customer.CustomerIdentification" 
impl="/platform/jsps/dojo/xapiajaxsuccesshandler.jsp" last="false" 
type="PAGE" category="Cat2"/>
The following table describes the attributes that are used to specify a page:
Table 2. XML attributes used in the wizardEntity element to specify a page
XML Attribute Mandatory Description
id Y Indicates a unique page identifier for a page in the wizard
impl Y Indicates the jsp or struts action, which renders the page.
screenId N Indicates the class name of the screen that is displayed in the page.
start N Indicates whether the page is the first page in the wizard. The possible values are as follows
  • True - indicates that the page is the starting or the first page in the wizard.
  • False - indicates that the page is not the starting or the first page in the wizard.
last N Indicates whether the page is a last page of the wizard. The possible values are as follows:
  • True - indicates that the page is the last page in the wizard.
  • False - indicates that the page is not the first page in the wizard.
type Y Indicates whether the wizardEntity defines a page or rule. The possible values are as follows:
  • PAGE
  • RULE
category N Indicates the category to which the page belongs to. This attribute is used for breadcrumbs.

Wizard rule entity

A wizard rule does logical computations to evaluate various output values. The flow of a wizard depends on the output values that are defined.

You can specify the wizard rules as follows:
<wizardEntity id="Rule1" impl="java:com.ibm.isccs.order.rules.CreateOrderFirstPageWizardRule" 
start="true" last="false" type="RULE">
	 <output value="1"/> 
	 <output value="2"/> 
	 <output value="3"/> 
	 <output value="-1" type="exit"/>
</wizardEntity>

The following table describes the attributes of a wizard rule:

Table 3. XML attributes used in the wizardEntity element to specify a wizard rule
XML Attribute Mandatory Description
id Y Indicates a unique rule identifier for a rule in the wizard
impl Y The Java class must implement the com.sterlingcommerce.ui.web.platform.wizard.ISCUIWizardRule interface. You can use the install3rdParty utility to add third-party custom JAR files to the class path of various utilities and enterprise archive (EAR) files.

For example, impl=java:com.ibm.isccs.order.rules.CreateOrderFirstPageWizardRule is the wizard rule that provides the implementation.

start N Indicates whether the rule is the first rule in the wizard. The possible values are as follows:
  • True - indicates that the rule is the starting or the first rule in the wizard.
  • False - indicates that the rule is not the starting or the first rule in the wizard.
last N Indicates whether the rule is a last rule of the wizard. The possible values are as follows:
  • True - indicates that the rule is the last rule in the wizard.
  • False - indicates that the rule is not the first rule in the wizard.
type Y Indicates whether the wizardEntity defines a page or a rule. The possible values are as follows:
  • PAGE
  • RULE
output N Indicates the possible return string for a rule. The value indicates the next page in a wizard transition. The wizard rule can be defined to exit the wizard flow as <output value="-1" type="exit" />.
Note: If Java returns a string that does not match the output values, the SCUIWizardRuleHolder: Undeclared output from implementation exception occurs.

Wizard transition element

Wizard transition is used to transfer control from one wizard entity to another wizard entity. The wizard transition value is compared with the output of the wizard rule and control is transferred to the next wizard entity. You can define the same wizard transition identifier for multiple wizard transitions, which are associated with different values.

You can specify the wizard transition as follows:
<wizardTransitions>
<wizardTransition id="Transition1" source="Rule1">
	 <output target="Page1" value="1"/>
   <output target="Page2" value="2"/>
   <output target="Page7" value="3"/>
</wizardTransition>
</wizardTransition>
Or
<wizardTransitions>
<wizardTransition id="Transition2" source="Page1" target="Page3">
</wizardTransition>

The following table describes the attributes that are used to define a Transition:

Table 4. XML attributes used in the wizardTransition element
XML Attribute Mandatory Description
id Y Indicates a unique transition identifier.
source Y Indicates the identifier of the source entity from which the transition originates.
output N Mandatory, if the source attribute is a Rule. This attribute is used to determine the transition from one page to another page. Based on the value that is returned by the rule, transition is applied to the pages defined in the target attribute. For example, if <output target="Page1" value="1"/>, and if the rule returns value as 1, the wizard makes the transition to Page1.
target Y The target attribute indicates the identifier of the entity where the transition ends.