cancel
Showing results for 
Search instead for 
Did you mean: 

License Details using API or DB Query

ShivakumarKadro
Level 3
Hi All,

Is there a way to fetch available Blueprism session license details? e.g. Via Webservice, DB query call

Thanks,
Shiva

------------------------------
Shivakumar Kadrolli
------------------------------
17 REPLIES 17

Hi @ShivakumarKadro,

You can run the below query to fetch the license details:

select * from [dbo].[BPALicense]​

------------------------------
Ritansh Jatwani Senior Consultant
Consultant
EY
Gurgaon
*If you find this post helpful mark it as best answer
------------------------------

bruce.liu
Staff
Staff
Hi Shivakumar,

If you were referring to the total license count available in a Blue Prism environment, I am afraid there does not exist an official way to retrieve it. All license information in DB is encrypted, it will not be easy to take advantage of. But nothing would prevent you from writing an automation to Blue Prism Interactive Client itself to get exactly that.

If you need to know the current license usage, a simple
SELECT COUNT(*) FROM BPASession WHERE statusid in (0,1)
would be suffice.

------------------------------
Bruce Liu
Senior Product Consultant, Professional Services
Blue Prism
Australia/Sydney
------------------------------

Thanks Bruce! This should help me and I see set of views which provides data in structured way.
Are there any APIs? if no any plans to be considered in future releases?

------------------------------
Shivakumar Kadrolli
------------------------------

@ShivakumarKadro

I set up for you to be able to view the information of your licenses through the bank I hope it helps!!
If it helps, mark as best answer

select
   issue_to as 'Name of Company',
   FORMAT(License_expires_on,'dd/MM/yyyy') 'Date of validate',
   datediff(day, getdate(), License_expires_on) 'Days Remaining'
from
   (
      select
         cast (lic.licensexml as xml).value('(/license//licensee/node())[1]', 'nvarchar(10)') as [issue_to],
         cast(cast(lic.licensexml as xml).value('(/license//expires/node())[1]', 'nvarchar(10)') as date) as [License_expires_on],
         cast(lic.licensexml as xml).value('(/license//maxconcurrentsessions/node())[1]', 'nvarchar(10)') as [available_licences] 
      from
         (
            select
               convert (varchar(2000), cast(' ' as xml).value('xs:base64Binary(sql:column("base64_column"))', 'VARBINARY(2000)')) AS LICENSEXML 
            FROM
               (
                  select
                     licensekey as base64_column 
                  from
                     bpalicense
               )
               a
         )
         lic
   )
   as pog 
where
   pog.License_expires_on >= getdate() 
order by
   pog.License_expires_on

32401.png



------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
Recife
+5581988869544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

ewilson
Staff
Staff
Hi @ShivakumarKadro,

NOTE: THIS IS AN UNSUPPORTED SOLUTION

As @Bruce Liu mentioned, there's no officially supported way to pull the count of available licenses, but you can do it by using Blue Prism to automate the Interactive Client. With that said, if you want to see the contents of the license file there is a DLL in the BP installation folder called BPCoreLib.dll. If you reference that DLL from within a VBO you can use a code stage and create an instance of the KeyInfo object. With that, you can pass in the value of the licensekey column from the dbo.BPLicense table. The license info will be decoded and presented to you via the object.

The below example is from a small C# console application I used to test this.

Ex.
KeyInfo ki = new KeyInfo("YOUR_KEY_INFO_HERE");
Console.WriteLine("Num Concurrent Session: " + ki.NumConcurrentSessions);
Console.WriteLine("Num Published Processes: " + ki.NumPublishedProcesses);
Console.WriteLine("Num Resource PCs: " + ki.NumResourcePCs);
Console.WriteLine("Expiry Date: " + ki.ExpiryDate);
Console.WriteLine("Press any key to continue.");
Console.ReadLine();
​

Cheers,
​​

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Thanks!

------------------------------
Shivakumar Kadrolli
------------------------------

Does Blueprism (BP) support nolock SELECT query to BP DB? I am asking this if we need to pull the data from BP to any other reporting tool like Tablaeu or Kibana or ELK?

------------------------------
Shivakumar Kadrolli
------------------------------

Hi Shivakumar,

It depends on how you use your query and the scenario you want to achieve. Blue Prism or not, it does not really matter. From SQL Server point of view it does support NOLOCK hints, and all Blue Prism databases must be hosted in SQL Server.

------------------------------
Bruce Liu
Senior Product Consultant, Professional Services
Blue Prism
Australia/Sydney
------------------------------

I am asking from Blue prism product best practices perspective and BP recommendation .
Can we have select queries to BP DB to fetch the data for Kibana/Tablaeu. I mentioned about nolock to highlight retrieving the data without locking the table row.

------------------------------
Shiva
------------------------------