MSDN Magazine article on building custom activities for workflows

My article on building custom activities for Windows Workflow Foundation has finally posted to MSDN.  For those of you fortunate enough to get a printed copy, you got an entire week advanced screening. :) 
I tried to cover the basics of building an activity and the various components; designer, validator, etc, as well as touch on some of the things you can do for more advanced activities that need to listen for external data/events. 
 
I'll be writing more articles for MSDN Magazine on Windows Workflow Foundation in the coming months. If you have specific topcis that are of interest, post your feedback here and I'll consider it as I plan the next articles. 
 

Posted Nov 20 2006, 02:19 PM by matt-milner

Comments

Karim wrote re: MSDN Magazine article on building custom activities for workflows
on 11-21-2006 12:20 AM
Thanks Matt for this informative article, it really helped me to understand the Asynchronous and Event-Based Activities. I have one question, is it possible to have an Instance-wide Event-Listener Activity capable of handling external events? I want such Instance-wide Event-Listener NOT to contain the WF child activities. In other words, can WF support something like, the First Activity in the WF is ListenForEvents (keep the Listner ON) and move on with the execution of other activities. If an event occurs the Listener get the control-back at hand and does something (like dynamic update of the WF instance) and then the WF execution can continue.
The scenario I want to support is, if I have a long running WF and I want to have a Listener for CustomerCancel Event to be able to cancel some of the running activities, compensate others then goto some point within the process.
Any ideas to achieve this are appreciated.
Thanks Matt
Karim wrote Suggestions for Future Articles
on 11-21-2006 12:27 AM
Hi Matt, I would suggest ExecutionContext and Spawned Contexts for future articles. Spawned Contexts is very tricky issue that I still 'suffer' from! May be a good article with good example will be very useful for the WF community.
Thanks
Matt Milner wrote re: MSDN Magazine article on building custom activities for workflows
on 12-06-2006 1:29 PM
Karim,
Thanks for the feedback. I think your questions about event activities were addressed on the WF forums (http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=122&SiteID=1), but if not, post again there and I'll be watching.

thanks also for the ideas on the article. I'll see how I might incorporate execution contexts into the next article.
Ali wrote re: MSDN Magazine article on building custom activities for workflows
on 05-02-2007 10:33 PM
Can You Please Show us how can we build a custom a ctivities that send an email in the following situation.X is a manager of Y defined in the organization active directory .
When y upload a document,this activitie will send an email to X which is Y manager.simply when I just upload a document it send email to my manager telling him about my upload in order to approve it. Thanks.
Matt Milner wrote re: MSDN Magazine article on building custom activities for workflows
on 05-18-2007 1:35 PM
Ali,
I'd build two basic activities: GetManager and SendMail. You'll find an example of the latter on the wf.netfx3.com site in the activity gallery. Then I'd combine those into a new activity that is a comosite (the default for the Add New Item - Activity option in VS). You can add each of the basic activities to the composite, then "promote" the employee ID property up to the composite (create DP on Composite, bind DP of GetManager to that property).

Now a user can use your getManager or NotifyManager activities as needed. I've got a screen shot of a sample I'm working on here:
http://pluralsight.com/blogs//images/pluralsight_com/matt/75/o_NotifyManager.jpg

Matt
Shane wrote re: MSDN Magazine article on building custom activities for workflows
on 08-01-2008 4:54 AM

Thanks for posting - just found it over at MSDN.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?