Posted: 1 Jun 2017 8:15 EDT Last activity: 19 Jun 2017 9:59 EDT
How to replace a String with another string present in the work object data? (User entered data)
We have a requirement to replace a particular text with another Text in all the user entered data in existing work object. That text can be present in normal property value or any of the embedded property value.
We thought to get the work object in a page and convert the work object XML to string and then replace the required text. But in this case, we can't save the replaced text as we replacing in string. Again converting string to XML, parse that XML, setting the values in work object ... it is very lengthy and may not be feasible. Every workobject follows different flow at run time, so the page structure can be different for every work object.
Could some one please suggest if there is any easy way to do this?
Work objects contain Number of simple properties, pagelists, pagegroups which may contains N number of pages inside it. We are not sure which property in which level (in case of pagelists) contains the required text.
along with that another concern is, different work objects contains different set of properties based on the process flow which users follows at run time.
It is probably not the easiest approach but I think I would identify an exhaustive list of properties potentially containing the text you actually try to replace. And then work out an activity to open the WorkObject and update all elements on my list having the value with a DataTransform before doing an Obj-Save and a Commit.
I think it would be the best approach. I will try to find out the probable list of properties which contains the required text or otherwise the properties which we are BIX and send to downstream systems.