Closed
Reading work object using rule utility function
Hi All,
I wanted to read some property inside a work object from a Rule-Utility-Function, is there any OOTB standard way?
Thanks,
Sudarsan M
This content is closed to future replies and is no longer being maintained or updated.
Links may no longer function. If you have a similar request, please write a new post.
Hi All,
I wanted to read some property inside a work object from a Rule-Utility-Function, is there any OOTB standard way?
Thanks,
Sudarsan M
If you are trying to read a property from a work object then that means you are trying to extract the content from BLOB. So far I am not aware of a Rule-Utility-Function written to do this job, since it should be done by UDFs like pr_read_from_stream at database.
Best way is to expose the property from BLOB as a column, 'optimize for filtering' wizard can do that job for you. Else you can create a column with the name as same as defined on the property and mapping the appropriate column type to its relevant property type, once this is done at database you can run prpcUtils.bat commandline utility tool with the action as 'expose' by mentioning the class name (where the property resides) in the prpcUtils.properties file
Click on "(i) > Engine API" from the developer portal, and in the doc that pops up, see class "Database". The method you want is "open". You can open the work object by handle, and then read a property with class "ClipboardPage", for example method "GetString" if it's a string property.
Sometimes what I do is first code it up as an activity, then peek at the "action > java" to see what java got generated, if my goal is to package the work into a java step or a rule-utility-function. (Are you sure you wouldn't be better off packaging into an activity rule instead of a function?)
The relevant lines you would put in the activity for reading a property, so that you can peek at the java would be something like:
obj-open-by-handle
Property-Set
Question
Question
Question
Question
Question Solved
Support Doc
Question
Support Doc
Question
Question Solved
Pega Collaboration Center has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.