Skip to main content

Hi All,

 

I am trying to set the values for 2 Published Parameters without the user input such as Attribute Creator so it can be used when I call the FME Workspace using POST Body HTTP Call.

 

I need this attributes to be Published Parameters because is the only way I can make Generalizer transformer dynamic, so I can choose both Algorithm and the Tolerance of it.

 

Any suggestions would be highly appreciated.

 

Thanks,

Ana

You can set the tolerance dynamically by wrapping the generaliser in a custom transformer, you can then use an attribute to set the tolerance parameter in the custom transformer. It doesn't look like it's possible to choose the algorithm in this way however.


Thanks for your prompt reply @ebygomm​, it is a great suggestion.

 

However, I am trying to generalize quite complex geometry. So if I were to call this custom transformer from my main FME Workspace using the HTTPCaller to pass the Algorithm and Tolerance, I would also need to pass the WKT as the geometry. And as the WKT is too long, I need to make the HTTPCaller by using POST and passing the values as 'Upload Body'; otherwise, the URI would be too long.

 

The problem with this approach is that in order to pass the BODY to the custom transformer I would need to add a Reader which would retrieve the Body stored in a temp text file.

 

Hope this is clear enough to understand my limits.

 

If you have any questions or suggestions, let me know.

 

 


Thanks for your prompt reply @ebygomm​, it is a great suggestion.

 

However, I am trying to generalize quite complex geometry. So if I were to call this custom transformer from my main FME Workspace using the HTTPCaller to pass the Algorithm and Tolerance, I would also need to pass the WKT as the geometry. And as the WKT is too long, I need to make the HTTPCaller by using POST and passing the values as 'Upload Body'; otherwise, the URI would be too long.

 

The problem with this approach is that in order to pass the BODY to the custom transformer I would need to add a Reader which would retrieve the Body stored in a temp text file.

 

Hope this is clear enough to understand my limits.

 

If you have any questions or suggestions, let me know.

 

 

The custom transformer would exist in your workbench. You wouldn't need to call it separately using an HTTPCaller


​I see. I'll look how to do that myself as have never explored that option. Many thanks @hkingsbury​ 


​I see. I'll look how to do that myself as have never explored that option. Many thanks @hkingsbury​ 

Have a read through this :)

 

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/custom_transformer_creating.htm


Thanks @hkingsbury​ , unfortunately as @ebygomm​ mentioned in the first reply, Generalizer doesn't allow to set the Algorithm by attribute... so still blocked by this I am afraid as ideally I would like both to be dynamic and passed through the body.


Can you flip the parameter to Private (i.e. uncheck the Published option in its definition). Then I believe you should be able to pass a value, but users cannot set it. Or am I misunderstanding your question?


Not an ideal solution, but a workaround would be to have the algorithm as an attribute, then in the custom transformer use an AttributeFilter or TestFilter to create a fanout and have a Generalizer transformer for each algorithm. They could all share the same published parameter for the tolerance setting.


Reply