Skip to main content
Solved

In a linked custom transformer, $(FME_MF_DIR) is resolved to the path of the folder of the installed custom transformers and not to the path of the workspace. Is this as designed?


Forum|alt.badge.img+1

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_MacroValues['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?

Best answer by virtualcitymatt

jmterrettaz wrote:

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

View original
Did this help you find an answer to your question?

7 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+35

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


Forum|alt.badge.img+1

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.


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
jmterrettaz wrote:

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


Forum|alt.badge.img+1
virtualcitymatt wrote:

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.


Forum|alt.badge.img+1

markw
Forum|alt.badge.img
  • April 25, 2022
jmterrettaz wrote:

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.


Forum|alt.badge.img+1
markw wrote:

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


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