Forum Discussion

HRunyon's avatar
HRunyon
New Contributor III
3 years ago

Update Task via Connector BR

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.

  • 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 

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

    Hope that helps

     

    • HRunyon's avatar
      HRunyon
      New Contributor III

      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"

      • franciscoamores's avatar
        franciscoamores
        Contributor II

        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