Define Variable behavior changed after 7.0.0.1283

 Hi,

The last version I installed was 7.0.0.1283, and after upgrading to 7.0.0.1724 it broke all my scripts.  It appears the behavior of Define Variable has changed.  I tried installing a few builds earlier then 1724, but it seems to have been changed for a bit.

I rely very heavily on Define Variable and the following behavior no longer works:

RunMe.fbp7

Include - Include1.fbp7

Define MyCustomVar = MyCustomValue

Return RunMe.fbp7

Include - Include2.fbp7

Reference %MyCustomVar%

Error %MyCustomVar% is not defined

I've been using this functionality since v6 and it worked up in 1283, not sure where it broke exactly.  I'm including my sample which demonstrates the above.

-Nelson

DefineVarBug.zip (7.026 KB)

Hi Nelson

This is going to be difficult to resolve.

Define Variable hasn’t changed at all, what has changed is the Include Project action.

Those changes were made to resolve several other issues with the include project action and variables when run under async groups. We have several (that we know of, there are probably lots more) that make extensive use of async groups, and they were ending up with corrupted variable namespaces. The issue you are seeing is that in earlier builds, an included project was passed the host variables namespace, so any variables defined through the define variable action would have been left in there when the include action completed. In newer builds, the included projects are passed a cloned namespace to avoid threading issues (wrong variable values appearing in wrong threads!). The cloned namespaces are discarded (along with the newly defined variables.) when the include action completes. I will look at this tomorrow and see if there is a way to maintain the old behavior without breaking anything else.

Hi Vincent,

I was afraid it was going to be something tricky like that. Every build I have relies on being able to define variables at different points in a custom xml configuration file. It’s definitely a huge issue for me if there is no work around either in my scripts or the FB code base. Keep me posted!

Thanks,
-Nelson

Hi Nelson

This build should behave the same as build 1283 : https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_1756.exe

Hi Vincent,

I confirmed 1756 works as expected. Thanks for the fix!

Are there any namespace collision issues I should be aware of or potential problems I might run into?

-Nelson

Hi Nelson

No that I know of. I was able to get the old behavor back without reverting the fix that caused the change in the first place, turned out to be relatively simple