Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to use temporary files while using chained apps in Gallery?

anil_m
8 - Asteroid

Hi,

 

I am using the chained app with three workflows.  Workflow_1 writes the data into %temp%..\Drivecam_All_States_1.yxdb.     and in Gallery settings, my temp directory is set to  "E:\ProgramData\Alteryx\Engine\", But my interface data in Wsorkflow_2  is not refreshing.

 

chain1.PNG

 

 

I have also tried like this. While writing "%Engine.TemFilePath%Drivecam_All_States_1.yxdb"   and while reading I have used the same "%Engine.TemFilePath%Drivecam_All_States_1.yxdb".

This is also not refreshing the data between two chained apps.

 

Can anyone please guide me on this?

 

 

 

 

 

 

8 REPLIES 8
StephenR
Alteryx
Alteryx

It may be a quick spelling fix (missing the p in TempFilePath).  You should use the Engine.TempFilePath constant as %Engine.TempFilePath%, but then you need to specify that it's in that directory, so: %Engine.TempFilePath%\ to create %Engine.TempFilePath%\Drivecam_All_States_1.yxdb.

 

The reason that you can't just use E:\ProgramData\Alteryx\Engine\ is that Alteryx instantiates the workflow when it is run, so the Engine sub-folder (the folders with the random string of characters in the Engine folder) will not be the same each time.

 

Temp File help if you haven't seen it yet.

Regards,
Stephen Ruhl
Principal Customer Support Engineer

anil_m
8 - Asteroid

@StephenR   Sorry, it's my mistake while typing the question.  Actually, i have used the %Engine.TempFilePath%Drivecam_All_States_1.yxdb.   But it's not working.    If I use %Engine.TempFilePath%\  , then it's creating an additional symbol "\" in the path.  

 

Even if I am using %Engine.TempFilePath%  or  %Engine.TempFilePath% \,  I am not able to access the files in the in next workflow, since it is generating the new engine sub-folder with random characters as you mentioned.  

anil_m
8 - Asteroid

I am able to view all my temporary files in random directory "..../AppData\Local\Temp\Engine_2516_08bfbbeaba174a92a9736114b355c90b_  " (This will be unique for each workflow and newly generated for every run),  But not able to access these files in my next chain workflow.

StephenR
Alteryx
Alteryx

Thinking about it again, the issue may be that the different apps are using different Engine files. 

 

The first app instantiates the Alteryx engine, runs, writes to the temp directory, then completes after calling the second app.  When it completes, it clears it's temp directory.  The second app starts, then calls its own temp directory which is different. 

 

This makes me think you can't use the Engine.TempFilePath constant. 

It seems that you may not even be able to use the %temp% string based on this comment from the help documentation (emphasis mine):

 

Writing to the Temporary Directory

To write files to a temporary location, use the following shortcut to create a file path: %temp%filename.ext.

Specifying %temp% will work on any machine and write the file to the user's specified temporary directory in the sub-folder tied to the process ID.

 

It seems that the answer would be to write a permanent file, and just overwrite it each time you run the workflow.  If you push the workflow to Alteryx Server and include all assets, Alteryx will maintain that file in a relative location to the workflow/app and instantiate it each time so that you don't have to worry about file locks.

Regards,
Stephen Ruhl
Principal Customer Support Engineer

anil_m
8 - Asteroid

Yes, I think I should not use Engine.TempFilePath constant.    The following configuration is working on my local machine,  

 

From Workflow1, this is how I am saving the files. 

 

input test.png

 

From the Workflow2, I am accessing the step1 files with the below configuration.

 

input test2.png

 

By using %temp% with the above configuration, the app is working fine on my local machine,  But still struggling to run in the gallery :-(   

 

StephenR
Alteryx
Alteryx

I have had a lot of issues using temp files in the Gallery as well.  It doesn't seem to operate in quite the same manner as desktop.  My suggestion would be to avoid them, place your files in the same directory as the app and use relative references.  When the app is run in the Gallery it copies the entire folder into the engine, so the file won't lock if multiple people are running it.

Regards,
Stephen Ruhl
Principal Customer Support Engineer

anil_m
8 - Asteroid

@StephenR   Thanks for the replies,  ok I will try using relative references.    For reference, I have attached sample flow that is working on my local machine.

wonka1234
10 - Fireball

any answers to this? having the same issue with temp and running on gallery with chained apps.

Labels