Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Block Until Done not working as expected when dataset is empty

bruno_leal
6 - Meteoroid

Hi everyone,

 

We have a script that receives an input and writes a Tableau hyper file and consequently publishes in Tableau using our own Tool (developed in Python).

Everything works perfectly, except when the dataset is empty (which we still need it in Tableau for Tableau to function properly).

 

As you can see below we are using the Block Until Done so we wait for the .hyper file to be written on disk to then publish the file in Tableau.

Note that the below part under the container is just a script to get the file path and load it in our own tool (ignoring the input dataset which will be by then written in file).

bruno_leal_0-1648065093665.png

 

The strange situation when the dataset is empty is that the Tableau Publish fails saying that the file doesn't exist (but it does exist). If we rerun the workflow with the exact same settings (and empty dataset) it will now publish to Tableau without issue, because the file already exists (from the previous run).

 

It seems like somehow, because the dataset is empty the block until done doesn't wait for the file to be written.

 

Anyone has some insights on similar situation?

 

Thanks,

Bruno

 

6 REPLIES 6
bruno_leal
6 - Meteoroid

After some more investigation I found the root cause of the issue.
For some reason, Alteryx leaves the writting of empty files to the end of the script, no matter what. For example in this test workflow, it writes the file ending with _FIRST_10 in the beginning and after a lot of other work the last item in the Results is exactly the one writing the file ending with _FIRST_0.

 

bruno_leal_0-1648068622979.png


Anyone knows how to force Alteryx to write the file 

 

 

danilang
19 - Altair
19 - Altair

Hi @bruno_leal 

 

I tried all kinds of tricks using blocking tools, macros, etc.  It looks like it's a special case, like the email tool that always is the last tool to execute, where an output tool in append mode checks to see if file exists before any other output operations occur.  Finally, the only way that I could get it to work was to create a chained app, where the first app create the hyper and the second one appends to it.

 

Dan

bruno_leal
6 - Meteoroid

Hi @danilang 

 

Thank you very much for your reply and time taken to check this.

 

I don't really like the chained app option as what we are building is an app with an interface for users to select a couple of items (more than 35 variables) and I really don't want to pass +35 variables from first app to second app just to solve this problem.

 

What I actually managed to do was, inside the app, inserted a macro (basically a python tool) to create the empty files. Then I had to put this macro inside a container and manually changed in the app xml file the macro tool ID and location in the list so I can ensure it runs first.

 

It's quite annoying how such an expensive tool like Alteryx doesn't have such basic functionalities as force tools to be executed in a specific order.

 

Anyway, at the moment it's working ok, so I'll not touch it. :)

 

PS: I really don't know what makes this macro to be executed first as I did multiple steps to make this possible. When I was testing it, just chaning the tool ID to an initial one and inserting the macro at the beggining of the app xml file was not enough.

 

Thanks,

Bruno

JJJJC
7 - Meteor

hi @bruno_leal 

 

I am having a similar issue here. Can you specify how you resolved it (maybe a screenshot?)?

 

 

Thanks,

Janey

bruno_leal
6 - Meteoroid

Hi @JJJJC ,

 

Let's see if I can explain here as it depends on your knowledge about XML tool.

 

First let me tell you that what I noticed is that the tools are more or less executed in the order we put them in the workflow, meaning that the first tools created in the workflow run first (not sure if we can trust this assessment, but from experience it's what happens).

 

For that reasion what I tried to do, as I mentioned was I manually changed the ID of the tool I wanted to be exceuted first and also the container where it was inserted (I've just run a quick test and actually the container is not necessary so let's just forget about it).

 

Basically I opened the workflow file in notepad (Notepad++ to be easier) and I manually searched for the current tool ID and changed it to 100 (the lowest number I had was 253):

bruno_leal_0-1650618929755.png

 

Then in the section Wiz_OpenOutputTools I've copied the respective tool to the top with the new tool ID:

bruno_leal_1-1650619002152.png

 

With this the tool starts the execution in the begining of the workflow and because it's a simple python code to just copy empty files from one folder to another it finishes quick.

If the tool takes longer to run I don't think it's guaranteed it will finish before the rest...

 

It's really not ok in a tool like Alteryx not having the ability to, if we need, define the order of execution.

 

This issue is only in the case where we have macros that completely independent and have no inputs and outputs and so we can't define the order of execution using the workflow logic.

 

Hope this helps.

 

Thanks,

Bruno

 

JJJJC
7 - Meteor

hi @bruno_leal 

 

This is very helpful, thank you for the explanations! 

Labels