Search code examples
regextransformationtibco

TIBCO BW Convert to Title Case and Calculate age


I am doing a Tibco BW application that gets data from a DB and I need to make the first letter of all words into uppercase and calculate the age according to the birth date (column in the DB).

I have NO idea how to do the date calculation.

And for the Uppercase conversion I am trying this:

replace($Invoke/parameters/tns1:getCustomerDBResponse/first_name, "(^[a-z]| [a-z])", "\\U$1")

But it results on replace the first character with \U instead of making it uppercase. I tried removing a backslash from the replacemente regex, but it sends me an error in the transformation!

Any idea on how to solve this? Thanks!


Solution

  • To make the first letter of all words into uppercase I would split the string in two parts, one with the first character, the other with the remaining part, then I would use upper-case() to have the first string in uppercase and then I would concatenate the two strings. Not sure if there is a better way.