Skip to main content
Question

Is it possible to set values for Published Parameters without user input?

  • October 28, 2020
  • 8 replies
  • 53 views

anamanvil
Forum|alt.badge.img

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • October 28, 2020

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.


anamanvil
Forum|alt.badge.img
  • Author
  • October 28, 2020

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.

 

 


hkingsbury
Celebrity
Forum|alt.badge.img+67
  • Celebrity
  • October 28, 2020

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


anamanvil
Forum|alt.badge.img
  • Author
  • October 28, 2020

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


hkingsbury
Celebrity
Forum|alt.badge.img+67
  • Celebrity
  • October 28, 2020

​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


anamanvil
Forum|alt.badge.img
  • Author
  • October 28, 2020

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.


mark2atsafe
Safer
Forum|alt.badge.img+59
  • Safer
  • October 30, 2020

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?


jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • October 30, 2020

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.