Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
RMiranda

Member
Registered:
Posts: 25
Reply with quote  #1 
Hello fellow metastormers,

I'm doing some sniffing around metastorm store procedures, in order to find out why some folder are not being completely created (only get the Metastorm.dbo.eFodler and  the Metastorm.dbo.TableX, where the TableX values are all Nulls and zeros, except for the eFolderID) currently i'm trying to do a complete walk by esp_creation_action.

One basic thing i can't figure out is this SP: psp_insert_eventlog_error, here is his code:
 
USE [Metastorm]
GO
/****** Object:  StoredProcedure [dbo].[psp_insert_eventlog_error]    Script Date: 10/10/2013 11:25:12 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[psp_insert_eventlog_error]  
 
    @p_ErrorInfo            NVARCHAR(4000),
    @p_ErrorSource          NVARCHAR(4000) OUTPUT
 
-- WITH ENCRYPTION                  
AS
 
    SET NOCOUNT ON
 
    DECLARE @errTagOpen         NVARCHAR(11)
    DECLARE @errTagClose        NVARCHAR(12)
    SET @errTagOpen         = N'<ErrorCode>'
    SET @errTagClose        = N'</ErrorCode>'
 
    DECLARE @paramTagOpen       NVARCHAR(11)
    DECLARE @paramTagClose      NVARCHAR(12)
    SET @paramTagOpen       = N'<Parameter>'
    SET @paramTagClose      = N'</Parameter>'
 
    DECLARE @s          INT
    DECLARE @e          INT
    DECLARE @errCode        NVARCHAR(20)
    DECLARE @parameter      NVARCHAR(255)
    DECLARE @l          INT
    DECLARE @tagLen         INT
    DECLARE @endTag         NVARCHAR(17)
    SET @endTag             = N'<ErrorCollection>'
    DECLARE @collectionEnd      INT
 
    -- Find the closing tag of the error collection element in the error source.
    SET @collectionEnd = CHARINDEX(@endTag, @p_ErrorSource) + LEN(@endTag)
 
    IF @collectionEnd > 0 
    BEGIN
 
        DECLARE @firstSection   NVARCHAR(4000)
        DECLARE @lastSection    NVARCHAR(4000)
 
        SET @firstSection = SUBSTRING( @p_ErrorSource, 1, @collectionEnd-1 ) -- substring index starts at 1
        SET @lastSection  = SUBSTRING( @p_ErrorSource, 
                           @collectionEnd, 
                           LEN(@p_ErrorSource) - @collectionEnd + 1)
 
        -- Get the error code and add to the error data.
        
        EXEC psp_get_value @errTagOpen, @errTagClose, @p_ErrorInfo, @errCode OUTPUT
    
        IF @errCode IS NULL
        BEGIN
            set @errCode = N'5'
        END
 
        SET @p_ErrorSource = 
        @firstSection + 
        N'<EError Class="EEventLogError">' +
            N'<PropertyList>' +
                N'<Property Name="MessageID">'+
                    N'<Value>'+ ISNULL(CONVERT(NVARCHAR,@errCode),N'')+N'</Value>'+
                N'</Property>' +
                N'<Property Name="Type">'+
                    N'<Value>Warning</Value>'+
                N'</Property>' +
            N'</PropertyList>'+
            N'<ParameterList>'
 
        --  Now add any parameters
        SET @l = 1
        WHILE 1 = 1
        BEGIN
            -- Find the open parameter tag
            SET @s = CHARINDEX(@paramTagOpen,@p_ErrorInfo,@l)
            
            IF @s > 0
            BEGIN
                SET @s = @s + len(@paramTagOpen)
                -- we have a opening parameter tag,
                -- find the closing tag
                SET @e = CHARINDEX(@paramTagClose,@p_ErrorInfo,@s)
                SET @parameter = SUBSTRING( @p_ErrorInfo,@s,@e-@s )
                SET @p_ErrorSource = @p_ErrorSource + 
                    N'<Parameter Size="'+CONVERT(NVARCHAR,LEN(@parameter))+N'" Type="string">' +
                        N'<Value>' +
                            N'<![CDATA[ ' + ISNULL(@parameter,N'') + N' ]]>'+
                        N'</Value>'+
                    N'</Parameter>';
                SET @l = @e + len(N'</Parameter>')
            END
            ELSE
            BEGIN
                BREAK
            END
        END     
        
        SET @p_ErrorSource = @p_ErrorSource + 
            N'</ParameterList>' +
        N'</EError>' + 
        @lastSection
 
    END
 
    RETURN 0
 
ON_ERROR:
 
    RETURN -1
 

So at first look, it does not really insert anything anywhere, right? Or is there anything i'm not getting here?
 
Thanks in advance for any help :)

0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #2 
I believe that will add an entry to the windows event log, not the Designer Log. That happens in code, so there is no insert. Frankly, I'm at a loss as to why it is in a stored procedure at all, in fact.
__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
RMiranda

Member
Registered:
Posts: 25
Reply with quote  #3 

Humm, very strange, i don't see how it can do that only with the code of the store, maybe those are special variable names. or something...

Anyhow, i'm getting to the conclusion that there's nothing wrong with the metastrom engine or procedure flow, the user is just dumbly hitting refresh as he's in the middle of felling the form...so inconsistent data everywhere :P

Thanks for the insight, i'll be sure to check the event long if my conclusion is somehow mistaken :)

0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!