Last post Mar 17, 2014 05:53 AM by billcrawley
Mar 14, 2014 06:07 AM|billcrawley|LINK
I have inherited a VS2010 solution that includes a Workflow Project. In the main solution there is a Class Library project called ActivityLibrary and this is where all the code has been placed for business logic to the workflow it's where the codeactivity
is performed etc. THen we have a workflow project consisting of the xamlx files that use classes from the ActivityLibrary to define what gets done when. Back in the main solution there is a user interface that that will for instance gather information and
then create a new task into the workflow with the following kind of syntax:
using (var wf = new PreQuoteCallWorkflow.WorkflowServiceClient())
var createTask = new PreQuoteCallWorkflow.CreateTask
THis is fine as we want users to initiate the Workflow. However I now need to set off workflows in the background without users starting the wf process. I have created a class in our ActivityLibrary and I have created a new .xamlx file. I want my .xamlx
to run automatically every 20 mins. how do I go about doing this
Mar 14, 2014 06:20 AM|Siva Krishna Macha|LINK
To run any long running processes with specified intervals, we can use the Windows Service or Scheduled Tasks. This should work for the need.
However, MS WWF framework which is shipped with some Timer Activities might work for you:
Please go through the following two classes:
To Create long running Workflow service:
We'd however wait for other WF experts who would have implemented the 'best' solution - but just would like to give two cents if in case you've not encountered the above classes that may help you.
Mar 14, 2014 06:33 AM|Siva Krishna Macha|LINK
The question is interesting and I think, I've got the solution for your problem:
Article #1 from MSDN: Introduction to Hosting Windows Workflow Foundation
http://msdn.microsoft.com/en-us/library/aa663362.aspx - Search for this section: "Workflow Scheduler Services" in this article.
Article #2 from MSDN: Creating Custom Scheduling Services
Hope this helps.
Mar 17, 2014 05:53 AM|billcrawley|LINK
I've had a look at all the articles, but none of them are really what I want. In all that I have read, a WF process seems to have to be initiated by a user action and then pass some values into the workflow. In my case, the workflow needs to be data driven
and based on the outcome send an event to the screen for the user to act on.
Basically I need the wf to run 24/7 and my method fire every 20 mins. Assuming criteria are met, I write a record to a DB and send a message to the parent application so that the user can act on it. The message stays on screen until the user has performed
an action an cleared the workflow.