How to Execute workflow service using WorkflowApplication.Run
-
Monday, February 27, 2012 11:40 AM
Hi,
I've created & saved a workflow in database. The workflow was created using workflow reghosted designer. The workflow consists of a recieve/SendReply activity pair. In between I'm calling my custom activity which is setting some response object and this object is being sent to client using SendReply activity described above.
My question is, How can I test this workflow in rehosted workflow designer?
If I use WorkflowApplication.Run, I stuck in infinite loop and debugger hit neither workflowCompleted nor WorkflowUnhandledException event handler. If I create a normal workflow without message activities, it execute well and return the result.
Any help in this? Example would be great!!
Nitin
NitinV
All Replies
-
Tuesday, February 28, 2012 12:10 AM
IsCanCreateInstance
set in your Receive? Try marking if it wasn't.
+.+
- Edited by Davi Moreira Fiamenghi Tuesday, February 28, 2012 12:11 AM
-
Wednesday, February 29, 2012 7:50 AMModerator
Hi,
As far as I know, host workflow service in WorkflowApplication is not supported. To host a workflow service in a managed application, you can use the WorkflowServiceHost class. For the detailed information, please refer to:
Hosting Workflow Services
http://msdn.microsoft.com/en-us/library/ee358721.aspx
Thanks.
Leo Tang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Edited by LeoTangModerator Wednesday, February 29, 2012 7:54 AM
-
Thursday, March 01, 2012 5:28 AM
LeoTang, indeed, it's 'possible', but i don't see a reason to do it. The correct way would be to use a WorkflowServiceHost as you said.
Check how to do it: http://stackoverflow.com/questions/8740574/can-i-run-wcf-workflow-service-using-workflowapplication-class/8828244#8828244
+.+
- Marked As Answer by LeoTangModerator Monday, March 05, 2012 11:02 AM
-
Thursday, March 01, 2012 2:03 PM
Thanks for replying Davi. Your link worked for me.
There reason for do is testing the workflow. I am creating a rehosted designer where user can create workflow service as well normal workflows. I need to give user freedom to test these workflows and that is why I want to host the service and call it via the client. My work done but when I implemented workflow tracking to execute & track workflow, I've got another problem.
When I track the workflows from database it tracking worked well but when I add some activities to this workflow and test & track I see that tracking does not highlight newly added activity and bypass to the next activity. However, when I save this workflow to database and retrieve and test it again, this time tracker is able to highlight the activity with yellow border.
Any idea why this is happening. I followed the same steps described in
http://blogs.msdn.com/b/kushals/archive/2009/12/22/visualworkflowtracking-aka-workflowsimulator.aspx
I am facing the same problem described by "Gaurish 3 Mar 2011 9:21 PM " in comment section of the link.
Any Idea??
NitinV

