Ability to schedule Loops and Workflows in BlackPearl

  • 27 January 2016
  • 2 replies
  • 0 views

Badge +10

So I wanted to raise the bar and bring automation for the escalation process, weekly review of un-attended or almost expired records,  start some workflows for entries that meet specific criterias....

 

At first my toughts are maybe there are somehting like a K2 Scheduler that could be farily easily setup like alarm clock timer and tell the workflow to start or the actions to take. unfortunatelly that is not the case. at least without using some Visual Studio Code.

 

Then after learning about Views and the ability to send emails, create loops and start workflows... the idea arrived !!!. why dont have an automated robot that open a browser and browse to that particular K2 View and perform some actions.

 

1.-) Using regular windows OS scheduler a PowerShell script can be build to run in the background and to be executed at any time, we tipically use those for some Sharepoint Backups... so here we go....

 

$IE=new-object -com internetexplorer.application
$IE.visible=$false

$IE.navigate2("http://k2server/Runtime/Runtime/View/PSRobot/")

 

As you can see... basically this will open IE in the background and browse to a page view called PSRobot.

 

2.-) The view PSRobot will have a Expression that return validation if the user who is currently navigating to the page matches the k2admin email address. and will return True or False

 

Here are 2 Variables MyUser and MyValidUser... which basically return existing email of the loggedin user and the other will validate if the email of the loggedin user matches the email of the K2Admin account.

 

14469i1109409D23E2A2DA.jpg

 

The Expression MyValidUser will basically match the email of the Authenticated user with the Email of the K2Admin email to see is who we think is browsing.

 

11625i8DE1A22F69C36996.jpg

 

3.-) On load the View will check for the MyValidUser and if is valid then you can loop trough items, start workflows, send emails and do anything that you want since is the correct user to execute something in a particular time. otherwise just close the browser and maybe send you and email that somebody is trying to reach a page that is not for their usage.

 

I can't wait to play with this is Awesome !!!

 

 


2 replies

Userlevel 5
Badge +16

Hi,

 

Haven't tested it yet but beautiful job man :)

Userlevel 1
Badge +8

Why not use the event bus and schedule the process start?

Looping scenarios can be created using Plan per Slot destination rules.

 

I guess I am not understanding the use case, can you elaborate how this is being used?

 

Interesting concept, but would like to understand the motivation a bit more.

 

S.

Reply