-
Workflow persistence
<p> What triggers persistence? <ul> <li> Runtime decides when to persist </li> <li> Persistence service decides how and where </li> <li> <div>Conditions:</div> <ul> <li> Anytime the WF goes idle (e.g. Delay Activity) </li>
-
EventHandling in WF
<p> In WF, CallExternalMethod is used to transfer data from workflow instance to host, and HandleExternalEvent is used to transfer data from host to workflow instance. The pattern of HandleExternalEvent is similar to the one of CallExternalMethod. Basically, you specify the interface the HandleExternalEvent can support, then you need to specify the event that HandleExternalEvent can handle. The event is from the interface supported. To use HandleExternalEvent in our workflow, we have more supporting activities need to be introduced into the workflow. Firstly, you need a listener activity to support event listening. In the listening activity, you define one or more EventDrivenActivity. In side of EventDrivenActivity, the first child activity should be HandleExternalEvent, which is define what event it is listening. To achieve the purpose of transferring information from external host to workflow instance, we can embed the information in the event argument. At the workflow client side, we need to add the external service to workflow host. The external service inplement the interface that the HandleExternalEvent want to handle. Then client call external service's fire event method, magically, the workflow instance will intercept the event. </p>
-
Performance counter
<p> Performance counter is used to monitor the running status of an application. The application itself just output the performance data. The data itself don't need to be calcuated by the application, the data is used by external application, like performance MMC. Here discussed how to output performance data only. To output performance data takes several steps. </p>
-
Output a tempalte to file
<p> You can output the result of a template to file system but use the command line and the code smith project file. The default behavior is that code smith engine, call the template's GetFileName method, and output the result to a text file with that file name. CodeTemplate also has a method RenderToFile(fileName). This method is not to be called inside the template itself, because it will fall into infinitive loop, because itself will call Render method. RenderToFile(fileName) is to be called by external client. But the fileName logic should be maintained inside the template. So we can create the follow the code to implement our requirement. </p>
-
Call External Method
<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>