Skip to main content
I want to include the workspace name as part of some metadata I generate

 

 

 

Running the workbench as a workspace the $(FME_MF_NAME) variable returns my workspace name Once I convert it to a custom transformer (CT)  this variable returns the fmx name rather than the calling fmw name

 

 

I set a published parameter to the value of the $(FME_MF_NAME)  in the CT

 

Running as a Linked CT I get the following error

 

 

 

Starting translation...

 

 

Undefined macro `ArcGIS_MetaItemDescription_FME_MF_NAME' dereferenced in file `C:\\Users\\scooter\\Documents\\FME\\Transformers\\ArcGIS_MetaItemDescription.fmx'

 

Program Terminating

 

 

Translation FAILED.

 

 

 

Running as an embedded CT I get the correct result

 

 

 

When I embed and run it using a private parameter I get the same error

 

 

Starting translation...

 

 

Undefined macro `ArcGIS_MetaItemDescription_FME_MF_NAME' dereferenced in file `C:\\Users\\scooter\\Documents\\My FME Workspaces\\wb-xlate-1399417605939_8048'

 

Program Terminating

 

 

Translation FAILED.

 

 

 

I really would prefer  to use this as a linked CT using a private parameter

 

 

Pretty inexperienced in terms fsuing CT and passing parameters so hoping someone can help

 

 

Thanks

 

Brian
Hi,

 

 

not sure this is doable since the .fmx basically is like its own workspace (if my understanding is correct).

 

 

However, I suggest you use the following snippet in a PythonCaller inside your custom transformer to dump all available macro values to see if any of them fits your needs:

 

 

-----

 

import fmeobjects

 

import pprint

 

 

def showAllMacroValues(feature):

 

    pp = pprint.PrettyPrinter(indent=4)

 

    pp.pprint(FME_MacroValues)

 

-----

 

 

David
Hi David,That exposed a master name that i could use to get the job done.  THanks for your help

 

 

feature.setAttribute("_metaWorkbench", FME_MacroValuesu'FME_MF_NAME_MASTER'])

 

 

cheers

 

Brian

 

 

 

 


Reply