Question
Accenture
IN
Last activity: 13 Mar 2019 23:04 EDT
Virtual Data Table after Interaction starts
Hi Team,
I was going through this point
"Once the interaction starts, a virtual data table creates a structure column to represent each context value. Every interaction started receives a new row in the data table. The data table also has an interaction key column. When an automation closes an interaction in the framework, the framework deletes the data row and values of the interaction."
For example my Context Values in Interaction XML are as below
<Value Name="ClientFullName" Type="String" Default="" />
<Value Name="Penalties" Type="Number" Format="C" Default="0"/>
After interaction starts how will the datatable look like. Please help me understand.
i think all the context variables should be available for us after interaction starts so that we can assign values to those that are needed and share them across. how come "Every interaction started receives a new row in the data table." makes sense.
Kindly help.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
You should use a Key of None for the GetTable method. In addition, it will only ever show one item in queue in your example, however it will be very tough to catch because both activities are virtually instantaneous. The GetTable method is just going to return the activity queue and will not contain running activities. To see anything try using my example. I altered it to protect the windows thread as any updates to a DataSource on a DataGridView must be made on the form thread.
Pegasystems Inc.
US
To get to the DataTable, you can call the GetTable method of the InteractionManager component. The preferred way for interacting with the table though (to get and set values) is to simply refer to the interaction values exposed in the InteractionManager component. Once you connect the component up in your automation, it will prompt you via a key fitting to provide the interaction key. Once you supply a key, you may get or set the values for that interaction.
Accenture
IN
Hi Thomas,
Greetings!
As suggested, i tried using GetTable method for Interaction Manager.i am trying to display it on the windows form using datagrid.
i am attaching the solution, please check why the virtual data table row count is coming as 0. i just wanted to see how the Virtual data table created by pega looks like.
Please help.
Pegasystems Inc.
US
The GetTable method of the InteractionManager component shows the activities currently in-queue. Since you have none, it is blank. It does not provide access to the individual data stored in each interaction. Access to that is provided via the component properties (such as ClientFullName, Address1, etc...) that you can drag onto your automation surface.
Accenture
IN
Hi Tom,
Please find the attached solution. I have few activities up.
But not able to retrieve the table even now. Please help me where i went wrong.
Accepted Solution
Pegasystems Inc.
US
You should use a Key of None for the GetTable method. In addition, it will only ever show one item in queue in your example, however it will be very tough to catch because both activities are virtually instantaneous. The GetTable method is just going to return the activity queue and will not contain running activities. To see anything try using my example. I altered it to protect the windows thread as any updates to a DataSource on a DataGridView must be made on the form thread.
Accenture
IN
Hi Tom,
Thank you now i can see the table with 3 columns and an activity that is queued up.
By the way why did you take datatableproxy -> datatable copy -> dcpopy proxy.Please explain.Cant we directly used datatable proxy as a datasource to datagrid.
Should we always make AllProjectsStarted and while activityCompleted the threads as asynchronous?
Thanks.
Pegasystems Inc.
US
All updates to a datasource bound to a DataGridView must be made on the windows form thread (this is a .Net requirement). If we bind the DataTable from GetTable to the DataGridView directly, then as it is updated (by the activity thread), it will cause the DataGridView to freeze (since the table is being updated by the activity thread). I made a copy of the DataTable to separate it from the underlying table. I then called PerformClick on a button that is "visible" (it is behind something else, but it is not hidden). The Click event from this button will be on the form thread. I can then bind the copy of the table to the DataGridView as it won't be updated by anything else.
I always make AllProjectsStarted asynch as this will turn off the SplashScreen. I made the ActivityCompleted asynch before I called TerminateRuntime so that Runtime could shut down. The activity thread would still be running if it were synchronous and was preventing the shutdown. Generally, you would never make the ActivityCompleted event asynch as that would allow the next activity in-queue to proceed.
Accenture
IN
Thank you so much Tom.
-
Balaji Srinivasaraghavan Vitor Alcantara de Almeida