USP_DATAFORMTEMPLATE_VIEW_STEWARDSHIPPACKAGEPROCESSHISTORY
The load procedure used by the view dataform template "Stewardship Package Process History View Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@BUSINESSPROCESSSTATUSID | uniqueidentifier | INOUT | BUSINESSPROCESSSTATUSID |
@PARAMETERSETID | uniqueidentifier | INOUT | PARAMETERSETID |
@COMPLETED | nvarchar(5) | INOUT | COMPLETED |
@NAME | nvarchar(100) | INOUT | Name |
@OUTPUTFORMAT | nvarchar(255) | INOUT | Output format |
@STARTEDBY | nvarchar(128) | INOUT | Started by |
@STARTEDON | datetime | INOUT | Started |
@BUSINESSPROCESSSTATUSGUID | nvarchar(36) | INOUT |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_STEWARDSHIPPACKAGEPROCESSHISTORY
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@BUSINESSPROCESSSTATUSID uniqueidentifier = null output,
@PARAMETERSETID uniqueidentifier = null output,
@COMPLETED nvarchar(5) = null output,
@NAME nvarchar(100) = null output,
@OUTPUTFORMAT nvarchar(255) = null output,
@STARTEDBY nvarchar(128) = null output,
@STARTEDON datetime = null output,
@BUSINESSPROCESSSTATUSGUID nvarchar(36) = null output
)
as
set nocount on;
set @DATALOADED = 0;
select
@DATALOADED = 1,
@BUSINESSPROCESSSTATUSID = STEWARDSHIPPACKAGEPROCESSHISTORY.BUSINESSPROCESSSTATUSID,
@PARAMETERSETID = STEWARDSHIPPACKAGEPROCESSSTATUS.PARAMETERSETID,
@COMPLETED =
case
when (BUSINESSPROCESSSTATUS.STATUSCODE = 0) then
'True'
else
'False'
end,
@NAME =
case
when STEWARDSHIPPACKAGEPROCESSHISTORY.NAME = '' then
'Process is starting...'
else
STEWARDSHIPPACKAGEPROCESSHISTORY.NAME
end,
@OUTPUTFORMAT = dbo.UFN_BUSINESSPROCESSVIEW_GETNAME(STEWARDSHIPPACKAGEPROCESSHISTORY.BUSINESSPROCESSVIEWID),
@STARTEDBY = STARTEDBY.USERNAME,
@STARTEDON = BUSINESSPROCESSSTATUS.STARTEDON,
@BUSINESSPROCESSSTATUSGUID = STEWARDSHIPPACKAGEPROCESSHISTORY.BUSINESSPROCESSSTATUSGUID
from
dbo.STEWARDSHIPPACKAGEPROCESSHISTORY
left join dbo.STEWARDSHIPPACKAGEPROCESSSTATUS on STEWARDSHIPPACKAGEPROCESSHISTORY.BUSINESSPROCESSSTATUSID = STEWARDSHIPPACKAGEPROCESSSTATUS.ID
left join dbo.BUSINESSPROCESSSTATUS on STEWARDSHIPPACKAGEPROCESSHISTORY.BUSINESSPROCESSSTATUSID = BUSINESSPROCESSSTATUS.ID
left join dbo.APPUSER STARTEDBY on BUSINESSPROCESSSTATUS.STARTEDBYUSERID = STARTEDBY.ID
where
STEWARDSHIPPACKAGEPROCESSHISTORY.ID = @ID;
return 0;