Hello, @takbb how are you?
Sorry to bother you.
I would like some help to learn how the code I did in “Column Expressions” would look if it were created in “java snippet” code would be done in java snippet.
For me to understand how the logic works in Java snippet, it’s easier if it’s with some data that I’m familiar with.
But take your time, you can look at it whenever you’re free. It’s just for my learning.
I’m providing a workflow already with the rules executed.
The columns in “blue” are the values from the database, the columns in yellow are the ones created by “column expressions.”
About the file: it’s just an inventory control, product cost, where the initial balance is 57 units, with a total value of 6726.52 and a unit value of each piece of 118.01 (first row).
Then, inventory control is done where code 1409 means a goods entry, so 57 +1 is added, and the value of 146.01 is added to the total.
(In the “@Qtd_Consumo” column, what is negative is stock output and what is positive is stock input)
In the example file, the result is already there, and by generating the flow again, the columns are created again in “orange”.
(I tried to keep it as simple as possible. In fact, it was you who helped me build the “column expressions” formula, but I know you have a lot of knowledge in Java and I had this pending task of using this example and trying to ask for your help to build it in Java, so I can understand and learn how to better understand the node).
You can use any java snippets you have to…
Change_to_java_snippet.knwf (26.5 KB)