How to set variable value during workflow pre-state by EPDM API?

Hi Guys, I try to set the variable value during EPDM pre-state by API while it prompt “this file was checked out by other users”.

Anyone had this experience to set variable value during pre-state? pls advise.

SolidworksApi macros