SQL to get count of server actions

Largely for interest, but it has been useful, I've build a SQL query to extract from the Outsystems SQL database counts for a specific application (or series of espaces) for:

  • Human activities
  • Automatic activities
  • Processes
  • Screens
  • Database tables

What I've been unable to find is how to query out the following from the database:

  • Server actions
  • Screen actions

Can anybody help with that?

In case it is of use, here's the script:


DECLARE @human_activities INT,
@auto_activities INT,
@screens INT,
@processes INT,
@database_tables INT

SELECT @human_activities = COUNT(*) FROM ossys_BPM_Activity_Definition ad
JOIN ossys_BPM_Process_Definition obpd ON ad.Process_Def_Id = obpd.Id
WHERE obpd.Espace_Id = 202
AND ad.Kind = 8

SELECT @auto_activities = COUNT(*) FROM ossys_BPM_Activity_Definition ad
JOIN ossys_BPM_Process_Definition obpd ON ad.Process_Def_Id = obpd.Id
WHERE obpd.Espace_Id = 202
AND ad.Kind <> 8

SELECT
@screens = COUNT(*)
FROM OSSYS_ESPACE_SCREEN s
JOIN ossys_Espace es ON s.ESPACE_ID = es.ID
JOIN OSSYS_MODULE m ON es.ID = m.ESPACE_ID
JOIN OSSYS_APP_DEFINITION_MODULE appd ON m.ID = appd.MODULE_ID
JOIN OSSYS_APPLICATION app ON appd.APPLICATION_ID = app.ID
WHERE app.id IN (104,105,107)

SELECT
@processes = COUNT(*)
FROM ossys_BPM_Process_Definition pr
JOIN ossys_Espace es ON pr.Espace_Id = es.ID
JOIN OSSYS_MODULE m ON es.ID = m.ESPACE_ID
JOIN OSSYS_APP_DEFINITION_MODULE appd ON m.ID = appd.MODULE_ID
JOIN OSSYS_APPLICATION app ON appd.APPLICATION_ID = app.ID
WHERE app.id IN (104,105,107) AND pr.Is_Active = 1

SELECT
@database_tables = SUM(oc.ObjectCount)
FROM ossys_Espace es
JOIN OSSYS_MODULE m ON es.ID = m.ESPACE_ID
JOIN OSSYS_APP_DEFINITION_MODULE appd ON m.ID = appd.MODULE_ID
JOIN OSSYS_APPLICATION app ON appd.APPLICATION_ID = app.ID
OUTER APPLY (
SELECT
Obj_KindObjectKind,
Obj_Count  ObjectCount
FROM dbo.ossys_espace_object_count
WHERE Espace_Version_Id = es.version_id
AND Obj_Kind IN ('Entity','StaticEntity')
) oc
WHERE app.id IN (104,105,107)

SELECT@screensScreens,
@human_activitiesHumanActivities,
@auto_activitiesAutomaticActivities,
@processesProcesses,
@database_tablesDatabaseTables

Hi 

Found this post in the forums 

https://www.outsystems.com/forums/discussion/37321/is-there-a-way-to-query-number-of-public-server-actions/ 

Maybe it gives you some pointers 

Hope it helps !!!

There is an other way, although it is not exactly the answer to you question. Using OutDoc (https://www.outsystems.com/forge/159/) you get a list of all actions in an eSpace. It is not a count though 

Thanks both, that's helpful, I'll give that a try.