I have a variable in the dynamic process property set to "abc". Let's say I need to replace "c" with "d", so that the variable's value is "abd". What the easiest/proper way of doing it?
Decided to do via the Data Process Shape custom script.
My GRID_ARTICLES_DETAIL_URL dynamic process property value is being stripped of its URL and the resulting variable value is being assigned to ARTICLE_PATH.
import java.util.Properties;import java.io.InputStream; import com.boomi.execution.ExecutionUtil; import com.boomi.execution.ExecutionManager;
// Retrieve current Dynamic Process Property valueddp_value = ExecutionUtil.getDynamicProcessProperty("GRID_ARTICLES_DETAIL_URL");
new_value = ddp_value.replace("https://api.figshare.com","");
// Set the dynamic process propertyExecutionUtil.setDynamicProcessProperty("ARTICLE_PATH", new_value, false);
That's a pretty straight forward way of doing it. If you wanted to go strictly out of the box you could create a branch, add a message shape and call the DPP into the Message shape, then use a search/replace in a data process shape with a hard coded value, and drop that into a new set properties shape. Problem is the search/replace in the Data Process can't use a dynamic value (that I know of) if that's what you're going for, just regex at best. Out of the box dynamic you'd need to create a user defined Map Function and do a get DPP for the values you need and plug those into a string replace function, then set the DPP at the end of the function. You can call that in a business rule (kind of a hack, just set the conditions part of the business rule to an absolute like "true" = "true") or in a map shape that I know of... or do your custom script, like I said, probably the most straight forward if it's already working. Just some options.
Retrieving data ...