Solved

Undefined macro `FME_JOB_ID' dereferenced when using ParameterFetcher in a Workspace triggered by WorkspaceRunner

  • 4 November 2019
  • 4 replies
  • 24 views

Badge +11

I have a chain of WorkspaceRunners that I need to bring to FMEServer, but it should still be possible to run them in Workbench as well. So, I created a TestFilter where '$FME_JOB_ID' NOT has a value. If it does not have a value, a WorkspaceRunner is triggered. It fails with the message:

Undefined macro `FME_JOB_ID' dereferenced in file `ReferencedWorkspace.fmw'
An error occurred during the batch file execution, 1 translation failed. The following error message was raised: 
#2 : Undefined macro `FME_JOB_ID' dereferenced in file `ReferencedWorkspace.fmw'

The parameterFetcher in the 'ReferencedWorkspace.fmw' causes this error. 

 

The Workaround I made was to put a value 'N/A' in the 'FME_JOB_ID' of the ReferencedWorkspace (which also contains a TestFilter but with '$FME_JOB_ID'  NOT has a value or = 'N/A').

 

So two questions:

  1. why do I get the Error message in the first place? The Main procedure does not require the 'N/A' value for the FME_JOB_ID. It seems that the WorkspaceRunner does not resolve the FME Server Parameters.
  2. Is there a better method split the WorkspaceRunner and the FMEServerJobSubmitter?

 

 

icon

Best answer by hollyatsafe 6 November 2019, 21:05

View original

4 replies

Badge +22

You can try using a ParameterFetcher and pass it as an attribute rather than a parameter.

Userlevel 6
Badge +32

I work the same way as you do (local = workspacerunner, server = fmeserverjobsubmitter / httpcaller to api) and tripped over this as well. Dodged it by creating a scripted private parameter, works like a dream.

0684Q00000ArK9LQAV.png

if FME_MacroValues.get('FME_JOB_ID', '') == '':
    return ''
else:
    return FME_MacroValues.get('FME_JOB_ID')
Badge +11

I work the same way as you do (local = workspacerunner, server = fmeserverjobsubmitter / httpcaller to api) and tripped over this as well. Dodged it by creating a scripted private parameter, works like a dream.

0684Q00000ArK9LQAV.png

if FME_MacroValues.get('FME_JOB_ID', '') == '':
    return ''
else:
    return FME_MacroValues.get('FME_JOB_ID')

Thanks for the other workaround, @nielsgerrits. 

Badge +2

Hi @jelle,

This is actually the expected behaviour when you submit a workspace that contains reference to an FME Server Parameter to run on Workbench through the Workspace Runner or Command Line. This is because these values are fetched from the mapping file but since these values are only generated when run on FME Server they are returned as undefined and will halt the translation.

It is essentially the same as having a non-optional published parameter in your workspace but then not setting the value in the Workspace runner - the workspace would immediately fail as it doesn't have access to all the parameter values required to run.

By setting the value N/A this is saved into the workspace file so it can now be referenced correctly. Setting dummy values for FME Server Parameters is usually the recommended approach when running a workspace that uses one in its translation through Workbench. Alternatively nielsgerrits solution of using python to check the presence of the macros value is also a valid workaround.

Reply