USP_QUEUEPROCESS_EDIT

Updates a queue process in the database.

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN
@NAME nvarchar(255) IN
@DESCRIPTION nvarchar(1000) IN
@STEPLISTXML xml IN
@CHANGEAGENTID uniqueidentifier IN
@CURRENTAPPUSERID uniqueidentifier IN

Definition

Copy


      CREATE procedure dbo.USP_QUEUEPROCESS_EDIT
      (
        @ID uniqueidentifier,
          @NAME nvarchar(255),
          @DESCRIPTION nvarchar(1000),
          @STEPLISTXML xml,
          @CHANGEAGENTID uniqueidentifier,
        @CURRENTAPPUSERID uniqueidentifier
      )
      as begin
          set nocount on;

        declare @GRANTED bit;

        -- BTR CR291118-010908 1/28/2008

        -- check to make sure the user has rights to all of the business process parameter sets

        -- used by the steps

        if dbo.[UFN_APPUSER_ISSYSADMIN](@CURRENTAPPUSERID) = 1
          set @GRANTED = 1
        else
          exec dbo.[USP_QUEUEPROCESS_APPUSER_GRANTED_ALL_STEPS] @CURRENTAPPUSERID, @STEPLISTXML, @GRANTED output;

        if @GRANTED = 1
            update dbo.QUEUEPROCESS set 
            NAME = @NAME,
                DESCRIPTION = @DESCRIPTION,
                STEPLISTXML = @STEPLISTXML,
                CHANGEDBYID = @CHANGEAGENTID,
                DATECHANGED = getdate()
            where ID = @ID
        else
          raiserror('The current user does not have rights to one or more of the business process parameter sets used in the queue.', 13, 1);

      end;