Hi all,
I have a process model that calls an expression rule to generate a 6-character random alphanumeric string. I encountered a case where two instances of the process model were triggered at the same time (based on time logs), and both received the same generated value from the expression rule.
I understand that there's always a chance for it to generate the same value. However, I’d like to ask:
Is it possible that both process models used the same instance or execution thread of the expression rule, which might explain why the same value was returned?
Discussion posts and replies are publicly visible
No, Expression rules don't share execution threads. Each process instance gets its own separate execution.Your random generator likely uses system time as a seed. When two processes run at the exact same millisecond, they get the same seed -> same random value.
Thank you for answering. Is there a way to check this?
Try this code once.
mid( substitute( substitute( text(now(), "yyyyMMddHHmmssSSS"), ":", "" ), " ", "" ), 12, 6 )