Hi David,
There's a JavaAction named: End Transaction and start transaction in community commons, use this JavaAction before calling your java action, this way, your transaction will be committed, before calling your custom Java action,
So.. Before calling your java action, use EndTransaction then StartTransaction and then call the JavaAction, this way it should work.
Hope it helps,
Thank you!
Hi David, I am the creator if this module. Reading this I don't directly have a clue. Perhaps it is good to enable TRACE logging for the module. I added quite some trace logging to see what happens with the data fed to the Java action. Let me know what that brings! If that doesn't bring you what you need, happy to have a quick peek if you can share the actual project or a test project.
Here's a screenshot of how I have the End- and StartTransaction CC functions set up...
OK, so I've narrowed it down a bit further - it appears that the Enumerations (or, even more specifically, the captions) are null once passed to the Java Function. So these lines:
Enum_FontType fontType = tbleCell.getFontType(); <-- this is OK
String fontTypeString = "Normal";
if (fontType != null) { <-- this is OK as well, the attribute exists
fontTypeString = fontType.getCaption(); <-- this results ing the fontTypeString being null
}
Where attributes that are not enumerations are passed through, like tableCell.getFontColor() or tableCell.getValue(), the values are fine and can be used (although the getFontColor() failed as I specified 'Red' in my test).
I couldn't see in the function where Enum_FontType was declared so I suspect that's in the Apache POI library somewhere. I'm going to dig into that a bit but I thuoght the extra info might help!
Hi Everyone,
Update on this one. I created a new project / app and re-added the WordTemplate module to it. I had to create an app in 10.24.x as the WordTemplate module has been upgraded beyond the 10.18.x version I was using. Created a template and ran it through and it worked flawlessly. As far as I could tell, the java function was the same as the old version, but didn't receive null values like the old version did. Would the next best stap be to upgrade the app and re-add the new version of the module?
Hi David,
Great to hear the new version worked. It is hard to say why it worked as I don't know the details of your app. If you would like to be certain; could you share with me from which version you are upgrading to which version? And whether you upgrade via the module in the Marketplace or extracting it from the demo project? And whether you have the excel importer and/or exporter modules in your app? If so, which version? These modules also use the Apache POI library and can conflict when using different versions from the word template you are using.