Posts

Showing posts with the label TIBCO BW

Parsing a JSON String and Converting it to XML in TIBCO

Image
If you have the REST & JSON Plug-in for TIBCO BusinessWorks, parsing and rendering a JSON string into XML is a straightforward task. We are often using XML in TIBCO, because XML is the most common format that is used to transform data using XSLT and XPath language. There are two ways we can parse and render JSON text: using an XML Schema, and using Java classes. Of course, XML Schema is already very handy, as we can always easily create one in TIBCO Designer. But, before we go to why we need to use Java classes, we need to examine first the nature of an XML Schema. An XSD describes the XML document in a strictly structured manner, which means that the sequence and nesting of the elements are important. However, for JSON, we cannot rely on the order of the elements, and we cannot force JSON to be that way. It’s just its character, and it maintains itself as an unordered collection of zero or more name/value pairs. That said, we cannot expect a JSON message to conform to the sp...

How To Map Password Type Global Variable In Activity Input

Image
As you may already know, you cannot map a global variable that is a password type to the Activity Input. You can only map it to a Shared Configuration resource when possible. One way to retrieve the global variable password value is to write a Java code. But there is another preferable way to have one less activity in your process definition, and that is using a Java Custom Function. Of course, you will still write Java code one time, but it's a whole lot reusable; and you can export it as a Project Library that you can use in a different Designer project. So you want to write a Java code, but you are not quite sure which JAR file the Java class is located; on the other hand, you know the fully qualified name of the class and the method name to invoke. Personally, I find it appropriate to use The Reflection API to write a few lines of code in order to achieve this. We want to have a function that retrieves the value of a password global variable passing the global variable path ...