Jump to content
  • IronPython script to cancel background tasks in Spotfire®


    Introduction

    Spotfire® is a powerful tool that can be used to create calculated columns, build predictive and machine learning models etc. Users of Spotfire's web clients however currently do not have an option to interrupt these long running tasks. The below IronPython script can be used in a script button to allow web users to cancel the background tasks. Of course, this also works in the Spotfire desktop clients.

    Code Sample

    The script below can be used to cancel background tasks

    from Spotfire.Dxp.Framework.ApplicationModel import ProgressService
    
    # Access the ProgressService through the application's context
    progressService = Application.GetService(ProgressService)
    
    for bgProgresses in progressService.BackgroundProgresses:
    	print bgProgresses.Title
    	print bgProgresses.Description
    	print bgProgresses.IsCanceled
    	bgProgresses.Cancel()
    	print bgProgresses.IsCanceled
     

     

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...