Originally posted by Paul Glezen
I have a Xlate rule that invokes a Code Fragment UPOC. The COPY action body calls a Tcl proc that inspects a few fields to determine whether translation should continue or whether the message should be written to the error DB. I'm trying to determine the best way suspend processing and send the message to the error DB in the latter case.
Unlike the TPS case, I don't easily have control over the message disposition list. I could set the Error behavior of the action to "Error" and then somehow cause an error in the Tcl proc. But now I'm thinking a refactoring is in order whereby I invoke the Tcl proc as a Route Detail Pre-Processor. Pre-TPS would be too early since this error determination is specific to the route detail. I could then set the message disposition to ERROR if the message wasn't appropriately populated for the route detail.
The drawback is that I wouldn't have the message parsed by the FRL at this stage. Instead, I would have to count field positions on the message content and extract these myself. Shouldn't be a big problem; but it would hardcode field offsets in Tcl code that would probably be overlooked if the FRL ever changed.
Is there a standard practice for this kind of thing?