Windows Workflow Foundation: Hosting workflows, creating machine state workflows (Part I)
Hi all,
Recently i’ve participated in a project that envolved Windows Workflow Foundation. Some of the issues that the project team had was: how to host a state machine workflow, how to register services, and how to communicate my UI to the workflow that contains the business logic. Well, i’ve developed a little program that execute this tasks.
Let’s explain some nice parts of the solution:
First we have to create the state machine workflow, in this case, i’ve created a workflow that calls itself.
Basically, the purpose of this program is to simulate the request to the workflow of 300 users at the same time. See that i’m waiting for an event, after that i do something (the code activity represents that) and than set the state of the workflow to itself.
As we know, we have to create an inteface that will be used by the HandleExternalEvent activity. This interface must be visible to the UI and to the workflow. This interface have basically the event signature that will be implemented later.
This interface uses the ExternalDataExchangeAttribute to marks the inteface as a local service interface. See that my event signature uses a different type. This type is basically a serializable class that inferits from ExternalDataEventArgs (Represents the data sent along when an event is raised usimg HandleExternalEvent Activity)
For now it’s all, later i’ll post the rest of the article.
Best Regards