- 12 Jun 2024
- 1 Minute to read
- Print
- DarkLight
About Groovy
- Updated on 12 Jun 2024
- 1 Minute to read
- Print
- DarkLight
The Apache Groovy™ programming language offers a concise, familiar, and easy-to-learn syntax. It delivers a range of features, including scripting capabilities, to applications.
To get started with Apache Groovy, read the Groovy documentation .
Groovy in Zilliant CPQ
Zilliant CPQ supports scripting using the Apache Groovy language. Groovy scripts can be run automatically when a particular supported action is performed, such as when a user creates a quote or updates the value of a field.
Use Groovy scripts to apply custom business logic to standard application functionality that can't be achieved through configuration. Example scenarios include:
- Integrating external systems for order creation, pricing, document storage, or approval through a business application programming interface (BAPI)
- Implementing non-standard ERPs
- Defining general application behavior, such as default values or copy behavior
- Implementing functions on top of Google Maps API
- Influencing pricing or availability of custom attribute values
Two general use cases apply to implementing scripts in the application:
- Create custom functionality. You may want to perform some actions repeatedly and automatically to support your company's specific workflow. Use custom Groovy scripts to perform these actions.
- Implement a custom feature. You can use a custom program to implement a feature unique to your company.
Groovy file naming conventions
By convention, a Groovy script can have any file extension. However, when used in the CPQ application, it must have a .groovy
extension.
Because the script is compiled into a Java-compatible class at runtime, the filename should meet the criteria of a Java class. For more information about naming restrictions, read the Naming section in the Java Tutorials documentation .
Tools
You can use any text editor or IDE to develop a Groovy script. However, there is no support for any IDE that allows for automatic code completion for custom classes. If you plan to use cloud debugging, you must use an Eclipse IDE.
Zilliant recommends using VisualStudio to work with Groovy scripts.
API Documentation
Refer to Apache Groovy for general information and help writing Groovy scripts. For information about custom classes and available APIs, refer to the Zilliant Groovy API documentation on GitHub.