Optional Workflow Parameters - Oracle ZFS Storage Appliance Administration Manual

Hide thumbs Also See for ZFS Storage Appliance:
Table of Contents

Advertisement

EXAMPLE 21
Using the ChooseOne parameter type, we can enhance the previous example to limit the
business unit to be one of a small number of predefined values:
var workflow = {
name: 'Create share',
description: 'Creates a new share in a business unit',
parameters: {
name: {
label: 'Name of new share',
type: 'String'
},
unit: {
label: 'Business unit',
type: 'ChooseOne',
options: [ 'development', 'finance', 'qa', 'sales' ],
optionlabels: [ 'Development', 'Finance',
}
},
execute: function (params) {
run('shares select ' + params.unit);
run('filesystem ' + params.name);
run('commit');
return ('Created new share "' + params.name + '"');
}
};
When this workflow is executed, the unit parameter will not be entered by hand -- it will be
selected from the specified list of possible options.

Optional Workflow Parameters

Some parameters may be considered optional in that the UI should not mandate that these
parameters are set to any value to allow execution of the workflow. Such a parameter is denoted
via the optional field of the parameters member:
TABLE 129
Optional Member
optional
Using the Workflow ChooseOne Parameter
'Quality Assurance', 'Sales/Administrative' ],
Required Members for Optional Parameters
Type
Boolean
Optional Workflow Parameters
Description
If set to true, denotes that the
parameter need not be set; the UI
may allow the workflow to be
Maintenance Workflows
591

Advertisement

Table of Contents
loading

Table of Contents