Jihad 0 Light Poster

I am developing a website that contains workflow. It has a workflow that contains a listener activity and 2 external event handlers. As you know when the workflow waits for an external event it get persisted. Normal,right.

Well, when I click on a button and raise an event, the event is raised but it is not handled by the workflow. Maybe because it is unloaded. But according to all references I read, the workflow with the specified instance id should handle the event that were raised. But here this is not the case.

Simply the event is raised but never handled, so the workflow instance are kept persisted in the database.

I don't know if the website as a host has anything to do with that.

I would be happy to answer your questions to make my problem more clear.

Here is some info about the way I developed the application:

-The Workflow runtime and the services including the local ones are all defined in the Web.config file

-The Worfklow runtime starts running in the Application_Starts inside the Global.asax

-The ExternalDataExchangeService is added inside the Application_Starts before the workflowruntime starts


Here is some code from the application ("You might find something wrong in my logic")
Thanks in advance