A message with only headers and an empty body is a normal message; the UCA / inbound integration still fires, the payload simply is empty. Two things to handle:
- Make the UCA robust: in the UCA's service (the one invoked by the JMS / MQ inbound event) treat an empty body as a valid case - use the header values as the business key:
// UCA service: input tw.local.message (String, the body) and tw.local.headers (NameValuePair list on BAW 20+ event message with headers; older: the "event" String)
var body = (tw.local.message || "").trim();
if (body === "") {
// header-only message: take the key from the JMS properties
var key = null;
for (var i = 0; i < tw.local.headers.listLength; i++) if (tw.local.headers[i].name === "orderId") key = tw.local.headers[i].value;
if (key == null) throw new Error("Empty message without orderId header - ignored");
tw.local.orderId = key; tw.local.payload = null;
} else {
var parsed = JSON.parse(body); tw.local.orderId = parsed.orderId; tw.local.payload = parsed;
}- Correlate on the header, not the body: the UCA's correlation key (the value that matches the waiting intermediate message event or the start event) can be mapped from any output of the UCA service - map tw.local.orderId to the correlation parameter; the BPD's message event correlates on its own variable (tw.local.orderId == key).
If the messages come through the JMS / MQ inbound integration of BAW (Message Driven Bean > event manager), the JMS properties are available as the eventmsg attributes for JMS messages that BAW itself formats; for foreign messages use a Java integration reading javax.jms.Message.getStringProperty(...) in a small MDB / Java listener, or put a message flow (IIB / ACE) in front that copies headers into the body - the common enterprise pattern.
References