Skip to main content
Newcomer
September 7, 2022

Update Task via Connector BR

  • September 7, 2022
  • 1 reply
  • 0 views

I have a single Connector BR that makes several independent API calls to external systems. When it's called the Task Progress window sits at 11% with the message "Parsing Source Data". I would like to update the task as it goes along so the user knows something is happening.  I found reference to the below snippet but don't know how to properly instantiate the extenderArgs variable. I tried using it with Nothing but it did not seem to work as intended. Is there a sample of how I can do this in a Connector BR?

 

Dim bValue As Boolean = BRApi.TaskActivity.UpdateRunningTaskActivityAndCheckIfCanceled(si, extenderArgs, activityDescription, percentCompleteToAdd) 

 

Thanks.

1 reply

OneStream Employee
September 8, 2022

Many of the MarketPlace solutions have examples of how this is used.  For example, the PLP Solution Helper under Dashboard Extender Business Rules shows how "extenderArgs" is passed.  First part is creating a Public Function where extArgs is defined as ExtenderArgs 

TonyToniTone_0-1662638125407.png

Then, this can be passed as an argument to the BRApi.TaskActivity.UpdateRunningTaskActivityAndCheckIfCanceled Function

TonyToniTone_1-1662638419219.png

Hope that helps

 

HRunyonAuthor
Newcomer
September 8, 2022

Thank you. My issue is that I cannot simply add a parameter to the Connector entry point. I need to declare the object and set the TaskActivityID correctly. I just cannot find out what the ID is, as it does not appear to be passed at all into the Connector.

Dim extArgs As New ExtenderArgs
extArgs.TaskActivityID = "XXXXX"

Newcomer
September 8, 2022

Hi,, try this

Using dbConnApp As DbConnInfoApp = BRApi.Database.CreateApplicationDbConnInfo(si)
' Get task id
  Dim taskId As Guid = EngineWorkflowRunningTask.GetRunningTaskActivityID(dbConnApp, si.WorkflowClusterPk)
    ' Other actions...
 End Using