Skip to main content
Question

Set writer output path based on data attribute

  • September 9, 2019
  • 3 replies
  • 172 views

jacklonsdale
Contributor
Forum|alt.badge.img+4

Hi all,

 

I'm currently putting together what will become a generic set of workspaces to use on various different projects within my company.

The workspaces will be contained within a set folder structure of Inputs/Processes/Outputs that can be copied to project folders as and when they are needed.

I want to be able to define the writers to always write the outputs to the 'Output' folder, for when someone copies them for use on another project and the output destination path changes.

I have created an attribute (Writer_Path), derived from fme_dataset of the inputs, to write to this Output folder, but i cant seem to set the writer path to this attribute.

I feel like i might be missing something obvious in a fanout or something, but any help would be greatly appreciated!

 

Thanks!

Jack

3 replies

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 9, 2019

Hi @jacklonsdale,

For these kind of actions I usually use the FME_MF_DIR parameter in the writer destination parameter.

Hope this helps,

Itay


jacklonsdale
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • September 9, 2019
itay wrote:

Hi @jacklonsdale,

For these kind of actions I usually use the FME_MF_DIR parameter in the writer destination parameter.

Hope this helps,

Itay

I take it this would write to the location of wherever the FME workspace is saved, into a new 'Outputs' folder? Ideally I would like to write to a separate Outputs folder up one 'level'

i.e. FME workspace saved in X:/FME Toolset/Workspaces and the outputs saved in X:/FME Toolset/Outputs


chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • September 12, 2019
jacklonsdale wrote:

I take it this would write to the location of wherever the FME workspace is saved, into a new 'Outputs' folder? Ideally I would like to write to a separate Outputs folder up one 'level'

i.e. FME workspace saved in X:/FME Toolset/Workspaces and the outputs saved in X:/FME Toolset/Outputs

Hi @jacklonsdale,

You will still want to use the FME_MF_DIR parameter but you will need to use the cd command ".." after the FME_MF_DIR parameter to go up one level, i.e.

$(FME_MF_DIR)../Output/fme_out.txt

Please see the attached workspace for example.

Hope this helps!

Output_Up_One_Level.fmw


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