ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Desktop.Workflow.Client.Models Namespace / INotificationManager Interface / SubscribeToJobs Method
The ids of the jobs to subscribe to
Example

In This Topic
    SubscribeToJobs Method
    In This Topic
    Subscribe to messages for the given jobs
    Syntax
    void SubscribeToJobs( 
       List<string> jobIds
    )
    Sub SubscribeToJobs( _
       ByVal jobIds As List(Of String) _
    ) 

    Parameters

    jobIds
    The ids of the jobs to subscribe to
    Example
    QueuedTask.Run(() => { var jobIds = new List() { "123456789", "234567890" }; // Get a new instance of NotificationManager. Use this same instance to unsubscribe from jobs. var notifMgr = WorkflowClientModule.NotificationManager; notifMgr.SubscribeToJobs(jobIds); });
    Subscribe to job notification messages
    // Subscribe to the job message event to start receiving job and step notifications.
    // Use the subscription token to unsubscribe from the event.
    var subscriptionToken = JobMessageEvent.Subscribe(e =>
    {
      var jobId = e.Message.JobId;
      var msgType = e.MessageType;
      var message = e.Message;
      // Include logic to process the job / step messages
    });
    
    // Subscribe to certain jobs. This will add these jobIds to the list of already subscribed jobs.
    var notifManager = WorkflowClientModule.NotificationManager;
    notifManager.SubscribeToJobs(jobIds);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also