Skip to main content
Question

How to use Variable Setter & Variable Receiver?


dataninja
Forum|alt.badge.img

Hi,

Can anyone explain to me how variable setter & receiver work and provide me some examples of how these transformers can be used to solve problems?

Thanks in advance.

5 replies

fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • August 23, 2019

deanhowell
Influencer
Forum|alt.badge.img+23
  • Influencer
  • August 26, 2019

I use it to set and retrieve the coordinate system for our project

 


fpakzat
Contributor
Forum|alt.badge.img+3
  • Contributor
  • November 18, 2019

Hey is it true that the setter and retriever have to be on the same line otherwise it'll give warning says variable being used without being set?


Forum|alt.badge.img+2
fpakzat wrote:

Hey is it true that the setter and retriever have to be on the same line otherwise it'll give warning says variable being used without being set? 

Hi @fpakzat,

No, they do not to be part of the same connection flow, however what's important is that the features do need to parse through the VariableSetter before the VariableRetriever, if a feature hits the Retriever before a value has been set by the VariableSetter the log will then return the warning:

Attempting to retrieve global variable 'aVariable' which was not set -- setting it to the empty string

For example this workspace VariableSetter_Retriever.fmw will return the warning, however if you right click > Set Creator Runtime Order on the Creator and change the order so Creator2 runs first, the warning is no longer present even though they are not connected as the value was set first.


fpakzat
Contributor
Forum|alt.badge.img+3
  • Contributor
  • November 19, 2019
hollyatsafe wrote:

Hi @fpakzat,

No, they do not to be part of the same connection flow, however what's important is that the features do need to parse through the VariableSetter before the VariableRetriever, if a feature hits the Retriever before a value has been set by the VariableSetter the log will then return the warning:

Attempting to retrieve global variable 'aVariable' which was not set -- setting it to the empty string

For example this workspace VariableSetter_Retriever.fmw will return the warning, however if you right click > Set Creator Runtime Order on the Creator and change the order so Creator2 runs first, the warning is no longer present even though they are not connected as the value was set first.

Thanks, I think I kind of understood how they work. I need a bit of practice to govern the technique of controlling sequence. The problems that I'm encountering more often are that I have lots of independent creators (independent in terms of dependent input/output but they are dependent in terms of sequence) and I don't know what is the best way to control. For example, sometimes the connector is leading the query to run even before previous step is accomplished (query is still running, etc.). 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings