Question

Set writer output path based on data attribute

  • 9 September 2019
  • 3 replies
  • 25 views

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

Badge +16

Hi @jacklonsdale,

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

Hope this helps,

Itay

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

Badge +2

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

Reply