locked
next activity data in code (sequential workflow) RRS feed

  • Question

  • hi! i have a sequential long-running workflow and custom workflow data stored in my custom table (Workflow) in different db. Every activity in workflow has it's name and I want to declare a different form for executing each of them (all of the activities are HandleExternalEvent activities and require some form button clicks), and in Workflow table I want to store name and FormUrl for current  workflow activity. In my db I also have a tables to store all my forms, and table for intersection of forms and activites. So, when some activity is closed, I want to update data in Workflow table (change CurrentActivityName and CurrentFormUrl).
    My problem is that in the moment of executing actiom, I didn't manage to access any data about next activity. How can I do that? Thanks.
    Thursday, March 18, 2010 9:08 AM

Answers

All replies

  • Simplest way would be creating a custom activity which updates the data to the required tables.

    If you think this couldnt be the answer, then please make your question a bit more explanatory. And if possible i would get back to you..
    Thursday, March 18, 2010 12:50 PM
  • No offense but your design smells like a hack to me and you are reinventing the wheel a bit when it comes to tracking.

    You should use the built in tracking system for keeping track of what is going on in workflow and if you need to anticipate what's next in a WF then you should use state machine design in WF 3.5. State Machines allow for you to see what events are supported from the current state which controls where you got next. So if you want to do things like enable\disable buttons then this is the best design approach.

    Here's a video that covers tracking basics: http://channel9.msdn.com/shows/Endpoint/endpointtv-Screencast-Using-SQL-Tracking-Services-with-WF/

    And there are more videos on tracking here: http://msdn.microsoft.com/en-us/netframework/wf-screencasts.aspx

    And this article covers state machine WF in 3.5: http://odetocode.com/Articles/460.aspx


    If my response answers your question, please mark it as the "Answer" by clicking that button above my post.

    My blog: http://www.RyanVice.net/
    Friday, March 19, 2010 10:37 AM
    Moderator
  • While what  you say makes sense in a ideal world. the problem is that he tracking service has a lot of restrictions For eg it can only be creeated on a Database where you have dbo rights. the env where i work does not give you those rights which then kill the inbuilt persistances and tracking service.

    While i do know that you can overriode andcreate ur own methods . It is still a hassle for a small project.

     

    Regrds

    David

    Tuesday, May 11, 2010 2:01 PM