Set Process Property in Dell Boomi Groovy
Setting Process Properties in Dell Boomi with Groovy Scripting
Dell Boomi provides process and dynamic process properties (DPPs) to store configuration values within your integrations. While the Boomi interface allows for the visual setting of these properties, Groovy scripting offers more flexibility for programmatic control. This blog post will guide you through setting process properties using Groovy scripts in Dell Boomi.
Understanding Process Properties and DPPs
- Process Properties: These properties are associated with a specific process component (e.g., a Mapper or a Connector). They persist across deployments and restarts.
- Dynamic Process Properties (DPPs): DPPs are global properties accessible throughout your Boomi environment. You can override them at the process level if needed. They are not persistent by default.
Setting Process Properties with Groovy
Here’s how to set a process property using a Groovy script:
Groovy
import com.boomi.execution.ExecutionUtil;
// Replace with your component ID and property key
String components = “your_component_id”;
String property = “your_property_key”;
String propertyValue = “your_property_value”;
ExecutionUtil.setProcessProperty(component, property, propertyValue);
Use code with caution.
content_copy
Explanation:
- We import the ExecutionUtil class, which provides methods for interacting with Boomi’s execution environment.
- Define variables for the componentId, propertyKey, and propertyValue. Replace these with your actual values.
- componentId: This is a unique identifier for the process component where the property resides. When editing the component properties, you can find this ID in the Boomi interface.
- Property: This is the name of the specific property within the component.
- propertyValue: This is the value you want to assign to the property.
- Call the setProcessProperty method with the defined variables. This method sets the value for the specified property.
Important Note:
- Process properties can be complex data types like lists or maps. However, the setProcessProperty method only accepts strings. Before setting the property, you must convert your complex data to a JSON string.
Setting Dynamic Process Properties (DPPs) with Groovy
The approach for setting DPPs is similar to process properties:
Groovy
import com.boomi.execution.ExecutionUtil;
String dppKey = “your_dpp_key”;
String dppValue = “your_dpp_value”;
boolean persist = true; // Set to true to persist the DPP change
ExecutionUtil.setDynamicProcessProperty(dppKey, dppValue, persist);
Use code with caution.
content_copy
Explanation:
- Import the ExecutionUtil class as before.
- Define variables for the dppKey, dppValue, and persist.
- dppKey: This is the name of your Dynamic Process Property.
- dppValue: This is the value you want to assign to the DPP.
- Persist (optional): This boolean flag determines if the change to the DPP should be persisted across deployments. By default, DPPs are not persistent. Set persist to true to make the change permanent.
Remember:
- Use Groovy scripts with caution in a production environment. Always test your scripts thoroughly before deployment.
Conclusion:
Unogeeks is the No.1 IT Training Institute for Dell Boomi Training. Anyone Disagree? Please drop in a comment
You can check out our other latest blogs on Dell Boomi here – Dell Boomi Blogs
You can check out our Best In Class Dell Boomi Details here – Dell Boomi Training
Follow & Connect with us:
———————————-
For Training inquiries:
Call/Whatsapp: +91 73960 33555
Mail us at: info@unogeeks.com
Our Website ➜ https://unogeeks.com
Follow us:
Instagram: https://www.instagram.com/unogeeks
Facebook: https://www.facebook.com/UnogeeksSoftwareTrainingInstitute
Twitter: https://twitter.com/unogeek