JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle® ZFS Storage Appliance Administration Guide
Oracle Technology Network
Library
PDF
Print View
Feedback
search filter icon
search icon

Document Information

Using This Documentation

Chapter 1 Oracle ZFS Storage Appliance Overview

Chapter 2 Status

Chapter 3 Initial Configuration

Chapter 4 Network Configuration

Chapter 5 Storage Configuration

Chapter 6 Storage Area Network Configuration

Chapter 7 User Configuration

Chapter 8 Setting ZFSSA Preferences

Chapter 9 Alert Configuration

Chapter 10 Cluster Configuration

Chapter 11 ZFSSA Services

Chapter 12 Shares, Projects, and Schema

Chapter 13 Replication

Chapter 14 Shadow Migration

Chapter 15 CLI Scripting

Chapter 16 Maintenance Workflows

Using Workflows

Workflow Execution Context

Workflow Parameters

Constrained Parameters

Optional Parameters

Workflow Error Handling

Workflow Input validation

Workflow Execution Auditing

Workflow Execution Reporting

Versioning

Appliance Versioning

Workflow Versioning

Workflows as Alert Actions

Alert Action Execution Context

Auditing Slert Actions

Using Scheduled Workflows

Using the CLI

Coding the Schedule

Example: device type selection

BUI

CLI

Downloading workflows

Viewing workflows

Executing workflows

Chapter 17 Integration

Index

Workflow Error Handling

If, in the course of executing a workflow, an error is encountered, an exception will be thrown. If the exception is not caught by the workflow itself (or if the workflow throws an exception that is not otherwise caught), the workflow will fail, and the information regarding the exception will be displayed to the user. To properly handle errors, exceptions should be caught and processed. For example, in the previous example, an attempt to create a share in a non-existent project results in an uncaught exception. This example could be modified to catch the offending error, and create the project in the case that it doesn't exist:

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',
			    'Quality Assurance', 'Sales/Administrative' ],
		}
	},
	execute: function (params) {
		try {
			run('shares select ' + params.unit);
		} catch (err) {
			if (err.code != EAKSH_ENTITY_BADSELECT)
				throw (err);

			/*
			 * 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 + '"');
	}
};