ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Desktop.Workflow.Client.Models Namespace / INotificationManager Interface
Members Example

In This Topic
    INotificationManager Interface
    In This Topic
    Provides access to job and step notifications within Workflow Manager
    Syntax
    public interface INotificationManager 
    Public Interface INotificationManager 
    Example
    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);
    Unsubscribe to messages for the given jobs
    // Unsubscribe from the job message event using the subscription token
    JobMessageEvent.Unsubscribe(subscriptionToken);
    
    // Unsubscribe from jobs using the same instance of Notification Manager used to subscribe to jobs.
    // This will remove the jobs from the subscribed job list if no other clients are subscribed to those jobs.
    var notifManager = WorkflowClientModule.NotificationManager;
    notifManager.UnsubscribeFromJobs(jobIds);
    Send a response to Workflow Manager Server pertaining to a job's current step
    // Send a step response to Workflow Manager Server with additional information required for the step to continue.
    // In this example, provide an answer response to a QuestionStepInfoRequiredMessage so that the Question step can complete.
    // The response must include the jobId, stepId, and other information pertinent to the step.
    var stepInfoResponseMessage = new QuestionStepInfoResponseMessage()
    {
      JobId = jobId,
      StepId = stepId,
      QuestionResponse = 1,
      Comment = "Selected question response option 1"
    };
    var stepResponse = new StepResponse()
    {
      Message = stepInfoResponseMessage
    };
    
    var notifManager = WorkflowClientModule.NotificationManager;
    notifManager.SendStepResponse(stepResponse);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also