Question
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/c5d4771e-d600-496c-ac12-b258bdaccc68.jpeg?h=c4a72dc3&itok=YfGGERBa)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/c5d4771e-d600-496c-ac12-b258bdaccc68.jpeg?h=c4a72dc3&itok=YfGGERBa)
Virtusa
LK
Last activity: 5 Apr 2020 15:54 EDT
DB Query to get Activities calling Java
Hi All,
I need to retrieve activities calling java in the database.
How can i archive this.
Urgent issue
Thank you.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690017000/9c950853-cf72-49db-8eb3-908df750b88e.jpg?itok=-Cm7jftb)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690017000/9c950853-cf72-49db-8eb3-908df750b88e.jpg?itok=-Cm7jftb)
BPM Company
NL
hmm, mate, could you please tell us more, because "retrieve activities calling java in the database" means almost nothing :\
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Pegasystems Inc.
FR
Yes I was going to say, you need a JavaScript code to run an SQL query to get an activity list.
That sounds over complex why do you need this for?
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/c5d4771e-d600-496c-ac12-b258bdaccc68.jpeg?h=c4a72dc3&itok=YfGGERBa)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/c5d4771e-d600-496c-ac12-b258bdaccc68.jpeg?h=c4a72dc3&itok=YfGGERBa)
Virtusa
LK
Actually I do not have the access to the application but the admin has the access to the database.
I want a query to run to get the activities which has calling Java .
Thank You
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Pegasystems Inc.
FR
Ok, why don't you just run a Report Definition like Rule-Obj-Activity.pxGetMayStartActivitiesForClass
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690017000/9c950853-cf72-49db-8eb3-908df750b88e.jpg?itok=-Cm7jftb)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690017000/9c950853-cf72-49db-8eb3-908df750b88e.jpg?itok=-Cm7jftb)
BPM Company
NL
as far as I understood, he has an access only to the DB
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690017000/9c950853-cf72-49db-8eb3-908df750b88e.jpg?itok=-Cm7jftb)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690017000/9c950853-cf72-49db-8eb3-908df750b88e.jpg?itok=-Cm7jftb)
BPM Company
NL
So you want to make a DB query to get a list of all activities who have a Java-step in at least one of the steps?
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/c5d4771e-d600-496c-ac12-b258bdaccc68.jpeg?h=c4a72dc3&itok=YfGGERBa)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/c5d4771e-d600-496c-ac12-b258bdaccc68.jpeg?h=c4a72dc3&itok=YfGGERBa)
Virtusa
LK
yes correct. :)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/c5d4771e-d600-496c-ac12-b258bdaccc68.jpeg?h=c4a72dc3&itok=YfGGERBa)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/c5d4771e-d600-496c-ac12-b258bdaccc68.jpeg?h=c4a72dc3&itok=YfGGERBa)
Virtusa
LK
IS this possible
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690017000/9c950853-cf72-49db-8eb3-908df750b88e.jpg?itok=-Cm7jftb)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690017000/9c950853-cf72-49db-8eb3-908df750b88e.jpg?itok=-Cm7jftb)
BPM Company
NL
Here're the starting points for you:
1. Every activity is an instance of Rule-Obj-Activity class
2. These instances are stored in the pr4_rule data table.
3. If an activity contains java step, it will be reflected in the messages on that instance.
4. You could use the DB function pr_read_from_stream, to read a property (which contains the warning messages) of an activity from pzpvstream blob column.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/c5d4771e-d600-496c-ac12-b258bdaccc68.jpeg?h=c4a72dc3&itok=YfGGERBa)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/c5d4771e-d600-496c-ac12-b258bdaccc68.jpeg?h=c4a72dc3&itok=YfGGERBa)
Virtusa
LK
Hi Thnx for the reply vaspoz,
I need to get the all the records in the database which has the warning message.
Is this possible with this function.As i saw this function asks for pzInsKey as a param.
Thank You.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690017000/9c950853-cf72-49db-8eb3-908df750b88e.jpg?itok=-Cm7jftb)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690017000/9c950853-cf72-49db-8eb3-908df750b88e.jpg?itok=-Cm7jftb)
BPM Company
NL
pzInsKey is a column in this table. You could get it there.
Just iterate through all the records, check only the ones with class Rule-Obj-Activity.
Indication for an activity with Java would be a page list property pxWarnings().pxWarningName = "Java step"
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689987000/ba22b261-9fa5-4a5b-9c81-2ace503fd8e0.jpg?itok=VsiQPSsD)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689987000/ba22b261-9fa5-4a5b-9c81-2ace503fd8e0.jpg?itok=VsiQPSsD)
SSA
US
you can use the below query
select *
FROM [pega].[PegaRULES].[pr_index_warnings] where pxInsIndexedClass='Rule-Obj-Activity' and pxWarningName = 'Java step'