Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Register for the upcoming Live Community Q&A Session - and don't forget to submit your questions for @DeanS regarding the future role of analytics here.

Lock mechanism

6 - Meteoroid

Trying to implement the lock mechanism in the alteryx  which means 


App should check if app.lock is in the home directory(google drive).
if app.lock file exists app should not run because someone is running it at that moment.
if app.lock file does not exist, app should create is as the first step. After finishing, the app.lock file must be deleted.
What i am able to achieve .
I am able to create the app.lock file into the folder , was also able to delete after the run .
But when two people are running the app , one run for app waits to complete the  app run by other ,instead of completely aborting the file .
I tried implementing the canceling the workflow on condition(option clicked workflow failed when finds error )  , but  in this scenario also app waits to complete the other run  
I want to achieve , when multiple users are using the app only one user can use it and rest finds the lock file completely abort the workflow
All help and input is much appreciated .
17 - Castor
17 - Castor

Hi @Prity 



Are you using the file list API to check if the lock file is there


or are you trying to open/create the lock file as the first step?



6 - Meteoroid

Hi @Dan , 


I am not using any API . I am creating the lock file through VBSCript in the folder where workflow and app is kept .

17 - Castor
17 - Castor



I can't tell without more detailed info, but it sounds like your VBScript is hanging while trying to create the file if it's already there.  Is there any way the the script file can check if the file is already there and exit with a non-zero error code if it is?  The error code should stop the workflow from proceeding any further.



6 - Meteoroid



thank you very much , Please find the detailed information 


when workflow runs , Its create the lock file with the help of VBA Script 


Sub CreateLockFile()

Dim fdObj As Object
Application.ScreenUpdating = False
Set fdObj = CreateObject("Scripting.FileSystemObject")
If fdObj.FileExists("G:\Team Drives\GBL IPM IT BACKUP\Alteryx\04. Wacker\1. App_Transformation of Auswertung Accounting Files\app.lock") Then

Call Err.Raise(vbObjectError + 10, "My Application", "App is running and locked by other user")


fdObj.CreateTextFile ("G:\Team Drives\GBL IPM IT BACKUP\Alteryx\04. Wacker\1. App_Transformation of Auswertung Accounting Files\app.lock")
End If
Application.ScreenUpdating = True
End Sub



This create the file successfully when one user try to run the workflow through app  .Now what i want is when other user try to run the workflow an finds this file in the folder , for second or other user the app should not run the or abort but now what is happening is , the other user wait for the completion of 1st run . Please find the pic , where i call my script of creation .


can you tell me ,How can we achieve this functionality in alteryx ?



Thank you very much for your support .