IT Process Automation

  • 1.  SQL Query for process

    Posted Apr 13, 2017 04:11 AM

    Hi,

     

    Please help me with a sql query which will give me count of process (same number as we see in operation tab) in running,waiting, queued state. 

     

    Thanks & Regards,

    Nikita Pandey



  • 2.  Re: SQL Query for process
    Best Answer

    Posted Apr 13, 2017 10:38 AM

    Hi,

     

    This is what I have been testing out now that I am using CAPA 4.3 SP1

     

     

    USE [CAPAM_RUNTIME]
    GO

    select RunState, Count(RunState) as 'Count' from [dbo].[C2ORuntimeObjects]
    where RootID = ROID and DiscriminatorType = 'WorkFlow'
    group by RunState
    UNION
    select RunState, Count(RunState) as 'Count' from [dbo].[C2ORuntimeObjectsArch]
    where RootID = ROID and DiscriminatorType = 'WorkFlow'
    and isArchived = 0
    group by RunState

     

    If you want to include jobs on the Archive pane as well, just remove the "and isArchived = 0"

     

    If anyone has a different/better way please let me know.

    Ian