Skip to main content
Question

VariableRetriever in Custom Transformers

  • October 22, 2014
  • 5 replies
  • 22 views

Forum|alt.badge.img+1
Hi,

 

 

I am using FME2014 and I have two custom transformers that are used in my workspace.  The first customer transformer that is used has inside it a VariableSetter which I set to a Global Variable.

 

 

In the second custom transformer I use VariableRetriever to retrieve the Global Variable.  But it doesn't seem to work.

 

 

Are you able to retrieve variables in CustomTransfomers?  Note: I have set both custom transformers's Attribute References Setting to: Advanced - Fix Manually

5 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 22, 2014
Hi,

 

 

 

I do have Setter/retriever combo's.

 

 And yes you can do what you are doing.

 

 

..feel the but comming up yet?...

 

 

You're proces must be set up in such a way that when the Retriever is called, wherever it si, the called variable must be set already..:

 

 

SettIt is a variablesetter in a custom and ReadPara a vriablereader. Nothing else

 

 

In pic1 ReadPara2 succesfully retrieves the variable, but ReadPara does not.

 

 

 

 

In pic2 however both manage to retrieve it!

 

Reason is, i inserted a couple of processes slowing down the bottom stream.

 

 

 

so, yes u can or at least it is possible.

Forum|alt.badge.img+1
  • Author
  • October 29, 2014
thanks Gio.  I understand that I need to make sure that I slow down the processes to ensure the variable in the other process gets there first.  However, I dont' understand why FeatureHolder doesn't slow things down enough without having to add in extra transformers to try and slow things.  Is there another transformer, so some sort of way of telling FME which process to do first so I don't need to try and slow things down which seems a bit cumbersome?

 

 

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 29, 2014
Hi,

 

 

Because the feature holder in the pick is not in the same stream, or does not use required elements used the SettIt.

 

 

I think if the holder holds elements required in SettIt, it might be enough. (though i didn't test this).

 

 

On the other...wait!.

 

Ok, this works too. Create a "Waiter".

 

 

 

 

 

The waiter Retrieves the variable you set (or are trying to set)

 

And then tests it. Until it ha "arrives" the Waiter loops.

 

I use Missing and Empty and not Null.

 

(but you adaept test to suit your requirements of course)

 

 

 

This works neatly :)

 

 

 

 

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 29, 2014
..a perk to this "waiter" technique is, that you can do compound testing to collect Variables of different streams all over the workspace.

Forum|alt.badge.img+1
  • Author
  • November 6, 2014
yes I've tried the "waiter" and it does what i need!

Reply


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