共用方式為


Using the HandleExternalEventActivity Activity

The HandleExternalEventActivity activity is used in conjunction with the CallExternalMethodActivity activity for input and output communications with a local service. You can use these activities directly for generic communications. Or, you can subclass the HandleExternalEventActivity and CallExternalMethodActivity classes to create activities that are strictly bound to specific events and methods on an interface that is attributed with the ExternalDataExchangeAttribute attribute.

The base HandleExternalEventActivity class blocks the workflow until the event specified by the InterfaceType and EventName properties is raised by the corresponding local service registered with the WorkflowRuntime. After the event is raised, or if it was raised before the activity started executing, the inbound data is assigned to bound locations as defined in the ParameterBindings collection.

For more information, see the HandleExternalEventActivity class, Generating Communication Activities, and Using Local Services in Workflows.

For code samples that demonstrate how to use the HandleExternalEventActivity activity, see Raise Event To Load Workflow and Correlated Local Service.

See Also

Reference

HandleExternalEventActivity
CallExternalMethodActivity
ExternalDataExchangeAttribute

Concepts

Generating Communication Activities
Using Local Services in Workflows

Other Resources

Raise Event to Load Workflow Sample
Correlated Local Service Sample
Windows Workflow Foundation Activities