3

I have a message flow in IBM Integration Bus.

I have some input that specifies a UUID, I want to test if that UUID is valid and if it is not I'd like to generate one.

Downstream if I call something like UUIDASCHAR I get a BIP2582 exception for (Invalid UUID).

DECLARE myUuid BLOB InputRoot.XMLNSC.someUUID
SET someUuidChar = UUIDASCHAR(myUuid); -- This throws exception if myUuid is invalid

I'm not sure how to tackle this in esql, this is the type of logic I'm looking for:

if (is_valid(uuid)) then
     set output_uuid = uuid
else
     set output_uuid = generated_uuid
end if

Thanks

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
bbedward
  • 6,368
  • 7
  • 36
  • 59

1 Answers1

3

You can put your validity check and UUID generation in 2 different ESQL files. Your first ESQL should call UUIDASCHAR normally, and Failure terminal of its compute node should be connected to compute node of second ESQL, which generates a new UUID.

uoyilmaz
  • 3,035
  • 14
  • 25