Share via


OnAbort Method

OnAbort Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Runs compensating action scripts and cleans up when a workflow transaction is aborted.

Applies To

IProcessInstance Interface

Type Library

Microsoft CDO Workflow Objects for Microsoft Exchange

DLL Implemented In

CDOWF.DLL

Syntax

[Visual Basic]Sub OnAbort
(
    varReceived As Variant,     varUserID As Variant
)

[C++]HRESULT OnAbort (     VARIANT varReceived,     VARIANT varUserID );

Parameters

  • varReceived

  • varUserID

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The OnAbort method causes the CompensatingAction script to run. When calling OnAbort, always use the same varReceived and varUserID parameters that you used in the associated call to Advance. If the OnAbort parameters do not match the corresponding parameters in the Advance call, OnAbort behavior is undefined. Undefined behavior means the wrong CompensatingAction or no CompensatingAction may be called.

The CompensatingAction script is only run for corresponding actions that have already run. For example, in a typical OnChange/OnExit/OnEnter sequence, if the OnChange transition fails, the OnExit and OnChange actions get rolled back. The OnEnter action would not have run, so its corresponding CompensatingAction does not run.

For more information, see the ActionTable Property.

If you are using the Workflow Designer for Exchange 2000 Server, you do not need to use this method. The built-in workflow components call this method based on your selections.

The event sink supplies the parameters to this method. Do not use this method unless you are writing your own workflow event sink.

The following pseudocode illustrates the only supported use of the OnAbort method.

Open a connection Begin Transaction Call Advance if failed then Call OnAbort Rollback transaction else Save Commit Transaction end if

See Also

Advance Method

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.