Running a K2 Blackpoint process as schedule job

  • 4 August 2010
  • 6 replies
  • 2 views

Badge +2

Hi All, I have a question. Can we run K2 Blackpoint workflow as a schedule task? I have a scenario as below.


There is a document library containing some legal document which has metadata like expirydate, emailreminder person, remindersdays, etc. I need to write a program which will read expiry date and trigger an email to responsible person. This program needs to be run every day.


Can this scenario be done in K2 Blackpoint. Currently I have created a .net exe and running it as schedule job. But I was just thinking whether it can be done in K2 blackPoint and it is advisable?


Regards,


Karan


6 replies

Badge +6

You can create a workflow with K2 to read the document metadata and send an email based on your criteria. You can set this workflow to start on any sharepoint document event (add/update/delete etc). You can also start the instance of the process from a webpage or a Windows Scheduler job. Refer to K2 blackpoint developer reference http://help.k2.com/en/k2blackpointdevref.aspx?page=Start_Instance_and_Get_Data_Fields.html

Badge +6

Hi Karan,


Like Sujeeth says you can trigger a workflow based on events that fire in that document library, but you cannot run the blackpoint Host Service in a scheduled task, and I have to be very clear about that. You will lose all other workflow functionality if you do that, plus it just wont make any sense at all. 


I assume that you want to trigger a workflow to be started based on the expiry date of the document, is that right? The only way that you can do that would be to write your own Windows Scheduler job that runs at the defined times and reads the expiry dates from the sharepoint Document library. For documents that is past the expiry date, I would then move the document to a different library where a workflow is automatically kicked off, or you could probably start the workflow from your scheduler job through code. 


Hope that makes sense.


G

Badge +2

Thanks Sujeeth and G. I agree with you guys, however the user is keen to use K2 process for email reminder. I got an opportunity to ask this question to Mr Eric Schaffer during K2 4.5 readyness training. He says we can achieve this by creating a small console app and putting it in scheduler. This console application would start and stop the K2 process every day. 

Badge +6

Karan, what you heard is right. You can write a console app to start an instance of your process/workflow and use it in windows scheduler. You can design the workflow to be stopped after say 2 hours. There are many other ways to stop and you can specify that criteria in your workflow.


But to start the workflow from the console app, the K2 Host Server (a windows service) will need to be running already. I think you are mixing up the windows service and the process/workflow. The K2 windows service will run the workflow in the background when you start an instance. This service will execute the steps in your workflow.

Badge +6

Well said Sujeeth. I think that sums it up very nicely. :)

Badge +3

Hi Karan,


Just wondering, why do you think blackpoint as the solution to the following case?


As far as i see, writing a timer job (Sharepoint job)  will effectively solve your purpose and its efficient for your scenario.


K2 bp needs lot of prerequisites to be running before you trigger a workflow and in any case what time of workflow you r planning to build ?? event bases or sharepoint integration workflow which BP provides... i dont think k2bp is right choice for this scenario...for my understanding and knowledge  can you explain me more...

Reply