293. WorkflowManager

Provides API for configuring workflows

293.1. Authors

  • Lukas Ocilka <locilka@suse.cz>

  • Provides API for managing and configuring installation and

  • configuration workflow.

  • Module was created as a solution for

  • FATE #129: Framework for pattern based Installation/Deployment

  • Module unifies Add-Ons and Patterns modifying the workflow.

293.2. Summary of Module Globals

List of Global Functions

  • AddWorkflow - Stores new workflow (if such workflow exists) into the Worflow Store.

  • CleanWorkflowsDirectory - Removes all xml and ycp files from directory where

  • DumpCurrentSettings - Returns the current settings used by WorkflowManager. This function is just for debugging purpose.

  • GetAdditionalFinishSteps - Returns list of additional inst_finish steps requested by additional workflows.

  • GetAllUsedControlFiles - Returns list of control-file names currently used

  • HaveAdditionalWorkflows - Returns whether some additional control files are currently in use.

  • MergeWorkflows - Function uses the Base Workflow as the initial one and merges all added workflow into that workflow.

  • PrepareProposals - Check all proposals, split those ones which have multiple modes or architectures or stages into multiple proposals.

  • PrepareSystemProposals - Check all proposals, split those ones which have multiple modes or architectures or stages into multiple proposals. Works with base product proposals.

  • PrepareSystemWorkflows - Check all workflows, split those ones which have multiple modes or architectures or stages into multiple worlflows. Works with base product workflows.

  • PrepareWorkflows - Check all workflows, split those ones which have multiple modes or architectures or stages into multiple workflows

  • RedrawWizardSteps - Redraws workflow steps. Function must be called when steps (or help for steps) are active. It doesn't work in case of active another dialog.

  • RemoveWorkflow - Removes workflow (if such workflow exists) from the Worflow Store. Alose removes the cached file but in the installation.

  • ResetWorkflow - Resets the Workflow (and proposals) to use the base workflow. It must be stored. Clears also all additional workflows.

  • SetAllUsedControlFiles - Sets list of control-file names to be used. ATTENTION: this is dangerous and should be used in rare cases only!

  • SetBaseWorkflow - Stores the current ProductControl settings as the initial settings. These settings are: workflows, proposals, inst_finish, and clone_modules.

  • SomeWorkflowsWereChanged - Returns whether some additional control files were added or removed from the last time MergeWorkflows() was called.

List of Global Variables

293.3. Global Functions

293.3.1. AddWorkflow

Stores new workflow (if such workflow exists) into the Worflow Store.

Function parameters

  • symbol type

  • integer src_id

  • string name

Return value

  • boolean - whether successful (true also in case of no workflow file)

Example 153. 

	AddWorkflow (`addon, 4, "");


293.3.2. CleanWorkflowsDirectory

Removes all xml and ycp files from directory where

Return value

  • void

293.3.3. DumpCurrentSettings

Returns the current settings used by WorkflowManager. This function is just for debugging purpose.

Return value

  • map <string, any> - of current settings

[
		"workflows" : ...
		"proposals" : ...
		"inst_finish" : ...
		"clone_modules" : ...
		"unmerged_changes" : ...
	];

293.3.4. GetAdditionalFinishSteps

Returns list of additional inst_finish steps requested by additional workflows.

Function parameters

  • string which_steps

Return value

  • list <string> - steps to be called ...see which_steps parameter

293.3.5. GetAllUsedControlFiles

Returns list of control-file names currently used

Return value

  • list <string> - files

293.3.6. HaveAdditionalWorkflows

Returns whether some additional control files are currently in use.

Return value

  • boolean - some additional control files are in use.

293.3.7. MergeWorkflows

Function uses the Base Workflow as the initial one and merges all added workflow into that workflow.

Return value

  • boolean - if successful

293.3.8. PrepareProposals

Check all proposals, split those ones which have multiple modes or architectures or stages into multiple proposals.

Function parameters

  • list <map> proposals

Return value

  • list <map> - updated proposals

	Input: [
		$["label":"Example", "name":"example","proposal_modules":["one","two"],"stage":"initial,firstboot"]
	]
	Output: [
		$["label":"Example", "name":"example","proposal_modules":["one","two"],"stage":"initial"]
		$["label":"Example", "name":"example","proposal_modules":["one","two"],"stage":"firstboot"]
	]

293.3.9. PrepareSystemProposals

Check all proposals, split those ones which have multiple modes or architectures or stages into multiple proposals. Works with base product proposals.

Return value

  • void

293.3.10. PrepareSystemWorkflows

Check all workflows, split those ones which have multiple modes or architectures or stages into multiple worlflows. Works with base product workflows.

Return value

  • void

293.3.11. PrepareWorkflows

Check all workflows, split those ones which have multiple modes or architectures or stages into multiple workflows

Function parameters

  • list <map> workflows

Return value

  • list <map> - updated workflows

293.3.12. RedrawWizardSteps

Redraws workflow steps. Function must be called when steps (or help for steps) are active. It doesn't work in case of active another dialog.

Return value

  • boolean

293.3.13. RemoveWorkflow

Removes workflow (if such workflow exists) from the Worflow Store. Alose removes the cached file but in the installation.

Function parameters

  • symbol type

  • integer src_id

  • string name

Return value

  • boolean - whether successful (true also in case of no workflow file)

Example 154. 

	RemoveWorkflow (`addon, 4, "");


293.3.14. ResetWorkflow

Resets the Workflow (and proposals) to use the base workflow. It must be stored. Clears also all additional workflows.

Return value

  • void

293.3.15. SetAllUsedControlFiles

Sets list of control-file names to be used. ATTENTION: this is dangerous and should be used in rare cases only!

Function parameters

  • list <string> new_list

Return value

  • void

Example 155. 

	SetAllUsedControlFiles (["/tmp/new_addon_control.xml", "/root/special_addon.xml"]);


See also:

  • GetAllUsedControlFiles()

293.3.16. SetBaseWorkflow

Stores the current ProductControl settings as the initial settings. These settings are: workflows, proposals, inst_finish, and clone_modules.

Function parameters

  • boolean force

Return value

  • void

293.3.17. SomeWorkflowsWereChanged

Returns whether some additional control files were added or removed from the last time MergeWorkflows() was called.

Return value

  • boolean - boolen see description

293.4. Global Variables

293.4.1. additional_finish_steps_before_chroot

Additional inst_finish settings defined by additional control files. They are always empty at the begining.

293.5. Module Requirements

293.5.1. Module Imports

  • Directory
  • FileUtils
  • Label
  • ProductControl
  • ProductFeatures
  • Report
  • Stage
  • String
  • Wizard
  • XML

293.5.2. Module Includes