EDUCAÇÃO E TECNOLOGIA

Groovy IDE Desktop Jar Support and Other Updates

Thanks to support and feedback from the community, Groovy IDE has been active and improving.

Here are the significant updates since my last blog post.

Jar Support

While the web version can’t support Jar imports and outbound connections for security concerns, running Groovy IDE on your computer enables these.

This is the format for Jar imports

//groovyide.com:jar:file:<<full path of Jar on your PC>>
  • Download the jar to your PC
  • Import the same Jar to the Flow on CPI.
  • Add the comment to your script.
    • Since it is just a comment, it will work both in Groovy IDE and in CPI without any change.

I also like it is self-documenting about which Jars a script needs. For Java projects, you can use Maven or Gradle so you will only need the artifact names. But in CPI you will need particular Jars. So it helps to write them down in the comments.

Example for Apache Commons CSV:

import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
//groovyide.com:jar:file:C:/dev/temp/commons-csv-1.8.jar
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;

Resizable Windows

I know it is not a big update, but I like small, quality of life updates. I’m open to ideas that can save each expert even 1-2 seconds for a task. That is the point of Groovy IDE: saving time for experts.

You can resize panes for input, script, and output individually.

MPL Log Simulation

Now you can use “messageLogFactory” and see log properties, custom header properties, and full attachments!

Example script:

import com.sap.gateway.ip.core.customdev.util.Message; def Message processData(Message message) { def body = message.getBody(java.lang.String) as String; def messageLog = messageLogFactory.getMessageLog(message); if(messageLog != null){ messageLog.setStringProperty("Logging", "Printing Payload As Attachment"); messageLog.addAttachmentAsString("Message#1", body, "text/plain"); messageLog.addCustomHeaderProperty("po_number", "123456"); } return message;
}

Click to try it on Groovy IDE

Example Output:

Specify Script Function

You can use functions other than the default “processData”

Bug Fixes

In the past, there were reported errors where Groovy IDE would show a blank page. Bugs causing the error are fixed and if some other critical bugs appear now it shows a button to reset the browser state.

There are still ideas to implement and I love to discuss features with the community. You can use the feedback form to get in contact.

You can download the desktop version from Microsoft Store: https://www.microsoft.com/en-us/p/groovy-ide/9n7z5k1vrhb3

Thanks for reading!