Finding all active Business Processes that catch signals of the particular object
Hi everyone,
Probably each of us have faced a situation when you need to find all active business processes that react on the signal when you create, modify, delete records in the particular object. This task can become a hard one to be completed manually when there are dozens of the business processes in configuration. That's why you can simply run the script on your Database to get the complete list of active Business Processes that catch signals of the object you need:
For 7.x versions:
DECLARE @EntityChangeType table([Event] nvarchar(10), ChangeType int)
INSERT INTO @EntityChangeType
select Code [Event], ROW_NUMBER() OVER (ORDER BY Id) [ChangeType]
from SysEntityChangeType
SELECT ss.Name, ss.Caption, [@EntityChangeType].[Event]
from SysEntityPrcStartEvent se
INNER JOIN SysSchema ss
on se.ProcessSchemaId = ss.Id
inner join SysSchemaProperty ssp
on ss.Id = ssp.SysSchemaId
inner join @EntityChangeType
on se.RecordChangeType = [@EntityChangeType].ChangeType
WHERE se.EntitySchemaUId in (
select UId from SysSchema where Name = 'Document' -- OBJECT NAME
) and ssp.Name = 'Enabled' and ssp.Value = 'True'
For 5.x versions:
DECLARE @EntityChangeType table([Event] nvarchar(10), ChangeType int)
INSERT INTO @EntityChangeType
select Code [Event], ROW_NUMBER() OVER (ORDER BY Id) [ChangeType]
from SysEntityChangeType
SELECT DISTINCT ss.Name, ss.Caption, [@EntityChangeType].[Event]
from SysEntityPrcStartEvent se
INNER JOIN SysSchemaInSolution ss
on se.ProcessSchemaId = ss.SysSchemaId
inner join SysSchemaProperty ssp
on ss.Id = ssp.SysSchemaInSolutionId
inner join @EntityChangeType
on se.RecordChangeType = [@EntityChangeType].ChangeType
WHERE se.EntitySchemaId in (
select DISTINCT SysSchemaId from SysSchemaInSolution where Name = 'Account' -- OBJECT NAME
) and ssp.Name = 'Enabled' and ssp.Value = 'True'
Like