Skip to main content

In a linked custom transformer, $(FME_MF_DIR) is resolved to the path of the folder of the installed custom transformer and not to the path of the workspace.

My workspace is in

C:\\workspaces

but $(FME_MF_DIR) is resolved to:

\\\\filer25\\users\\uxxxxx\\FME\\Transformers

I have to use a PythonCaller in the custom transformer to get the value resolved to the path of the workspace. In a PythonCaller,  FME_MacroValuess'FME_MF_DIR'] is resolved to the path of the workspace and not to the path of the linked custom transformer.

Is this as designed, or is this a bug?

Hmm, which build are you using - I'm not seeing this behaviour. How are you using the custom transformer?


I'm using FME Workbench 2021.2. I attached a zip file to reproduce the case. To reproduce:

  • install the CustomTransformer_1.fmx with FME Workbench
  • open and run Workspace_1.fmw

The workspace logs the following: 

2022-03-21 13:46:54| 0.4| 0.0|INFORM|CustomTransformer_1_Logger: Info: 
Logger: FME_MF_DIR=\\filer25\users251\u209792\FME\Transformers/
2022-03-21 13:46:54| 0.4| 0.0|INFORM|PythonCaller: FME_MF_DIR=C:\devsbb\tmp\fme/

The second line is logged by a Logger transfomer. The value of FME_MF_DIR is not the path of the workspace. (\\filer25\users251\u209792\FME\Transformers is the path of the installed transformers).

The second line is logged by a PythonCaller transformer. The PythonCaller logs the correct path of the workspace (C:\devsbb\tmp\fme/).

This behavior happens only with linked transformers. If the custom transformer is embedded, FME_MF_DIR ist correct.


I'm using FME Workbench 2021.2. I attached a zip file to reproduce the case. To reproduce:

  • install the CustomTransformer_1.fmx with FME Workbench
  • open and run Workspace_1.fmw

The workspace logs the following: 

2022-03-21 13:46:54| 0.4| 0.0|INFORM|CustomTransformer_1_Logger: Info: 
Logger: FME_MF_DIR=\\filer25\users251\u209792\FME\Transformers/
2022-03-21 13:46:54| 0.4| 0.0|INFORM|PythonCaller: FME_MF_DIR=C:\devsbb\tmp\fme/

The second line is logged by a Logger transfomer. The value of FME_MF_DIR is not the path of the workspace. (\\filer25\users251\u209792\FME\Transformers is the path of the installed transformers).

The second line is logged by a PythonCaller transformer. The PythonCaller logs the correct path of the workspace (C:\devsbb\tmp\fme/).

This behavior happens only with linked transformers. If the custom transformer is embedded, FME_MF_DIR ist correct.

Ahh right - yeah I miss read your original post. I saw python and just tested a PythonCaller - which when I now read it properly I see that this was your work around test. This definitely seems like a bug to me. Totally unexpected behaviour. I would write to support, but in the meantime I will ping @daveatsafe​  who can perhaps pass this to someone who can take a closer look.

 

This is also present in FME 2020 - I suspect it is not exactly a bug, just incorrect. Nice that the python trick works around the issue


Ahh right - yeah I miss read your original post. I saw python and just tested a PythonCaller - which when I now read it properly I see that this was your work around test. This definitely seems like a bug to me. Totally unexpected behaviour. I would write to support, but in the meantime I will ping @daveatsafe​  who can perhaps pass this to someone who can take a closer look.

 

This is also present in FME 2020 - I suspect it is not exactly a bug, just incorrect. Nice that the python trick works around the issue

ok thank you @virtualcitymatt​ for confirming it.


Filed in case C673291

https://community.safe.com/s/case/5004Q00002ZXknoQAD/in-a-linked-custom-transformer-fmemfdir-is-resolved-to-the-path-of-the-folder-of-the-installed-custom-transformers-and-not-to-the-path-of-the-workspace


Hi @jmterrettaz​, @virtualcitymatt​ is correct that this is a bug. We're currently tracking the issue in the ticket FMEDESKTOP-4500. My apologies for this issue! I've shared some more details in my case response and feel free to share any further feedback.

 

There are two known workarounds which are to 1) set the custom transformer as Embedded, or 2) use the PythonCaller's output of FME_MF_DIR as an attribute value in downstream transformers if possible.


Hi @jmterrettaz​, @virtualcitymatt​ is correct that this is a bug. We're currently tracking the issue in the ticket FMEDESKTOP-4500. My apologies for this issue! I've shared some more details in my case response and feel free to share any further feedback.

 

There are two known workarounds which are to 1) set the custom transformer as Embedded, or 2) use the PythonCaller's output of FME_MF_DIR as an attribute value in downstream transformers if possible.

Hi @Mark Warren​ 

thank you for this informations. This issue does not have a big impact for me as I already found the workaround with the PythonCaller. So it has not a very high priority.

BR, Jean-Marc


Reply