Wait For All ------------ | [DocType1]------>| | [DocType2]------>| |----->{PostProcessing} [DocType3]------>| | {UserResuest}---->| |
CREATE TABLE PreProcessingLog( CustomerID int, CompletionType int, --Types are 1=UserRequest, 2=DocType1, 4=DocType2, 8=DocType3 Primary Key Clustered (CustomerID, CompletionType))
IF ( SELECT SUM(CompletionType) FROM PreProcessingLog WHERE CustomerID = @RecvdCustID ) <> 15BEGIN COMMIT TRANSACTION RETURN 0END