HOW TO RETRIEVE "EXECUTION PROPERTIES" THROUGH "GROOVY SCRIPT"
Execution properties contain run-time information related to a specific execution of an integration process. You can use execution properties in a process to support built-in testing logic, generate dynamic email notifications, or create custom reports. Properties such as account ID and execution ID can also be useful for logging process activity and for troubleshooting
Execution properties can be retrieved from the parameter value list for the following shapes:
- Decision shape
- Exception shape
- Message shape
- Notify shape
- Process Route shape
- Program Command shape
- Set Properties shape
You can also retrieve execution properties within custom scripting by using the getRuntimeExecutionProperty () method available within the ExecutionUtil class
What is Groovy Script?
Apache Groovy is an Object-oriented programming language used for Java platform. This dynamic language has many features which are similar to Python, Ruby, Smalltalk, and Pero. It can be used as a scripting language for the Java platform. It is almost like a super version of Java which offers Java's enterprise capabilities. It also offers many productivity features like DSL support, closures, and dynamic typing. Unlike some other languages, it is designed as a companion, not a replacement for Java. Groovy source code gets compiled in Java Bytecode so it can run on any platform if JRE is installed on that operating system. Groovy also performs a lot of tasks behind the scene that makes it more agile and dynamic. Custom scripting allows you to perform custom manipulations and logic within a process to accomplish unique and advanced requirements that fall outside the native functionality of Boomi Integration. Custom scripting is available within a custom scripting step of a Data Process shape or a custom scripting map function.
You can implement custom scripting in one of two ways:
- Insert an inline script for one-time use.
- Reference a Scripting component that is available for reuse
Select New Component from the Drop-down list
Provide the required Component Name and keep the type as process
Select the start shape connector with type as no data and click on OK
Select message connector from pallete
Provide a sample message to perform the required process
Select Map connector from the pallete
Import the suitable required profiles to the mapper and map the required fields
Click on OK
Select program command connector from pallete
Type the required SQL Query to perform the operation
For the variables, add the dynamic process property fields from the mapper output profile
Select the branch connector from pallete
Select data process connector from pallete
Choose process type as “Custom Scripting”
Under script field click on edit to write the own groovy script
Write the required groovy script, for execution properties
Select message connector from the pallete
Write the required message in the message box by allotting the variable numbers
Call the DPP with the names given in the groovy script
Connect the branch connector to the start connector
Select mail connector from the pallete
Provide the suitable connections and operations by choosing the action type as Send
Fill the essential fields for the mail operation
At last the final process flow is as shown in the below figure
The mail received may contains the following list of execution properties mentioned above