Forum Discussion
2 Replies
Sort By
- JackLacavaCommunity Manager
I hate to be that guy, but to me this looks like the wrong way to go about things. If you have an issue with jobs stepping on each other's toes, something went wrong when defining those jobs. This is why Workflow Profiles, for example, enforce entity separation. I'd try to determine why "contention" happens and stop that from happening in the first place. Trying to kill jobs will result in more problems down the line.
- sudarshanNew Contributor III
Assuming you are trying to do this in a rule:
You can query the TaskActivityTable with status = 1000 to indicate it is currently running.
Dim dt As DataTable = Nothing Dim sequence as String = "Task1" 'The name of the DM sequence Dim sql As String = "SELECT TaskActivityStatus FROM TaskActivity WHERE Description = '" & sequence & "' AND TaskActivityStatus = 1000" 'Query the table Using dbConnApp As DbConnInfo = BRApi.Database.CreateFrameworkDbConnInfo(si) dt = BRAPi.Database.ExecuteSql(dbConnApp,sql,False) End Using 'if the following check passes then there is a process currently running If dt IsNot Nothing AndAlso dt.Rows.Count < 1 'Do something End If
Related Content
- 6 months ago
- 3 years ago
- 8 months ago