- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-21 11:18 AM
Can we fetch the status of the current automation process status using SQL query? For example process xyz running in a control room now and process, abc is in pending status.
What we are interested in fetching is the status of the control room but via SQL directly.
------------------------------
Achyutam Mehta
Automation Developer
------------------------------
Answered! Go to Answer.
Helpful Answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-21 01:53 PM
This should approximate the control room view. The where clause can be adjusted to get specifically the sessions you're looking for.
select top (500)
s.sessionnumber [ID],
p.name [Process],
rr.name [Resource],
IsNull(su.username, '[' + su.systemusername + ']') as [User],
st.description [Status],
DateAdd(second, s.starttimezoneoffset, s.startdatetime) [Start Time],
DateAdd(second, s.endtimezoneoffset, s.enddatetime) [End Time],
s.laststage [Latest Stage],
DateAdd(second, s.lastupdatedtimezoneoffset, s.lastupdated) [Last Updated]
from
BPASession s
left join BPAProcess p on s.processid = p.processid
left join BPAResource rr on s.runningresourceid = rr.resourceid
left join BPAUser su on s.starteruserid = su.userid
left join BPAStatus st on s.statusid = st.statusid
where
st.description not in ('Debugging', 'Archived')
order by
DateAdd(second, s.starttimezoneoffset, s.startdatetime) desc
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-21 01:53 PM
This should approximate the control room view. The where clause can be adjusted to get specifically the sessions you're looking for.
select top (500)
s.sessionnumber [ID],
p.name [Process],
rr.name [Resource],
IsNull(su.username, '[' + su.systemusername + ']') as [User],
st.description [Status],
DateAdd(second, s.starttimezoneoffset, s.startdatetime) [Start Time],
DateAdd(second, s.endtimezoneoffset, s.enddatetime) [End Time],
s.laststage [Latest Stage],
DateAdd(second, s.lastupdatedtimezoneoffset, s.lastupdated) [Last Updated]
from
BPASession s
left join BPAProcess p on s.processid = p.processid
left join BPAResource rr on s.runningresourceid = rr.resourceid
left join BPAUser su on s.starteruserid = su.userid
left join BPAStatus st on s.statusid = st.statusid
where
st.description not in ('Debugging', 'Archived')
order by
DateAdd(second, s.starttimezoneoffset, s.startdatetime) desc
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-21 05:03 PM
SELECT
si.processname
,format(si.startdatetime,'yyyy-MM-dd HH:mm:ss') as starttime
,isnull(format(si.enddatetime, 'yyyy-MM-dd HH:mm:ss'),'running') as endtime
,si.runningresourcename
,case when si.statusid = 0 then 'Pending'
when si.statusid = 1 then 'Running'
when si.statusid = 2 then 'Terminated'
when si.statusid = 3 then 'Stopped'
when si.statusid = 4 then 'Completed'
when si.statusid = 5 then 'Debugging'
when si.statusid = 6 then 'Archived'
when si.statusid = 7 then 'Stopping'
when si.statusid = 8 then 'Warning' end as 'Status'
,si.sessionnumber
,si.lastupdated
,si.laststage
FROM [BluePrism].[dbo].[BPVSessionInfo] si
where cast(si.startdatetime as date) >= cast(getdate() as date)
------------------------------
Jan Piwowarski
Developer
Commerzbank AG
Europe/London
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-11-21 05:27 PM
------------------------------
John Carter
Professional Services
Blue Prism
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-11-21 05:49 AM
Also i am hoping you are not running these queries on main production database , as you can end up with shutting up the completed prod due to this .
------------------------------
------------------------------
Vipul Tiwari
Senior Process Simplification Developer
Amazon
------------------------------
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-11-21 04:53 PM
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-11-21 06:58 AM
I am just doing some POC regarding the BP db. I am not running this query frequently running on prod. Could you please suggest how we can achieve the same using cmd?
------------------------------
Achyutam Mehta
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-11-21 07:03 AM
How often we can run query in production in one day? Does it impact prod performance?
------------------------------
Achyutam Mehta
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-11-21 06:12 PM
Context is really the deciding factor in determining what you can run and how often. But as the saying goes, premature optimization is the root of all evil. Personally, if I was running either of the queries that myself or Jan came up with, I wouldn't worry about it.
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
