Tuesday, December 7, 2010

Synchronous and Asynchronous AgilePart

In the constructor of AgilePart descriptor, the Synchronous property is set to true by default. This makes the AgilePart operates in synchronous basis, i.e. the process waits until the execution of the AgilePart finished before it promotes to the next activity. Also because of the AgilePart is running under a synchronous mode, the process is considered ‘active’ and the object remains in the memory, not being swap out for better server performance.

public class MyAgilePartDescriptor : WFAgilePartDescriptor
{
public MyAgilePartDescriptor()
{
base.Synchronous = true;
}
}


If your server always have high load, you may utilize the asynchronous capability of AgilePart. To implement this, just set the Synchronous property to false. The process still waits for the AgilePart to complete before promoting to the next activity, but the memory of the process instance object is swapped out from the memory, and hence releasing the resource for other server processing needs. Besides the asynchronous behavior, any other thing of an asynchronous AgilePart is the same as synchronous AgilePart, i.e. the way to debug an AgilePart, the logging behavior, credential used to run the AgilePart, deployment of the AgilePart, etc.

No comments:

Post a Comment