We are trying to use a portion of the sample code in ../cis19.1/integrator/tclprocs/errordbtps.tcl.
This is the proc that you can specify either in a Thread configuration (on the main properties tab, in the field Error Database Procs), or in a Process configuration (also on the properties tab, in the field Error Database Procs). This proc receives control when a message is about to be placed in the Error Database and allows you to change the disposition – for example, to retry the message.
I believe it is working – we check the context and when it is “error_db” we change the disposition to RETRY. We put echo statements in it and see them displayed in the log.
Is the error message text, which is normally seen in the process log, available somewhere in the message metadata? I am retrieving the contents of USERDATA to display, but it seems to be empty. Is there another metadata field that holds an error message?
Thanks
proc cl_retry_err_msg { args } {
keylget args MODE mode
set dispList {}
set module “cl_retry_err_msg”
set debug 2
if {$debug > 1} {echo “$module debug enabled”}
switch -exact — $mode {
start {
if {$debug > 1} {echo “$module start mode”}
}
run {
keylget args CONTEXT ctx
if {$debug > 1} {echo “$module context: $ctx”}
keylget args MSGID mh
set userdata [msgmetaget $mh USERDATA]
if {$debug > 1} {echo “$module userdata $userdata”}
if {$ctx ne “error_db”} {
lappend dispList “CONTINUE $mh”
if {$debug > 1} {echo “$module context $ctx not error_db – continuing message”}
} else {
lappend dispList “RETRY $mh”
if {$debug > 1} {echo “$module context $ctx = error_db – retrying message”}
}
}
}
return $dispList
}
Peter Heggie