Skip to main content
Question

Modifying Publish parameter inside python caller

  • June 29, 2013
  • 3 replies
  • 70 views

Forum|alt.badge.img
I need to collect fme_feature_type for all features read by workbench1 Reader and concanate them and pass them to workbench2 publish parameter in shutdown script.

 

I think any attribute created within workbench will not be available in shutdown script. So, i choose publish parameter to be my carrier. After reader, inside a python caller i fetch fme_feature_type and append it to publish parameter. When i print it, i can see all names.

 

But when i try to access it inside shutdown script, it only retains initial values.

 

 

Is there any way to solve this problem?

 

 

Subrat.
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.

3 replies

takashi
Celebrity
  • June 29, 2013
Hi Subrat,

 

 

Published parameters are static, cannot be added, modified or removed at run-time anyway. Consider using the VariableSetter / VariableRetriever transformer or global variables in the Python script, see this article: Python Shutdown Best Practise - Global Variables + Published Parameters

 

 

Takashi

Forum|alt.badge.img
  • Author
  • June 30, 2013
Hi Takashi,

 

       I tried the solution you suggested i.e. declaring a global variable in start up script and it was working fine for a string length of 232. But when i tried with 950 character string, it is not calling second workbench.

 

 

Is there any limitation on size of parameter value while fme work bench calling from shutdown script?

 

 

Following is my syntax (featureNames is global variable):

 

os.system("fme.exe D:\\\\Subrat\\\\WORKBENCH2.fmw --FEATURE_TYPES_TO_READ %s " % featureNames)

 

 

Subrat. 

david_r
Celebrity
  • July 1, 2013
Hi,

 

 

rather than using os.system to execute a workbench, consider using the relevant parts of the fmeobjects API. See my example posted here.

 

 

David