<p>In a workflow, to call the external method, you need the following ready.</p>
<ul>
<li>The workflow need a interface marked with ExternalDataExchange. In the callExternalMethodActivity node, you need to configure the InterfaceType, MethodName, MethodInvoking, and what value to be used as passed-in parameter.
</li>
<li>
In workflow host, you need to config the workflow runtime to service the ExternalService. When a workflow instance execute an callExternalMethodActivity, it will ask the workflow runtime to supply a service.
</li>
</ul>
<pre data-sub="prettyprint:_">
//workflow definition
[ExternalDataExchange]
public interface ICustomerService
{
void SendCustomerData(string customerName);
}
//host enviroment code
public class CustomerService : ICustomerService
{
public void SendCustomerData(string customerName)
{
Console.WriteLine(customerName);
}
}
ExternalDataExchangeService xchangeSvc = new ExternalDataExchangeService();
workflowRuntime.AddService(xchangeSvc);
CustomerService custSvc = new CustomerService();
xchangeSvc.AddService(custSvc);
</pre>