locked
Job Scheduler RRS feed

  • Question

  • Hello,

    I currently have a .Net 1.1 windows service that, based on a config file, runs code from various assemblies that all implement the same interface, let's call it IJob.

     

    What I'd like to do, is convert all code implementing IJob into a workflow and then have a windows service schedule those workflows according to a configuration file.  Does this sound appropriate for Windows Workflow?  Or would I be better served by simply porting all my code into .Net 4?

     


    If this answers your question, please mark the question as answered.
    Wednesday, September 21, 2011 1:59 PM

Answers

  • Hi Tuna,
    I don't understand whether you are interested in using some particular feature of WF, or just trying to modernize and generalize some existing code. I would not convert a project to using WF just for the sake of it, you should try to learn whether there is a specific benefit to doing so - like the ability to suspend work in progress and resume it later (using persistence), or the ability for customers to design custom workflows (using designer), or just more efficient job scheduling.

    In your case a key question seems to be whether you would get a benefit from replacing a list in a config file from XAML. If you gain the ability to schedule jobs in parallel or flowchart styles as opposed to a plain sequence, is that actually useful? If you gain the ability to define data flow between jobs using variables and arguments, is that actually useful?

    If you're still feeling confused, I would say just port the code to .Net 4 first, without adding any Workflow in, see if you noticed any pain point or feature that is hard to do along the way, and keep reading a little about WF4 features on the side.

    Tim

    • Marked as answer by LeoTang Thursday, September 29, 2011 2:06 AM
    Thursday, September 22, 2011 2:28 AM

All replies

  • Given what you said, it is impossible to give a reasonable recommendation.

     

    However if you have the time available it is worth moving to .Net 4 from .Net 1.1 .I am in the middle of moving a large project from 1.1 to 4, for me the deciding factors were the increased developer efficiency in .Net 4 combined with the language's(in this case C#) increased capability to cleanly express design intentions.

     

    Having said that; it would be fairly straightforward to use the invoke activity to call methods in your current Dll's, or you could create a straightforward activity wrapper around the calls and still gain the advantages of WF4.

     

    IMO it really comes down to the time pressures you are under.

    Wednesday, September 21, 2011 2:45 PM
  • I'm not really under time pressure, it is really more of thing that simply needs to happen since as this system has fallen so far behind current versions.

     

    I understand how I could write the jobs as workflows, what I'm not sure about is the whole scheduling piece.  Could the scheduler itself be a workflow using  combinations of while loops and delay activities? 


    If this answers your question, please mark the question as answered.
    Wednesday, September 21, 2011 3:26 PM
  • Once again without know more it would be impossible to give a reasonable recommendation.

     

    You can schedule workflows to start using a timer (from you application/service), in response to a wcf message, or based on another workflow as you suggested, or as part of a state machine reacting to real world events....there really are no limits on how or when you start workflow.

    Wednesday, September 21, 2011 3:46 PM
  • Hi Tuna,
    I don't understand whether you are interested in using some particular feature of WF, or just trying to modernize and generalize some existing code. I would not convert a project to using WF just for the sake of it, you should try to learn whether there is a specific benefit to doing so - like the ability to suspend work in progress and resume it later (using persistence), or the ability for customers to design custom workflows (using designer), or just more efficient job scheduling.

    In your case a key question seems to be whether you would get a benefit from replacing a list in a config file from XAML. If you gain the ability to schedule jobs in parallel or flowchart styles as opposed to a plain sequence, is that actually useful? If you gain the ability to define data flow between jobs using variables and arguments, is that actually useful?

    If you're still feeling confused, I would say just port the code to .Net 4 first, without adding any Workflow in, see if you noticed any pain point or feature that is hard to do along the way, and keep reading a little about WF4 features on the side.

    Tim

    • Marked as answer by LeoTang Thursday, September 29, 2011 2:06 AM
    Thursday, September 22, 2011 2:28 AM