Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

DropUnusedWorkflowProcessScheme

Reference

SchemaNameType
dboDropUnusedWorkflowProcessSchemeProcedures

Uses

NameRelated to
DropUnusedWorkflowProcessScheme
WorkflowProcessInstance
WorkflowProcessScheme

Scripts

CREATE PROCEDURE [DropUnusedWorkflowProcessScheme]
AS
BEGIN
DELETE wps FROM WorkflowProcessScheme AS wps
WHERE wps.IsObsolete = 1
AND NOT EXISTS (SELECT * FROM WorkflowProcessInstance wpi WHERE wpi.SchemeId = wps.Id )

RETURN (SELECT COUNT(*)
FROM WorkflowProcessInstance wpi LEFT OUTER JOIN WorkflowProcessScheme wps ON wpi.SchemeId = wps.Id
WHERE wps.Id IS NULL)
END
Stay in the know
Build Workflow Applications Faster
Star us on GitHub