# Wizard sequencer -- Description

## Description

Here is a formal description (prototypes) of types and functions used by the Wizard Sequencer.

The Sequencer::Run function:

    	symbol|void Sequencer::Run(
    		map Aliases,
    		map Sequence
    	);

It will run the whole sequence, call the dialogs in the particular order.

- The first dialog is a value, defined by a special item "ws_start".
- The returned symbol is a symbol found in the sequence map instead of alias.

- "Aliases" is a map of function aliases
- "Sequence" is a dialogs sequence (workflow)

The map of aliases or functions:

    	map Aliases = $[
    		<string Alias> : <term Function call>,
    		<string Alias> : [ <term Function call>, true ],
    		<string Alias> : [ <term Function call>, $[...] ],
    		...
    	];

- The first version is for normal functions.
- The second is for special functions (popups, decision functions), they are removed from the execution stack.
- The third is for functions with user defined buttons (not ready yet).

The sequence or workflow:

    	man Sequence = $[
    		<string Alias> : $[
    			<symbol> retval : <string> Alias,
    			<symbol> retval : <symbol> Return,
    			...
    		],
    		...
    	];

If the target value is a symbol, the WS finishes and returnes that symbol.

This is an outline of the next-generation WS, it is not implemented yet. It should be able of handling buttons and dialogs so, that you are able of exchange two dialogs without any change.

    	YCPString Sequencer::RunNG(
    		map Aliases,
    		map Sequence,
    		map Default,
    		boolean CreateWizard
    	);

- "Default" are default buttons parameters
- "CreateWizard" is true, if the WS should create the basic dialog

The default buttons map:

    	map Default = $[
    		<symbol> button : <any> value,
    		<symbol> button : <any> value,
    		...
    	];