CallExternalMethodActivity Class

Defines a workflow communication activity that is used to call a method on a local service. This activity is used to send data from the workflow to the host through the local service.

Namespace: System.Workflow.Activities
Assembly: System.Workflow.Activities (in system.workflow.activities.dll)

public class CallExternalMethodActivity : Activity, IDynamicPropertyTypeProvider
public class CallExternalMethodActivity extends Activity implements IDynamicPropertyTypeProvider
public class CallExternalMethodActivity extends Activity implements IDynamicPropertyTypeProvider
Not applicable.

The following code example shows how to use the CallExternalMethodActivity in a custom activity to call an external method. This code example is part of the Listen SDK sample from the PurchaseOrderWorkflow.Designer.cs file. For more information, see Listen Sample.

[System.Diagnostics.DebuggerNonUserCode()]
private void InitializeComponent()
{
    this.CanModifyActivities = true;
    this.Timeout = new System.Workflow.Activities.CodeActivity();
    this.Delay = new System.Workflow.Activities.DelayActivity();
    this.RejectPO = new System.Workflow.Activities.HandleExternalEventActivity();
    this.ApprovePO = new System.Workflow.Activities.HandleExternalEventActivity();
    this.OnTimeoutEventDriven = new System.Workflow.Activities.EventDrivenActivity();
    this.OnOrderRejectedEventDriven = new System.Workflow.Activities.EventDrivenActivity();
    this.OnOrderApprovedEventDriven = new System.Workflow.Activities.EventDrivenActivity();
    this.POStatusListen = new System.Workflow.Activities.ListenActivity();
    this.CreatePO = new System.Workflow.Activities.CallExternalMethodActivity();
    // 
    // Timeout
    // 
    this.Timeout.Name = "Timeout";
    this.Timeout.ExecuteCode += new System.EventHandler(this.OnTimeout);
    // 
    // Delay
    // 
    this.Delay.Name = "Delay";
    this.Delay.TimeoutDuration = System.TimeSpan.Parse("00:00:05");
    // 
    // RejectPO
    // 
    this.RejectPO.EventName = "OrderRejected";
    this.RejectPO.InterfaceType = typeof(Microsoft.Samples.Workflow.Listen.IOrderService);
    this.RejectPO.Name = "RejectPO";
    this.RejectPO.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.OnRejectPO);
    // 
    // ApprovePO
    // 
    this.ApprovePO.EventName = "OrderApproved";
    this.ApprovePO.InterfaceType = typeof(Microsoft.Samples.Workflow.Listen.IOrderService);
    this.ApprovePO.Name = "ApprovePO";
    this.ApprovePO.Invoked += new System.EventHandler<System.Workflow.Activities.ExternalDataEventArgs>(this.OnApprovePO);
    // 
    // OnTimeoutEventDriven
    // 
    this.OnTimeoutEventDriven.Activities.Add(this.Delay);
    this.OnTimeoutEventDriven.Activities.Add(this.Timeout);
    this.OnTimeoutEventDriven.Name = "OnTimeoutEventDriven";
    // 
    // OnOrderRejectedEventDriven
    // 
    this.OnOrderRejectedEventDriven.Activities.Add(this.RejectPO);
    this.OnOrderRejectedEventDriven.Name = "OnOrderRejectedEventDriven";
    // 
    // OnOrderApprovedEventDriven
    // 
    this.OnOrderApprovedEventDriven.Activities.Add(this.ApprovePO);
    this.OnOrderApprovedEventDriven.Name = "OnOrderApprovedEventDriven";
    // 
    // POStatusListen
    // 
    this.POStatusListen.Activities.Add(this.OnOrderApprovedEventDriven);
    this.POStatusListen.Activities.Add(this.OnOrderRejectedEventDriven);
    this.POStatusListen.Activities.Add(this.OnTimeoutEventDriven);
    this.POStatusListen.Name = "POStatusListen";
    // 
    // CreatePO
    // 
    this.CreatePO.InterfaceType = typeof(Microsoft.Samples.Workflow.Listen.IOrderService);
    this.CreatePO.MethodName = "CreateOrder";
    this.CreatePO.Name = "CreatePO";
    this.CreatePO.MethodInvoking += new System.EventHandler(this.OnBeforeCreateOrder);
    // 
    // PurchaseOrderWorkflow
    // 
    this.Activities.Add(this.CreatePO);
    this.Activities.Add(this.POStatusListen);
    this.Name = "PurchaseOrderWorkflow";
    this.CanModifyActivities = false;

}

System.Object
   System.Workflow.ComponentModel.DependencyObject
     System.Workflow.ComponentModel.Activity
      System.Workflow.Activities.CallExternalMethodActivity

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show: