Skip to main content
Question

How do I set a writer destination using an attribute

  • Aug 11, 2014 10:58 AM UTC
  • 7 replies
  • 189 views

fmelizard
Safer
Forum|alt.badge.img+22

Hi Folks,

 

I'm having a bit of a moment. I know this is possible and have done it before, but can't remember how nor find out how from the docs.

 

 

I have a text writer. I'd like to set its destination using an attribute.

 

So:

 

 

fme_writer_dest = "c\\:thisdir\\filename.txt"

 

 

How do I do this?

I don't want to use fanout due to its limitations for my scenario.

 

 

Anyone know what the attribute name is?

 

Thanks.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

david_r
Celebrity
  • Aug 11, 2014 12:47 PM UTC
Hi,

 

 

a fanout is usually the best solution for this. But be aware that there are two types of fanouts: I suspect a dataset fanout will do the trick for you.

 

 

David

fmelizard
Safer
Forum|alt.badge.img+22
  • Author
  • Safer
  • Aug 11, 2014 12:55 PM UTC
Hi David,

 

Thanks but I'm afraid fanout is suboptimal.

 

 

Dataset: This fanout type is poorly optimised within FME. What happens is that FME places the ENTIRE dataset into RAM before writing anything. I'm doing this to a large dataset so this is undesired. To minimise this I'm using a lot of writers and a testFilter with them - the first writer being the one that gets the most features.

 

 

FeatureType fanout - doesn't seem to be available for the Text file writer.

 

 

Thus my desire to set the writer destination using an attribute. I've just forgotten what the attribute name is, hence my question.

 

Cheers,

 

Jonathan

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • Aug 12, 2014 11:26 AM UTC
maybe use the parameters for this?

 

 

DestDataset_{somefileformat}.

 

Directory Output.

 

 

You can set one or if u have a writer of some sort inserted, rightclick in the navigator and "edit user parameter definition".

 

 

U can use a workspacecaller, to set the parameter(s)values

fmelizard
Safer
Forum|alt.badge.img+22
  • Author
  • Safer
  • Aug 12, 2014 11:47 AM UTC
Hi Gio,

 

Sorry changing the parameter isn't an option. I need to use a name that I can dynamically update based on an attribute within the workspace itself.

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • Aug 12, 2014 12:12 PM UTC
I understand that, thats why i suggested paramters and workspacecaller combo. That is a dynamic set-up.

 

 

Or are workspacecallers out of the question in your set-up?

fmelizard
Safer
Forum|alt.badge.img+22
  • Author
  • Safer
  • Aug 13, 2014 10:36 AM UTC
What's a workspacecaller? Are you referring to the workspaceRunner? I'm already using one of them (this is the runnee), I'd rather not need to go another level down.

 

Thanks,

 

Jonathan

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • Aug 13, 2014 3:17 PM UTC
Well.

 

The level where u create the attributes from wich you'd like to dynamically set up the target directory...should call the writer level, yes.

 

You dont want to fan-out, so is'nt this your option?

 

 

Yeah im still in the habit of calling them Callers...i must adapt..

 

 

There is a way to set parameters dynamicaly using Python or Tcl of course..

 

( if  i'm not mistaken, there is a post here about that somewhere june or july)

 

 

Any wich way, apart from fan-outs, involves setting parameters.

 

 

btw. AttributeFilewriter can write based on a created attribute targetstring to txt/csv. Just use append. And a start-up to check existence of file.