Example #1
0
 public static int RegisterWait(int nodeID, Guid wfInstanceId, string bookMarkName, string wfContentPath)
 {
     try
     {
         WriteDebug("**************** RegisterWait: " + wfInstanceId);
         using (var dbContext = GetDataContext())
         {
             var notification = new WorkflowNotification()
             {
                 BookmarkName       = bookMarkName,
                 NodeId             = nodeID,
                 WorkflowInstanceId = wfInstanceId,
                 WorkflowNodePath   = wfContentPath
             };
             dbContext.WorkflowNotifications.InsertOnSubmit(notification);
             dbContext.SubmitChanges();
             return(notification.NotificationId);
         }
     }
     catch (Exception e)
     {
         WriteError("RegisterWait", e);
         throw;
     }
 }
Example #2
0
 public static void FireNotification(WorkflowNotification notification, WorkflowNotificationEventArgs eventArgs)
 {
     try
     {
         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))
         {
             Debug.WriteLine(String.Format("##WF> FireNotification: ResumeBookmark: {0}|{1}", notification.NodeId, notification.WorkflowInstanceId));
             wfApp.ResumeBookmark(notification.BookmarkName, eventArgs);
         }
         else
         {
             Debug.WriteLine(String.Format("##WF> FireNotification: Cancel: {0}|{1}", notification.NodeId, notification.WorkflowInstanceId));
             wfApp.Cancel();
         }
     }
     catch (Exception e)
     {
         WriteError("FireNotification", e);
         throw;
     }
 }
Example #3
0
 partial void DeleteWorkflowNotification(WorkflowNotification instance);
Example #4
0
 partial void UpdateWorkflowNotification(WorkflowNotification instance);
Example #5
0
 partial void InsertWorkflowNotification(WorkflowNotification instance);