community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Lock mechanism

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 .
 
 
Regards
 
Aurora

Hi @Prity 

 

 

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

GET https://www.googleapis.com/drive/v2/files

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

 

Dan

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 .

Aurora

@Prity 

 

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.

 

Dan

Meteoroid

@danilang

 

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")

Else

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 ?

clipboard_image_0.png

 

Thank you very much for your support .

Labels