Paul Victor 2 Posted December 14, 2017 Share Posted December 14, 2017 Is there a script that can run Data Functions in a specific order I have 8 different Data Functions that all keep trying to run at the same time, so I was wondering if there was a Python script or something that tells Spotfire to run Data Functions one at a time. I've looked here,https://d2wh20haedxe3f.cloudfront.net/sites/default/files/wiki_files/top..., and they show the script for df in Document.Data.DataFunctions: if df.Name == "K-means clustering": df.ExecuteSynchronously() but I'm not too sure how to implement it. Link to comment Share on other sites More sharing options...
Khushboo Rabadia Posted December 17, 2017 Share Posted December 17, 2017 By default, data functions run asynchronously. Other actions may be performed while the data function executes. A data function can however be executed synchronously within an IronPython script by using the method DataFunction.ExecuteSynchronously(). Execution of the remainder of the IronPython script is then blocked until the data function completes. You can use nested for loop for defining order in which you want to run your data function in Python script. Suppose you have three data functions,you can run them in order as sample below where order is defined by value of i: i=0 while i Link to comment Share on other sites More sharing options...
Paul Victor 2 Posted December 18, 2017 Author Share Posted December 18, 2017 This looks very promising! Since I'm new to ironPython could you specify what in the code needs to be defined And is there a way to make this run Everytime a filter is changed Link to comment Share on other sites More sharing options...
Jason Alley Posted June 11, 2019 Share Posted June 11, 2019 getting AttributeError: 'DataManager' object has no attribute 'datafunctions'. and then if i change it to while i <Document.Data.DataFunctions.count: i get AttributeError: 'DataFunctionCollection' object has no attribute 'count' But needing to run some data functions in a specific order so any help is appreciated. Link to comment Share on other sites More sharing options...
Khushboo Rabadia Posted June 12, 2019 Share Posted June 12, 2019 IronPython is case sensitive language. I have updated the code with correct case. You can follow below api reference to get correct exact names of methods, properties etc. https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/TIB_sfire-analyst_api/Index.aspxtopic=html/T_Spotfire_Dxp_Application_AnalysisApplication.htm Link to comment Share on other sites More sharing options...
Jason Alley Posted June 12, 2019 Share Posted June 12, 2019 thanks I figured it out as well. Any idea how to show a progress bar as these functions are running Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now