Search This Blog

Wednesday, July 8, 2009

Technique for reading user parameters from the back end

When BPMC feeds are executed, there are two separate modes of operation: Attended and Unattended. The parameters the end-user selects from the DPC Load Data Panel (Attended) may be different than the parameters the end user has set in the DPC Schedule Panel (Unattended). The BPMC processes are designed to be flexible and accommodate different set of parameter values for each mode to better fit the need of the business scenario. However, this flexibility can add a degree of complexity when trying to detect via SQL what the correct parameter the end user has selected. The following SQL code demonstrates a technique that allows proper reading of the user defined variable depending whether the process is run as Attended or Unattended.

use bpmconnect
go
select
case when (select attended from config_pkg where feed_name = 'MyBabyFeed
') = 1 then
(select param_valueattended from config_rqp where feed_name = '
MyBabyFeed')
else
(select param_valuedefault from config_rqp where feed_name = '
MyBabyFeed')
end as [ParamValue]


NOTE: When a feed is fired from the Config Builder tool, is run under Unattended mode. This can sometimes be a point of confusion for developers and is something to consider when testing.

No comments:

Post a Comment