Groovy IDE had some basic flaws! Thanks to Philippe Addor‘s high-quality feedback, they are fixed and every user in the community benefits from the result!
1.Confusing “Connection Error” in the console.
This error could occur for other reasons and mislead the user so I just changed it to “Error”
2.Missing Groovy DateUtil Extensions functions
This code is now working:
def date = new Date() date = date.minus(days)
3.Completely wrong getBody function!
As I discussed in my previous blog post message.getBody can use different class types. But the first implementation in Groovy IDE was wrong. It took some encouragement from the community to fix it 😊
There is another community member(whose profile I wait for permission to share. Edit: Thanks momin alim-ahmed !) that made me aware that org.w3c.dom.Document works on CPI.
After the fixes, it works with InputStream as default
//This is InputStream def body = message.getBody() def root = new XmlSlurper().parse(body)
You can also use Reader as it is common in the examples.
Reader reader = message.getBody(Reader) def root = new XmlSlurper().parse(reader)
I have also added a feedback form! Just click on the “Give Feedback” button. If you have any issues with the code that works on CPI, you can send the problematic case with a Groovy share link so I can analyze it. You can also send your ideas about UI and other useful tools.
This can be interesting! I have published a version that works on Windows 10. You can download it from the Microsoft Store:
If you ever wanted to work on Groovy mappings while you are on a plane, you can do easily now 🙂 Feel free to comment if offline functionality is important for you, so I can plan to spend more time on its development.
See you in the next post! Until then I’m waiting for your ideas!