Initiate workflow start of the month

  • 20 October 2008
  • 3 replies
  • 0 views

Badge +3

I am working with K2 BlackPearl v0803.  I have a need for a workflow to commence at the start of every month. 


What are the best practices for this requirement. 


Do I need SmartObject's for this?


Can I get away with running a SQL Server Scheduled Task/Job and based on this event, trigger the workflow?  Essentially have the workflow wait for an event?


 Any assistance would be great.


3 replies

Badge +9

That might work if you just use a bit of .NET code inside SQL Server to start it off using the workflow client APIs. 


It might be easier to just write a simple Windows Service to check if it has hit the beginning of the month or a console application (and use scheduler to start it). 

Badge +8

Steven, there are couple of ways to achieve it. As mentioned in post above you could use window service to trigger it.

There is another way, 

Create
a work flow, first activity is Server Event, Go to the Code and Make it
Synchronous=false. By doing this work flow will wait indefinitely. Add
an Escalation rule on top of server event. Expire it on any "n" number
of days, and have one line rule connect back to the first
activity(Server event). Have one more line that connects to your usual activities.

Now, you can change the value of n to any number and you will have your work flow start automatically after that many days .



13760i4C507851C6AE51A3.bmp
Badge +11
It is possible to do this using the Event Bus.  There is an example in the Developer's Guide in the section "How to register new events with the Event Bus".  The example does not demonstrate starting a process, but if you look at the example which registers an external DLL, you could put your code to start the process in that DLL.

Reply