Obtain blocked scheduled jobs

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Process wizard > Business Rules > Business Rules examples > Cases and activities >

Obtain blocked scheduled jobs

Overview

Bizagi offers a function to obtain information about your blocked scheduled jobs. This function will retrieve all the blocked scheduled jobs.

 

CHelper.GetAllStuckWaitJobs()

 

Example

In this example, the function getAllStuckWaitJobs will be used to retrieve all the stuck scheduled jobs.

The expression would be as follows:

 

GetAllStuckWaitJobs01

 

The code shown in the images is:

var dtWaitJobs = CHelper.GetAllStuckWaitJobs();

for(var i=0; i < dtWaitJobs.Rows.Count; i++)

{

   var idJob = dtWaitJobs.Rows[i]["idJob"];

   var jobName = dtWaitJobs.Rows[i]["jobName"];

   var jobDescription = dtWaitJobs.Rows[i]["jobDescription"];

   var jobType = dtWaitJobs.Rows[i]["jobType"];

   var jobCreationDate = dtWaitJobs.Rows[i]["jobCreationDate"];

   var jobEnabled = dtWaitJobs.Rows[i]["jobEnabled"];

   var idCreatorUser = dtWaitJobs.Rows[i]["idCreatorUser"];

   var jobNextRunTime = dtWaitJobs.Rows[i]["jobNextRunTime"];

   var idCase = dtWaitJobs.Rows[i]["idCase"];

   var idWorkItem = dtWaitJobs.Rows[i]["idWorkItem"];

   var DELETED = dtWaitJobs.Rows[i]["DELETED"];

   var jobProcessing = dtWaitJobs.Rows[i]["jobProcessing"];

   var jobLastProcessingTime = dtWaitJobs.Rows[i]["jobLastProcessingTime"];

   var jbPriority = dtWaitJobs.Rows[i]["jbPriority"];

   var backgroundJobId = dtWaitJobs.Rows[i]["backgroundJobId"];

   var idTask = dtWaitJobs.Rows[i]["idTask"];

   var tskDisplayName = dtWaitJobs.Rows[i]["tskDisplayName"];

   var idWFClass = dtWaitJobs.Rows[i]["idWFClass"];

   var wfClsDisplayName = dtWaitJobs.Rows[i]["wfClsDisplayName"];

   var lastErrorMessage = dtWaitJobs.Rows[i]["lastErrorMessage"];

   var countOfTheAttempts = dtWaitJobs.Rows[i]["countOfTheAttempts"];

   var radNumber = dtWaitJobs.Rows[i]["radNumber"];

}


Last Updated 5/23/2024 3:05:28 PM