USP_WORKFLOW_TASK_MARK_CANCELLED
Executes the "Workflow Task: Mark Cancelled" record operation.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | Input parameter indicating the ID of the record being updated. |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the update. |
Definition
Copy
CREATE procedure dbo.USP_WORKFLOW_TASK_MARK_CANCELLED
@ID uniqueidentifier,
@CURRENTAPPUSERID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null
as
declare @USERCANMARKCANCEL bit;
select @USERCANMARKCANCEL=USERCANCANCEL from dbo.BBWORKFLOWTASK where ID = @ID;
if @USERCANMARKCANCEL = 0
BEGIN
RAISERROR('This task cannot be marked canceled by an end user.',16,10);
return 500;
END
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
declare @r int;
exec @r=dbo.USP_BBWORKFLOW_SERVICE_SENDMESSAGE_TASKCOMPLETED @ID, @CURRENTAPPUSERID, @CHANGEAGENTID, 2;
return @r;