Workflow Input Validation - Oracle ZFS Storage Appliance Administration Manual

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

Advertisement

/*
* We haven't yet created a project that corresponds to
* this business unit; create it now.
*/
run('shares project ' + params.unit);
run('commit');
run('shares select ' + params.unit);
}
run('filesystem ' + params.name);
run('commit');
return ('Created new share "' + params.name + '"');
}
};

Workflow Input Validation

Workflows may optionally validate their input by adding a validate member that takes as a
parameter an object that contains the workflow parameters as members. The validate function
should return an object where each member is named with the parameter that failed validation,
and each member's value is the validation failure message to be displayed to the user.
EXAMPLE 23
To extend our example to give a crisp error if the user attempts to create an extant share:
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',
}
},
validate: function (params) {
Workflow Input Validation
'Quality Assurance', 'Sales/Administrative' ],
Workflow Input Validation
Maintenance Workflows
593

Advertisement

Table of Contents
loading

Table of Contents