cancel
Showing results for 
Search instead for 
Did you mean: 

Global variable

radoslawrajnert
Level 3
​​Hi Folks,

I try to create a global variable that I will use as Request ID increasing the value + 1 when new request arrives.
This last ID number should be read from database and stored.

Environmental variable cannot be updated from the process / object Studio.

How can I manage it in the easiest way?

Thanks and regards,
Radoslaw


------------------------------
Radoslaw Rajnert
Financial Systems Expert
Telefonica OHG
Europe/London
------------------------------
9 REPLIES 9

JeroenOosterhol
Level 4
You can use credentials instead of environment variables for that purpose. Get Credential -> ToNumber, +1 and cast back to text -> Set Credential

------------------------------
Jeroen Oosterholt
Automation Designer
DHL
Maastricht
------------------------------

JerinJose
Level 10
​Hi Radoslaw,

if you are looking at multiple bots processing the incoming requests its difficult to achieve.

1 possible scenario I could think of is to keep a master process to add items to the queue and increment the last DB value by the number of items added to queue and later trigger the main process to rest of the bots (either using AutomateC from the master process or a subsequent schedule) which actually work on this requests.

let me know if this works for you.

------------------------------
Jerin Jose
RPA Product SME
EY
Asia/Kolkata
------------------------------

this logic may fail in multi bot scenario. ​

------------------------------
Jerin Jose
RPA Product SME
EY
Asia/Kolkata
------------------------------

Anonymous
Not applicable
to create a unique integer by having a dynamic random number generated e.g a 20 digit number etc

------------------------------
Cohen
RPA Developer

Romania
------------------------------

dmma
Level 5
Hi Radoslaw, 
I just wonder how you are getting the value of the request in the process from the beginning?

The easy way would be: create global variable which will hold some number (maybe initial value  would be 0, depends on your situation), and inside of your process check if you have current global variable value +1 is existing in the database, if yes continue working with this request id.

It's little bit unclear why do you need it for. So it's hard to propose some solution for you.

------------------------------
Kind regards,

Dmitrij Mamajev
RPA Developer
Volvo Cars
Gothenburg - Sweden
------------------------------
Kind regards, [FirstName] [LastName] [Designation] [JobTitle] [CompanyName] [City] [State] [Phone]

Deep.Shah
Level 6
Hi,

Not sure if this is the best approach for what we are trying to achieve here but, maybe setting the Exposure of Vairable to Statistic could help?
It stores the value in Blue Prism DB, and can be used in process, to update its value.

Also, next time we run the process, it will fetch the last stored value in DB.

------------------------------
Deep Shah
Robotics Developer
FirstRand
Asia/Kolkata
------------------------------

david.l.morris
Level 15
The easiest way I've found to do this is to use Environment Locks to store a value in the Last Comment field. You have to have a very solid piece of logic/code in place to properly manipulate it, but I currently have an object in production that dynamically determines a connection number to use for a web service based on whether other sessions are currently using a connection. You'll have to deal with racing conditions so you may want to implement a wait of some kind.

The second easiest way is to use a work queue item, which would be similar to Environment Locks except is less susceptible to data loss.

The next way would be to use a separate database (which could actually just be a file stored in a shared location) that the automations can query to determine what the next ID should be.

The best and most legit way would be a web service set up to return a value that should be used. But that sounds way over-engineered for such a simple task.

------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------

Dave Morris, 3Ci at Southern Company

VivekGoel
Level 10
use queues to store each value after increment .It will also help you to retrieve the value when required .

------------------------------
Vivek Goel
RPA Architect
Asia/Singapore
+6594554364
https://www.rpatools.com/
"If you like this post, please press the "Recommend" Button.
------------------------------

radoslawrajnert
Level 3
​Hi guys,

Many thanks for your advice! I will try to implement some of your ideas!

Regards,
Radoslaw

------------------------------
Radoslaw Rajnert
Financial Systems Expert
Telefonica OHG
Europe/London
------------------------------