Provisioning Schema::try


Element that wraps procedure steps and passes any errors to the corresponding catch block. This element is part of the provisioning schema of Microsoft® Provisioning Framework (MPF).

Provisioning requests that use try-catch error handling have try and catch nodes in the procedure. Each procedure step that requires error handling is wrapped in a try node. If an error occurs when a provisioning engine executes the try node, the engine executes the corresponding catch node and passes the errorContext node to all its procedures. If the catch node successfully responds to the error, the procedure continues to execute. Otherwise, the engine initiates rollback.

The try-catch blocks can be nested to any depth. However, a try node must always be followed by a catch node.

Parents

catch, procedure, try

Children

catch (minOccurs="0" maxOccurs="*")
execute (minOccurs="0" maxOccurs="*")
queue (minOccurs="0" maxOccurs="*")
select  (minOccurs="0" maxOccurs="*")
transform
  (minOccurs="0" maxOccurs="*")
try (minOccurs="0" maxOccurs="*")

Example

<request>
  <data />
  <context>
	<clientContext clientTransactionId="53367B03-63D3-44ae-B8AD-C1E57E876E70" />
  </context>
  <procedure>
	<try>
	<execute namespace="Error Provider" procedure="SetError">
		<executeData>
		<hr>0x82101391</hr>
		<desc>The username already exists in the database</desc>
		</executeData>
		<after source="executeData" destination="data" />
	</execute>
	</try>
	<catch>
	<execute namespace="Error Provider" procedure="TranslateProvisioningError">
		<executeData>
		<errorMessageContext>adduser</errorMessageContext>
		<locId>1033</locId>
		</executeData>
		<after source="executeData" destination="data" />
	</execute>
	</catch>
  </procedure>
</request>

See also

Customization, XML Schema for Procedures


Up Top of Page
© 1999-2002 Microsoft Corporation. All rights reserved.