You are viewing limited content. For full access, please sign in.

Question

Question

Random token for delay

asked on March 30, 2017

Is there any way to tell a token we want a random value between 1 and 9? I have a rare issue that only pops up when import agent isn't fast enough and imports two different documents that will trigger the same workflow. Generally, this won't happen the way the system is built but in some rare situations, the workflow needs to verify that a folder structure exists before it transfers documents. If the same workflow fires twice at the exact same time, neither workflow will detect a folder structure because it doesn't exist yet and both will end up building a folder structure.  If we were able to use a random delay one of the workflows would build the folder structure and the second delayed one would detect the folders and skip that entire process.  I would really like to delay it by seconds but it seems that I will have to use the delay function which only does minutes. 

0 0

Replies

replied on March 30, 2017

You can do that with a script, but for your intents and purposes, I'd just get the first digit off the instance ID token with Assign Tokens.

The instance IDs are GUIDs, so the first digit in them should be sufficiently "random" for this case.

3 0
replied on March 30, 2017 Show version history

Is the idea that both scripts would wait for that random amount of time?  They will pick the same value 1 time in 10, so that doesn't seem like it will always help.  If you did this from a script activity you could handle the DuplicateObjectException (error code 9002) that the second attempt gets, but that would be a fair amount of work to update everywhere you create folders.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.