cancel
Showing results for 
Search instead for 
Did you mean: 

Variables that can retain values after run

ShobhitMalaviya
Level 3

Hi,

I am trying to make a process that will run 3 times(14th , 15th and 16th ) in a month. If the process runs successfully on the first day then there is no need for it to run on the 2nd and the 3rd day. To achieve this, I thought I will place an excel file in a folder and that excel file will just have a flag variable "Successful Run". 

On the 14th of every month the first thing the BOT will do is open this excel file and make  "Successful Run = NO" and if the process is executed successfully just before end the BOT will again open the file and update the flag to "Yes".

Problem: Since the BOT is dependent on the excel file to check whether the run was successful or not this will cause an issue  in case the excel does not respond.

Potential solution: Is there a way that this successful run flag can be created within Blue prism?

Regards,



------------------------------
Shobhit Malaviya
------------------------------
3 REPLIES 3

HarshitRawat
Level 8
I won't say this is an ideal  solution but should serve your purpose

Create a credential with name FlagForprocess

and after every run you can use Set action of Get Credential Business Object to set the username to True or False .
Before every run you can use Get Action and verify what's the value in Username and then can decide if the BOT should continue running
So in this way there would be no external dependency for that flag as that would be internally manipulated 
Regards,

------------------------------
Harshit Rawat
------------------------------

AndreyKudinov
Level 10
You can use Locks, but that would be quite spammy if many processes do that and lock management is not that great - they are all in one place and a mess in general.

You can also use simple file locking like unix tools do - create an empty text file on success and check if it exists on start.

I ended up creating a queue MyProcessLocks, on success you create a new queue item with key field something like "SUCCESS-"&[MONTH]", then exception it (or whatever you want). On next run you can just get exception items from queue with keyfilter "SUCCESS-"&[MONTH]" and see if it exists, then it has been sucessfully run before and exit, otherwise continue. Then just clean up that queue sometimes (manually or on last day).

My actual use is a bit more advanced than that. I also use it for semaphore-like locking to figure out how many bots are still working when running multi-bot scenario. Last one to finish work generates and sends report, others just quit if there is no more work for them.

------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------

John__Carter
Staff
Staff
Just use a queue item containing the date and result of the last run. And at the end of the process, rather than Mark Complete, use Unlock or Defer to return the item to a pending state. For safety, put the queue retry value up high, eg 999, so that an item is made available in the event of a termination.

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------