Posted on June 11, 2014 at 1.00 PM - Kuala Lumpur, Malaysia
There 2 types of process property in Boomi, those are process property and dynamic process property. The difference between these two is that the first one provides better user interface like help text and drop down values and can be persisted for the next run, whereas the latter one is meant to hold values temporarily during the process execution.
It's good to put parameters which may change from one environment to another as part of process property, so that they can be set separately for each environment. We can then evaluate the value of the process property in the process using Decision step, or use it to populate values to parameters of the Connector step. What if we want to use it in Data Process step with custom script?
Following is the script required to retrieve the value from dynamic process property:
// Import the ExecutionUtil class
import com.boomi.execution.ExecutionUtil;
// Set a Dynamic Process Property value and persist the dynamic property by setting the Boolean to "true"
ExecutionUtil.setDynamicProcessProperty("PropertyName", PropertyValue, true);
// Retrieve a Dynamic Process Property value
String myValue = ExecutionUtil.getDynamicProcessProperty("PropertyName");
Following is the script required to retrieve the value from process property:
// Import the ExecutionUtil class
import com.boomi.execution.ExecutionUtil;
// Set a Process Property component value
ExecutionUtil.setProcessProperty("ComponentID", "PropertyKey", "PropertyValue");
// Retrieve a Process Property component value
String myValue = ExecutionUtil.getProcessProperty("ComponentID", "PropertyKey");
As you can see from the script, accessing process property requires us to use Property Key instead of Property Name, and additionally Component ID. How do we get these values?
How do we get the component ID?
1. Right click on the process property and show usage
2. The component ID is shown in the component explorer field after text "ancestors:"
How do we get the property key? You can see it immediately from the process property component.
Life is beautiful! Let's make it meaningful and colorful!