Custom K2 SmartWizards

This content applies to legacy components (such as K2 Studio and K2 for Visual Studio), legacy assemblies and APIs, legacy services or other legacy functionality. These legacy items may not be available, supported, or behave as described, in future updates or versions of K2. Please see the legacy component and API support policies for more information about support for these components

You can extend the set of standard workflow wizards by creating custom SmartWizards. This approach is mostly used when you want to give workflow designers an easy way to drag and drop a workflow step into their design canvas and then configure the step just like any standard workflow wizard. A custom SmartWizard surfaces as a series of steps to a workflow designer.

SmartWizards require a SmartObject to be able to integrate with the underlying system. The alternative approach would be to let the users just drag and drop a SmartObject method into the SmartObject event. A SmartWizard, however, can be tweaked in terms of layout, fields and wizard content, so it is an easier design-time experience for your workflow designers. While building the SmartWizard, you will decide what fields should surface on what pages of the wizard, what data types are supported, the names of the fields and much more.

The SmartWizard's layout.xml definition file is the core component for a SmartWizard. The definition contained within the layout.xml file is used to make the wizard available within the thick and thin client K2 designers, such as K2 Designer, K2 Studio and K2 for Visual Studio.

Creating a SmartWizard is a simple process:

  1. Ensure that the SmartObjects and their methods that you will use in the SmartWizard exist, and that they work as expected.
  2. Create the Layout.XML file. See the topic SmartWizards Layout.xml Reference for more information about this XML file.
  3. Create an 16x16 icon file for the smartwizard
  4. Copy the Layout.XML file and .ico icon file to the machines where the design tools reside (see the Register section below for more information on the location for these files).
  5. Register the custom K2 SmartWizard with the various design tools

Sample Schema and sample project

You can use the following XML Schema file for the K2 SmartWizard layout.xml to validate the custom SmartWizard definition. Download the XSD from here: K2Documentation.Samples.Reference.SmartWizardsSchema.zip.

The sample project is provided for demonstration purposes only. It is not supported by K2 product support and is not intended to be used as-is in production environments.

Two custom K2 SmartWizards are provided for demonstration purposes. They incorporate the use of a SmartBox SmartObject, Wizard Pages with various controls, validations, data structures, references, and events. See the SmartWizard Example topic for an explanation of the sample project and to download the project.

If you want to explore how standard K2 wizards use the SmartWizard framwork, look at the SmartWizard XML files located in a K2 Studio/K2 for Visual Studio workstation in the folder %PROGRAMFILES%\K2\Bin\DesignTemplates\SmartWizards. You can compare these .xml files with the wizards that surface in the workflow design tools and the associated SmartObjects, which will give you some practical examples of how SmartWizards work.

Registering a custom K2 SmartWizard