New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing value from DB to JSLT node #322
Comments
I guess the use case here is that instead of the usual model of If so, one way to do it is indeed to add the necessary db state to the input. That is ugly, though. The best way to solve this is to use the JSLT API and pass parameters to the transform. You can build an entire object and pass that, or set a bunch of single values. Parameters are available as variables inside the transform. |
Thanks for the quick response @larsga . Will check this. |
Can we insert a javascript code in a JSLT field? That may be a work around here |
I will also explain my scenario here. Any help would be much appreciated!!! we are currently building a pass through system, where we get request from System A in a JSON format, we need to convert that to a different JSON format and pass to system B and vice versa. Here we will have most of the data available from system A, but some data we need to take from our system (the pass through system). |
In that case we'd need to extend JSLT with a JavaScript interpreter running inside the JVM that could somehow connect to your database. This is far too complex, and I also don't think you need it.
Why can't you write Java code to make the data from your system available as parameters? |
Why can't you write Java code to make the data from your system available as parameters? |
Did you follow the link to the documentation in the first comment I made? |
Hi , Yes i did. Still figuring out how to fit that in our approach. Will keep this group posted. |
Hi Team,
We have a requirement where we convert a JSON from one structure to other. However in target structure we do have values from source json and some value directly from database? Is there a way we can write expression or code to fetch data from Database and append to a node?
Or anyways to achieve this?
The text was updated successfully, but these errors were encountered: