Question
Pegasystems Inc.
JP
Last activity: 16 Oct 2018 12:03 EDT
Creating arrays in Pega Robotics Studio
In Pega Robotics Studio (8.0 or 7.1) is it possible to, either through loops or arrays, process the contents of a variable sized element? The specific example I'm thinking of is taking the contents of an HTML table (number of rows variable) and inserting it into a windows application (creating, say, one item per row)?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
JP
This seems to have worked for single dimension arrays.
LookupTable also works, but with a behaviour most like a list than an array.
Pegasystems Inc.
US
Hello!
While this usually depends on how the webpage was developed, there are 2 approaches that you should be able to take to identify and iterate over the dynamic rows.
These approaches are:
- Using the HTML Table Designer. http://help.openspan.com/80/HTML_Table_Designer/HTML_Table_Designer.htm
- Using clones. http://help.openspan.com/80/Adapters_Interrogation/Win32_Applications_MDIChild_Windows.htm
Following one of the above section should provide you with an object that you would be able to iterate over using either the listLoop or forLoop component.
http://help.openspan.com/80/Components/ForLoop.htm
http://help.openspan.com/80/Components/How_to_use_the_ForLoop.htm
http://help.openspan.com/80/Components/ListLoop.htm
http://help.openspan.com/80/Components/How_to_Use_the_List_Loop.htm
Thanks,
Calvin
Pegasystems Inc.
JP
Hi Calvin,
thanks for the prompt reply! I managed to get the for loop in conjuction with table designer working to directly send data from the input system table to the output system.
However, in cases where the data must be temporarily buffered (either for timing reasons or slightly more complex processing is required), is there such a thing as an array construct within Openspan to which we can save data? The list loop in your reply gave me the idea that a list box can be used to save data for one dimensional arrays, but how about two dimensional arrays? E.g. if we need to buffer something like [[1, apples, 25],[2,bananas,15],[3,cherries,50]], what is the recommended way in Openspan - short of writing it to an Excel sheet and reading it from there later?
Pegasystems Inc.
US
The LookupTable component allows you to create any set of data you need. It is based on the .NET DataTable.
Accepted Solution
Pegasystems Inc.
JP
This seems to have worked for single dimension arrays.
LookupTable also works, but with a behaviour most like a list than an array.
CJSC i-teco
RU
Please say, how add system.array and array proxy in automation?
Pegasystems Inc.
JP
To add System.Array.CreateInstance, go to 'Tools > Choose Toolbox Items > Pega Robotics Static Members > From Directory Location' and select the following assembly file:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll
From there you should be able to add Array.CreateInstance.
To add a proxy, right click the 'Result' port (or most output ports) and select "Extract Proxy".
prodapt solutions
India
How to add arrayelements ?
Pegasystems Inc.
US
Pegasystems Inc.
JP
In the same toolbox location, I also see Array.Resize. I've never used it before but taking a wild guess it might be what you need?
-
Kebisha Bright Sai Anusha Swarna
Pegasystems Inc.
JP
Hi all,
I finally got the full picture of what the customer is doing, and understand why they need an array.
They have a very complex business process which transits over a hundred pages on eight different sites to collect information, and at the end of the process they put the information in a summary page which is a windows form which they create. The data they have is structured in 3 x 6 x (8 + 3 x 8) variables, so it lends itself well to a data structure defined like "datatype data[3][6]" where datatype would be a struct something like "struct datatype {string a[8]; int b[3][8]}". Right now, because the customer can't create structs or arrays, they created 576 variables named like variable Proprietary information hidden to buffer the data while it's being collected over the large animation.
LookupTable really isn't sufficient for this - is there a better way?
I suggested to them to create the target page at the outset, and set the properties of the relevant fields as they traverse the animation; however, the page they created is a windows form so not all fields are shown at the same time; as the user clicks buttons the page refreshes from the buffer variables showing the relevant values. In HTML I would just create the whole lot and collapse the sections the user is not currently looking at, but on windows forms even that isn't possible.
Pegasystems Inc.
US
Pega Robotics supports the creation of custom components. It sounds like this developer would be able to handle that, especially if they are comfortable with multi-dimensional arrays. As long as the class implements IComponent (or derives from Component), then it should be able to be used within Studio. The dll will need to be placed in the installation folder and then added to the Toolbox.
For something as complex as this, that would be my suggestion.