Public Shared ReadOnly Property NotificationManager As INotificationManager
public static INotificationManager NotificationManager {get;}
Public Shared ReadOnly Property NotificationManager As INotificationManager
public static INotificationManager NotificationManager {get;}
{
// Subscribe to the job message event to start receiving job and step notifications.
// Use the subscription token to unsubscribe from the event.
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 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 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);
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)