workflow project type
hello,
My workflow run from a win form application. which type of the workflow ( Sequential Workflow console App or sequential workflow library..) must be used.
hello,
My workflow run from a win form application. which type of the workflow ( Sequential Workflow console App or sequential workflow library..) must be used.
Hiya
The console app includes a console application host so if you already have a windows application to host your workflow just add a workflow library project to your solution.
thank you,
I have another question.
In the form when pressing the button, the workflow starts
I wrote the following code in the button1_click event. Is it correct. I have used a my service for work with handle external method and callexternalevent activities
privatevoid Button1_Click(object sender, EventArgs e) if (wr != null){
wr =
newWorkflowRuntime();wr.StartRuntime();
}
ExternalDataExchangeService dataExchange =newExternalDataExchangeService();
workflowRuntime.AddService(dataExchange);
MyService myService =newMyService();
dataExchange.AddService(myService);
WorkflowInstance wi = wr.CreateWorkflow(typeof(WFizin.izinWorkflow));wi.Start();
A couple of issues regarding your code,
1)- You dont need to add your external data service every time you create and start a workflow. What I would suggest is you create the workflow runtime and add all the services you want, only once during the application initialization and in the button click handler just create and start a workflow.
2)- Just be sure you are aware of the threading model you are using, you are using the default scheduler which will use a new thread from the thread pool to run the workflow and not your button click thread. You might wanna make sure you get notified about teh statuses of the workflow threads.
thanks
But I dont understand the second. what is the advantages of notification about the statuses of the workflow threads and how can ? change my code acc. to your says.