473,379 Members | 1,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

host a windows workflow problem

Hi

I was using a console application to host the windows workflow and when
I change to winforms, I don't know how to do it...

I pass the parameters into the workflow from the winform and is work
fine, but I try to output something from my workflow to the winform
that's when the problem arise...

I know that I can write this code line in my workflow code so I can
display a message box in the winform:

System.Windows.Forms.MessageBox.Show("Hello");

but is it possible for write a code in workflow to add something inside
the listBox?

I want something like listBox1.Items.Add(variablename);
Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***
Apr 12 '07 #1
3 2535
Hello Claudia,

It's possible, everything you need to do is to set your form to the workflow
- and I think you should never do this.
What's wrong with the event-based approache?!
WF is another level of abstraction, which shound know nothing about your
UI, it's the business logic which works with entities - not the UI controls.

It's directly the UI job to get the info from WF and show it

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

CFHi
CF>
CFI was using a console application to host the windows workflow and
CFwhen I change to winforms, I don't know how to do it...
CF>
CFI pass the parameters into the workflow from the winform and is work
CFfine, but I try to output something from my workflow to the winform
CFthat's when the problem arise...
CF>
CFI know that I can write this code line in my workflow code so I can
CFdisplay a message box in the winform:
CF>
CFSystem.Windows.Forms.MessageBox.Show("Hello");
CF>
CFbut is it possible for write a code in workflow to add something
CFinside the listBox?
CF>
CFI want something like listBox1.Items.Add(variablename);
CF>
Apr 12 '07 #2
Claudia,

The workflow is being processed on a thread that is not the UI thread.
When you receive a notification from the workflow and you want to interact
with the UI, you will need to call the Invoke method on a form/control in
the UI and then pass a delegate that will do the work that you want to have
performed on the UI thread.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Claudia Fong" <cd********@yahoo.co.ukwrote in message
news:Oc**************@TK2MSFTNGP03.phx.gbl...
Hi

I was using a console application to host the windows workflow and when
I change to winforms, I don't know how to do it...

I pass the parameters into the workflow from the winform and is work
fine, but I try to output something from my workflow to the winform
that's when the problem arise...

I know that I can write this code line in my workflow code so I can
display a message box in the winform:

System.Windows.Forms.MessageBox.Show("Hello");

but is it possible for write a code in workflow to add something inside
the listBox?

I want something like listBox1.Items.Add(variablename);
Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***

Apr 12 '07 #3
On Apr 12, 6:42 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Claudia,

The workflow is being processed on a thread that is not the UI thread.
When you receive a notification from the workflow and you want to interact
with the UI, you will need to call theInvokemethod on a form/control in
the UI and then pass a delegate that will do the work that you want to have
performed on the UI thread.

It's even better to call the 'BeginInvoke'-method because the 'Invoke'-
method may lead to deadlocks.

See here: http://kristofverbiest.blogspot.com/...gininvoke.html

regards,

Kristof Verbiest

Apr 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Paolo Losi | last post by:
Hi all, I'm pretty new to the python language so please excuse me if this is FAQ... I'm very glad to be part of the list! :-) I'm looking into a way to implement a generic workflow framework...
0
by: Bevertec | last post by:
May 26 2004 Our client is a major bank in Jamaica and they have a contract requirement for a professional with the following skills. This is a 6 months contract. It would be 3 weeks/month in...
4
by: danths | last post by:
Hello, In a workflow application where in the workflow is customizable, i would like to defer the instantiation of the class till the workflow is complete. e.g. class ClassA { object1 objA;...
6
by: Jon Davis | last post by:
Is it possible to have a custom dialog for setting the properties of a custom WF activity? For example, in the designer, if you drag-and-drop a custom control onto the flow chart, I would like to...
3
by: =?Utf-8?B?R3JhaGFt?= | last post by:
I've added 2 tracking services to the wf runtime; one is the standard SqlTrackingService: trackingService = new SqlTrackingService(<trackingConnectionString>); <workflow...
1
by: Andrzej Jaworek | last post by:
Hello, I'm testing this starter kit and I have a problem with persisting workflow state. In UserActivitiesHelper class there is a method UserActivitiesHelper() with the code block that clears the...
3
by: Speccy | last post by:
Hi, We would like to use Windows Workflow Foundation, but our server is Windows 2000, which cannot have .NET 3.0 installed on it. As WWF requires .NET 3.0, we therefore cannot use WWF. No...
1
by: Sanjay Poria | last post by:
Hi, I have been doing some investigation of Windows Workflow Foundation. All the examples that I have seen so far use either sequential or state machine workflows. Can anyone provide me...
11
by: Grzegorz Staniak | last post by:
Hi, In a couple of weeks I'm starting a medium-size project (using a web framework) involving a workflow implementation. Are you aware of any open source workflow engines/libraries that I could...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.