在输出消息ESQL中包含输入消息

时间:2017-03-13 15:27:38

标签: ibm-integration-bus extended-sql

假设我在IIB中有一个错误处理程序子流组件,它生成一条错误消息,然后输出到队列。

错误消息的格式类似于:

addtable2plotWithRECT <- function(x, y = NULL, table, lwd = par("lwd"), bty = "n", bg = par("bg"), cex = 1, xjust = 0, yjust = 1, xpad = 0.1, ypad = 0.5, box.col = par("fg"), text.col = par("fg"), display.colnames = TRUE, display.rownames = FALSE, hlines = FALSE, vlines = FALSE, title = NULL) { if (dev.cur() == 1) stop("Cannot add table unless a graphics device is open") if (is.null(y)) { if (is.character(x)) { tablepos <- get.tablepos(x) x <- tablepos$x y <- tablepos$y xjust <- tablepos$xjust yjust <- tablepos$yjust } else { if (is.null(x$y)) stop("both x and y coordinates must be given") y <- x$y x <- x$x } } droptop <- ifelse(any(c("topleft", "top", "topright") %in% x), 1, 0) tabdim <- dim(table) if (tabdim[1] == 1) hlines <- FALSE if (tabdim[2] == 1) vlines <- FALSE if (is.null(dim(bg))) bg <- matrix(bg, nrow = tabdim[1], ncol = tabdim[2]) column.names <- colnames(table) if (is.null(column.names) && display.colnames) column.names <- 1:tabdim[2] row.names <- rownames(table) if (is.null(row.names) && display.rownames) row.names <- 1:tabdim[1] if (par("xlog")) x <- log10(x) cellwidth <- rep(0, tabdim[2]) if (display.colnames) { for (column in 1:tabdim[2]) cellwidth[column] <- max(strwidth(c(column.names[column], format(table[, column])), cex = cex)) * (1 + xpad) nvcells <- tabdim[1] + 1 } else { nvcells <- tabdim[1] for (column in 1:tabdim[2]) cellwidth[column] <- max(strwidth(format(table[, column]), cex = cex)) * (1 + xpad) } if (display.rownames) { nhcells <- tabdim[2] + 1 rowname.width <- max(strwidth(row.names, cex = cex)) * (1 + xpad) } else { nhcells <- tabdim[2] rowname.width <- 0 } if (par("ylog")) y <- log10(y) cellheight <- max(strheight(c(column.names, row.names, as.vector(unlist(table))), cex = cex)) * (1 + ypad) if (!is.null(title) & droptop) y <- y - cellheight ytop <- y + yjust * nvcells * cellheight oldpar <- par(xlog = FALSE, ylog = FALSE, xpd = TRUE) if (display.colnames) { xleft <- x + display.rownames * rowname.width - xjust * (sum(cellwidth) + rowname.width) for (column in 1:tabdim[2]) { # *** HERE *** rect(xleft, ytop-cellheight,xleft + cellwidth[column],ytop, col=bg, border=NA) text(xleft + cellwidth[column] * 0.5, ytop - 0.5 * cellheight, column.names[column], cex = cex, col = text.col) xleft <- xleft + cellwidth[column] } } for (row in 1:tabdim[1]) { xleft <- x - xjust * (sum(cellwidth) + rowname.width) if (display.rownames) { # *** HERE *** rect(xleft, ytop - (row + display.colnames) * cellheight, xleft + rowname.width, ytop - (row) * cellheight, col=bg, border=NA) text(xleft + 0.5 * rowname.width, ytop - (row + display.colnames - 0.5) * cellheight, row.names[row], cex = cex, col = text.col) xleft <- xleft + rowname.width } for (column in 1:tabdim[2]) { rect(xleft, ytop - (row + display.colnames - 1) * cellheight, xleft + cellwidth[column], ytop - (row + display.colnames) * cellheight, col = bg[row, column], border = bg[row, column]) text(xleft + 0.5 * cellwidth[column], ytop - (row + display.colnames - 0.5) * cellheight, table[row, column], cex = cex, col = text.col) xleft <- xleft + cellwidth[column] } } if (vlines) { xleft <- x + display.rownames * rowname.width - xjust * (sum(cellwidth) + rowname.width) segments(xleft + cumsum(cellwidth[-tabdim[2]]), ytop - display.colnames * cellheight, xleft + cumsum(cellwidth[-tabdim[2]]), ytop - (display.colnames + tabdim[1]) * cellheight) } if (hlines) { xleft <- x + display.rownames * rowname.width - xjust * (sum(cellwidth) + rowname.width) segments(xleft, ytop - display.colnames * cellheight - cumsum(rep(cellheight, tabdim[1] - 1)), xleft + sum(cellwidth), ytop - display.colnames * cellheight - cumsum(rep(cellheight, tabdim[1] - 1))) } if (!is.null(title)) { xleft <- x - xjust * (sum(cellwidth) + rowname.width) text(xleft + (rowname.width + sum(cellwidth))/2, ytop + cellheight/2, title, cex = cex, col = text.col) } if (bty == "o") { xleft <- x + display.rownames * rowname.width - xjust * (sum(cellwidth) + rowname.width) rect(xleft, ytop - (tabdim[1] + display.colnames) * cellheight, xleft + sum(cellwidth), ytop - display.colnames * cellheight) } par(oldpar) }

MQInput Catch和Failure终端的输出指向错误处理程序的Input。消息域在主消息流的MQInput节点上设置,可以是XMLNSC,也可以不指定。

鉴于此,如果我想在错误消息中包含原始消息的副本,在OriginalMsg标签中(因此它需要是CData),我该怎么做?

我尝试了类似下面的内容(a。无论如何都需要XMLNSC,b。似乎不起作用):

addtable2plotWithRECT(x=45, y=25,dd,bty="o",bg="white",display.rownames=T)

以上允许我部署我的条形文件,但输出只是一个空标记。

2 个答案:

答案 0 :(得分:1)

你的inRef变量很可能不在XMLNSC的解析器下。 IBM Integration Bus Parser只有在域解析器表示下才能将逻辑消息转换为phisycal消息。

确保您必须确保使用InputRoot中的消息,如下例所示:

DECLARE dataToBeParsed REFERENCE TO InputRoot.XMLNSC;
MOVE dataToBeParsed LASTCHILD;

DECLARE blobEnvelope BLOB ASBITSTREAM(dataToBeParsed
                                            ENCODING InputRoot.Properties.Encoding
                                            CCSID InputRoot.Properties.CodedCharSetId 
                                            SET '' 
                                            TYPE '' 
                                            FORMAT '' 
                                            OPTIONS FolderBitStream
                                            );

DECLARE envelope CHAR CAST(blobEnvelope AS CHAR CCSID InputRoot.Properties.CodedCharSetId);

答案 1 :(得分:0)

答案是使用InputBody:

.size()