Expand my Community achievements bar.

SOLVED

Technical Workflow - Auto Recovery

Avatar

Level 4

I have created a utility workflow which monitors specific technical work flows to ensure they are running normally.  If a work flow which should be running but isn't is found the following are executed to stop and restart it (using java script)

 

xtk.workflow.Stop(strId)
xtk.workflow.Start(strId)

The problem is that if the job has a scheduler it will wait until it's next scheduled start, what I need is a way to "Execute Pending Task Now" so that the job restarts immediately.  I can see xtk:worflow methods for wakeup which looks like it might be want but I can't get it to start right away.

 

Is there away to start the workflow so that it runs immediately?

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi @Ken_Qrious - there are a few ways to achieve this. I've found the simplest is to add an External signal to the start of the workflow and use xtk.workflow.PostEvent to kick it off via the External signal activity. This gives you the scheduler which will kick off when the schedule arrives, plus it also gives you a way to execute the workflow at any other time (once the workflow is running).

Darren_Bowers_0-1635992949604.png

Cheers

Darren

View solution in original post

3 Replies

Avatar

Correct answer by
Level 9

Hi @Ken_Qrious - there are a few ways to achieve this. I've found the simplest is to add an External signal to the start of the workflow and use xtk.workflow.PostEvent to kick it off via the External signal activity. This gives you the scheduler which will kick off when the schedule arrives, plus it also gives you a way to execute the workflow at any other time (once the workflow is running).

Darren_Bowers_0-1635992949604.png

Cheers

Darren

Avatar

Level 6

Perfect answer, but carefull with this kind of methodology:
Root cause of the issue should always be addressed in priority...
I remember a customer that made in the past a such mechanism (but for none OOTB workflows) despite support recommandation: he burned in 5 monthes his xtkNewId sequence

Avatar

Level 4

Thanks for the replies @Darren_Bowers and @LaurentLam, it's good to be aware of potential pitfalls.  The main use for the auto restart would be for technical work flows which load data from external systems.  The process would be limited to selected work flows and would generate an alert to our support team.