Question
Murex
LB
Last activity: 27 Jan 2016 8:02 EST
Reading from the Clipboard in an Activity
Hello Guys,
I am fairly new to Pega and I need to access the contents of the clipboard from within an activity; more specifically I also need to retrieve data from the Data Pages present in the clipboard (I can view them using the tool under Data Pages --> Thread).
Can you guys point me as to how this should be done?
Thanks!
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
check this link: https://community.pega.com/sites/default/files/help_v719/procomhelpmain.htm. typically you use tools.findPage("pagename") to get the ClipboardPage.
Murex
LB
Thank you for your help Kevin, I'll take a look at the above. It seems it has to be through a java block?
Pegasystems Inc.
US
not necessarily, see the reply from Rajiv. But I thought you wanted to use the API from java step.
Murex
LB
Oh. So if it is to be done from an activity then it has to be through a java block; otherwise I can use a data transform?
Pegasystems
IN
Not necessarily. You can use other "Methods" in an activity like ARULDEVAN T.T mentioned in his reply. You have Property-Set, Page-Copy, Page-Remove etc. activity step methods that can reference and manipulate data pages (and any other clipboard page).
Murex
LB
Hey Rajiv,
I actually tried to use the property-set method, but I seemed to get an empty value. I attached a screenshot. Here I am trying to set the Function property on the 3 page of the MatrixRows pagelist to the value of the Function property on the Clipboard data page. Even though the clipboard data page has the Function property set to Front-office, I did not receive a value. That is why I thought I was referencing the clipboard data page erroneously.
Again, thank you for your help!
Virtusa
IN
I could see that, you are setting the value of matrixpage.MatrixRow(3).Function as D_MatrixRowPopulationList.pxResults(1).Function.
Am I correct?
Murex
LB
That is what I was trying to do. Unfortunately it didn't seem to update the vale of matrixpage.MatrixRow(3).Function.
Virtusa
IN
Hi Joe,
Could you please share the Matrix page in Clip board, Pages and classes tab of the activity which you try to set the value and the steps in the activity.
(Complete steps will be useful)
Thanks
Murex
LB
Citicorp Services India Private Limited
IN
Hi Joe,
In PopulateRows activity step 5 is commented out. Could you please remove the comment symbol "//" and try?
Please let me know whether this helps.
Thanks,
Gowrishankar.
Virtusa
IN
Why the property set method is commented. Is it for testing...(Just for sceenshot?).
If not please un-comment it and try..
Virtusa
IN
Please let know whether your issue get solved...
Thanks.
Murex
LB
Hey Guys,
Just got in the office from the weekend.
Step 5 is only commented in the screenshot. I ran the activity without the comments of course and faced that issue.
Again, thank you all for your help and concern
Citicorp Services India Private Limited
IN
Hi Joe,
From the Clipboard screen shot, I see that matrixPage is not created in Clipboard. I suspect the following scenarios
1. If you are just running the activity without selecting the correct thread. By default the activity will run in Standard thread. You have select the correct thread context on running the activity as shown in the below screen shot. In your case you have to select S-89 as Thread.
2. You can look for the matrixPage under Standard Thread. If you have not selected the correct thread. You can see the values in matrixPage, if the Data Page D_MatrixRowsPopulationsList is requestor level page.
Could you please choose the correct thread context and run the activity.
Please let me know whether this helps.
Thanks,
Gowrishankar.
Murex
LB
I tried your suggestion for debugging purposes. Thing is, I am calling the activity in the Post-Processing actions tab on a flow-action, so I don't think I have the power to do that? Also it shouldn't be needed right?
I think that answers your question as well ARULDEVAN T.T ?
Virtusa
IN
Hi Joe,
Could you please let us know where you are referring the activity in the flow?
Thanks.
Murex
LB
Ok so I tried to hard code a value in the value field and I still got an error (something that says goal seek failed). The error made no sense to me because it had something to do with a page in the pagelist that I wasn't even trying to write to. I asked our IT department to restart our servers and I cleared my cache and now it's working. I tried reading from the data page next and it worked as well.
I guess I'll now shift my attention to trying to figure out how to loop across the many pages in the data page (the set of pxResutls pages) and applying the IfRowSelected=true condition and then reading from the data page and writing into my own class instance.
Thank you so much for your help thus far, it is extremely appreciated!
Virtusa
IN
That's great to hear.
Thanks.
Updated: 22 Jan 2016 7:23 EST
Virtusa
IN
Hi Joe,
From your question, i could understand that you are trying to access the values present in a clipboard page in some activity. Please correct me if i'm wrong.
If this is the query, you can use the below syntax to access the values.
PageName.PropertyName
eg) "Temp" is a page and "pyStattusWork" is the value in it, us e as Temp.PyStatusWork
Where "pageName" is the page which you can found in clipboard, and "PropertyName" is the property value.
If the age is not in context of the Activity Or if the page is a top level user page, Please define it in the pages and classes tab.
The same goes for Data Pages too.
You can use Property-set methods in activity to set the values to some other property by mentioning the "PropertiesValue" as mentioned in the above format.
Please get back if this is not which required with your queries elaborately.
Thanks.
Murex
LB
Hello Aruldevan,
I have a repeating grid reading from a data page. The grid has a select functionality added to it (a small check box for the user to tick to signify that they wish to select that row).
I have included a screenshot below. What I am trying to do is to loop across the collection of pxResults pages and check if the IfRowSelected is equal to true. If that is the case I wish to then read the value of the Function property present on that pxResults page and then write it to anther property of my choosing.
Thank you for your help!
Virtusa
IN
Hi Joe,
You can very well check as .ifRowSelected=="true" in the pre-condition f the step in the loop, if yes continue to set the property by mentioning the propertyvalue as .Function
Since you are in loop, .Function will be in the current page context. of the page which you checked in the precondition. (.ifRowSelected=="true")
Use property-Set Method As "Property name" as the target property to which you need to copy the value of the Function property and "Property vallue" as .Function
Get me back if any more queries.
Thanks
Murex
LB
Hi ARULDEVAN T.T,
I was trying to implement your suggestion, and used a particular approach. For some reason, when I am doing the object browse, the IfRowSelected field seems to be lost. I have attached a couple of screenshots for your reference and would appreciate your feedback (as well as anybody else's wishing to weigh in of course) regarding things I'm doing wrong/can be doing better.
Hi ARULDEVAN T.T,
I was trying to implement your suggestion, and used a particular approach. For some reason, when I am doing the object browse, the IfRowSelected field seems to be lost. I have attached a couple of screenshots for your reference and would appreciate your feedback (as well as anybody else's wishing to weigh in of course) regarding things I'm doing wrong/can be doing better.
Thank you
Virtusa
IN
Hi Joe,
I couldn't see the Browsed page "tempPage" in the clipboard.
Could you please check it.
If you are removing it in the further steps, Please comment it and could you please send an screen shot of the "tempPage".
Thanks.
Murex
LB
That's exactly what I noticed. But the thing is, I am not removing it, and I can only see tempPage2 in the clipboard (as the screenshot shows). So this has me confused and got me thinking that tempPage is not being created at all (as if the obj-browse method has no effect).
Updated: 27 Jan 2016 6:49 EST
Virtusa
IN
Hi Joe,
Please trace the activity when you are using it to see the result of the OBJ-BROWSE done.
FYI: The ObjClass parameter of the OBJ-Browse is case insensitive. But you have to give the exact Class name (as you created the class).
Make sure to define the class of the page which you use to browse data as Code-pega-list and the pxResults of the page as the class you browse from.
Thanks.
Citicorp Services India Private Limited
IN
Hi Joe,
Since you are using Obj-Browse method to get the list of data objects, you should change the Class name to Code-Pega-List for tempPage in Pages & Classes tab. Whenever you are browsing list of objects , you need to define the page class of type Code-Pega-List.
tempPage2 page should also be of type Code-Pega-List in Pages & Classes tab.
Could you please try this and let me know, whether this works.
Thanks,
Gowrishankar.
Murex
LB
Hi Gowrishankar Ramasamy and ARULDEVAN T.T,
Thank you both for your help and follow up. I have tried to change the type to Code-Pega-List and it worked. Furthermore, I was even able to do the loop without doing an Obj-Browse. I simply looped for all embedded classes, and copied the current page into a tempRowPage which I then used to read the values of the properties I want from and write them to the page I needed. I have attached an image below.
I would like to thank you all for your help and support
Pegasystems
IN
So why do you want to use activities for accessing / setting clipboard content. The recommended way is to leverage data transforms. You can also refer to data pages in UI rules as well.
Murex
LB
Hey Rajiv,
Thank you for your reply.
As I said I'm fairly new to Pega and this is something that I was exploring/trying to do. I would also look towards using data transforms if that is better or easier. I was not aware I could access the clipboard through data transforms. Can I access the Data pages present in the clipboard as well?
Thanks!
Virtusa Global IT Services Company
AU
Hi Joe,
You can access DataPages in clipboard using Data Transforms.
Thanks
Ramki
Murex
LB
Hi Ramki,
Thank you for your reply.
I will definitely look into how this can be done as it seems to be recommended over using an activity.