Introduction
On the 27th June 2014 we released Oracle BPM 12c which included some exciting new features.
One
of the less talked about of new features is the support of BPM
Scripting which incorporates the Groovy 2.1 compiler and runtime.
So what is Groovy anyway?
Wikipedia describes Groovy as an object-oriented programming language for the Java platform and you can read the definition here.
In short though it is a Java like scripting language, which is simple to use. If you can code a bit of Java then you can write a bit of Groovy and most of the time only a bit is required.
If you can’t code in groovy yet don’t worry, you can just code in Java and that work most of the time too.
With great power comes great responsibility?
The benefits and possibilities of being able to execute snippets of groovy code in a BPM process execution are almost limitless. Therefore we must be responsible in its use and decide whether it makes sense from a BPM perspective in each case and always implement best practices which leverage the best of the BPM execution engine infrastructure.
If you can easily code, then it is easy to write code to do everything. But this goes against what BPM is all about. We must always first look to leverage the powerful middleware infrastructure that the Oracle BPM execution engine sits on, before we look to solve our implementation challenges with low level code.
One benefit of modelled BPM over scripting is Visibility. We know that ideally BPM processes should be modelled by the Business Analysts and Implemented by the IT department.
Business Process Logic should therefore be modelled into the business process directly and not implemented as low level code that the business will not understand nor be aware of at runtime. In this manner the logic always stays easily visible and understood by the Business. Overuse of logic in scripting will quickly transcend into a solution that will be hard to debug or understand in problem resolution scenarios.
If one argues that the business logic from your business process cannot be modelled directly in the BPM process, then one should revisit the business process analysis and review whether the design actually makes really makes sense and can be improved.
What could could be a valid usecase for groovy in BPM?
One valid usecase of groovy scripting can be complex and dynamic data transformations. In Oracle BPM 12c we have the option to use the following mechanisms for transformations:
Data Association
Good for:
- Top level transformations of the same or similar types
- Simple transformations of a few elements
- Lists and arrays
- Performance
Read the complete article here.
For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.
Blog
Twitter
LinkedIn
Facebook
Wiki