The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
bk0615
3 years agoNew Contributor
Check if a task with a specific description is already running
I have a process that causes contention if launched concurrently by users. Is there a way to check if a session with a specific description is already running? I would like to abort the session if an...
sudarshan
3 years agoNew 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
- 3 years ago