For what it's worth, I've implemented a successful test case for this that works on both FME Desktop and FME Server, with some minor limitations.
The attached zip file contains a very simple workspace and some custom transformers for testing the solution.
dynamic-transformer-caller.zip
General Solution
I created a Python scripted parameter which copies the required transformer over from a custom resources folder to the FME transformers folder at run time. I initially tried this with a startup Python script but had to switch to a scripted parameter. There are obviously some subtle differences in runtime between the startup scripts and the scripted parameters. The startup script runs too late in the workspace initialisation for the copied custom transformer to get used.
Limitations
The solution works well but has some limitations that I'm aware of:
- each custom transformer instance must have the exact same name defined for the "Name" value in the Transformer Properties, although the actual file names can (and should) be different.
- each custom transformer must also expose the same input parameters. If different parameters are required, then they can be passed in as feature attributes and exposed using the AttributeExposer inside the custom transformer.
Strengths
One of my main concerns was how FME Server would behave in the event of a conflict. Due to the way the solution is implemented, the custom transformer has to be copied over to a shared resources directory at run time. This directory is shared by all users of FME Server and there is no way to prevent other users from running the same workspace at the same time, using a different custom transformer. My brief testing indicates that the file copy is very fast and occurs at the time the workspace is first loaded. Immediately after the file copy has occurred the transformer is loaded into memory for the workspace to reference. Copying a different transformer into the shared directory after the copy has occurred does not change the internal reference of the transformer being used by the workspace and each workspace uses the correct version of transformer.