Ejemplo n.º 1
0
 public static void NotifyContentChanged(WorkflowNotificationEventArgs eventArgs)
 {
     WorkflowNotification[] notifications = null;
     using (var dbContext = GetDataContext())
     {
         notifications = dbContext.WorkflowNotifications.Where(notification =>
             notification.NodeId == eventArgs.NodeId).ToArray();
     }
     foreach (var notification in notifications)
         InstanceManager.FireNotification(notification, eventArgs);
 }
Ejemplo n.º 2
0
        public static void FireNotification(WorkflowNotification notification, WorkflowNotificationEventArgs eventArgs)
        {
            var wfInstance = Node.Load<WorkflowHandlerBase>(notification.WorkflowNodePath);
            var wfApp = CreateWorkflowApplication(wfInstance, WorkflowApplicationCreationPurpose.Resume, null);
            wfApp.Load(notification.WorkflowInstanceId);
            //wfApp.ResumeBookmark(notification.BookmarkName, notification.NodeId);
            if (ValidWakedUpWorkflow(wfApp))
            {
                wfApp.ResumeBookmark(notification.BookmarkName, eventArgs);
Debug.WriteLine("##WF> FireNotification: EXECUTING");
            }
            else
            {
                wfApp.Abort();
Debug.WriteLine("##WF> FireNotification: ABORT from FireNotification");
            }
        }