Esempio n. 1
0
        public RFProcessingTrackerHandle RetryError(string dispatchKey, RFUserLogEntry userLogEntry)
        {
            try
            {
                Log.Info(this, "RetryError {0}", dispatchKey);
                LogRequest();
                var activity = new RFRequestActivity(_context, _engineConfig);

                var qi = _context.DispatchStore.GetInstruction(dispatchKey);
                if (qi != null)
                {
                    return(RegisterTracker(activity.Submit(null, new List <RFInstruction> {
                        qi
                    }, userLogEntry)));
                }
                return(new RFProcessingTrackerHandle
                {
                    TrackerCode = "error"
                });
            }
            catch (Exception ex)
            {
                Log.Exception(this, "RetryError", ex);
                return(new RFProcessingTrackerHandle
                {
                    TrackerCode = "error"
                });
            }
        }
Esempio n. 2
0
        public RFProcessingTracker SaveEntry(RFCatalogEntry entry, RFUserLogEntry userLogEntry)
        {
            var trackerCode             = SaveEntry(entry, true, userLogEntry);
            RFProcessingTracker tracker = null;
            var sw = Stopwatch.StartNew();

            do
            {
                Thread.Sleep(250);
                tracker = GetService().GetProcessStatus(trackerCode);
            } while (!tracker.IsComplete && sw.ElapsedMilliseconds < 10000);
            return(tracker);
        }
Esempio n. 3
0
 public RFProcessingTracker Submit(IEnumerable <RFCatalogEntry> inputs, IEnumerable <RFInstruction> instructions, RFUserLogEntry userLogEntry)
 {
     _parentContext.UserLog.LogEntry(userLogEntry);
     return(_parentContext.SubmitRequest(inputs, instructions));
 }
Esempio n. 4
0
        public RFProcessingTracker Run(bool isGraph, string processName, RFEngineProcessorParam parameters, RFUserLogEntry userLogEntry)
        {
            var instructions = new List <RFInstruction>();

            if (!isGraph)
            {
                instructions.Add(new RFParamProcessInstruction(processName, parameters));
            }
            else if (parameters is RFEngineProcessorGraphInstanceParam)
            {
                instructions.Add(new RFGraphProcessInstruction((parameters as RFEngineProcessorGraphInstanceParam).Instance, processName));
            }

            _parentContext.UserLog.LogEntry(userLogEntry);
            return(_parentContext.SubmitRequest(null, instructions));
        }
Esempio n. 5
0
 public RFProcessingTrackerHandle SaveDocumentAsync(RFCatalogKey key, object content, RFUserLogEntry userLogEntry)
 {
     return(SaveEntryAsync(RFDocument.Create(key, content), userLogEntry));
 }
Esempio n. 6
0
 public RFProcessingTracker SaveDocument(RFCatalogKey key, object content, bool raiseEvent, RFUserLogEntry userLogEntry)
 {
     if (raiseEvent)
     {
         return(SaveEntry(RFDocument.Create(key, content), userLogEntry));
     }
     else
     {
         SaveEntry(RFDocument.Create(key, content), false, userLogEntry);
         return(new RFProcessingTracker("dummy"));
     }
 }
Esempio n. 7
0
 protected RFProcessingTrackerHandle SaveEntry(RFCatalogEntry entry, bool raiseEvent, RFUserLogEntry userLogEntry) // raiseEvent = true
 {
     if (raiseEvent)
     {
         return(GetService().SubmitAndProcess(new List <RFCatalogEntryDTO> {
             new RFCatalogEntryDTO(entry)
         }, userLogEntry));
     }
     else
     {
         _context.SaveEntry(entry, raiseEvent);
         _context.UserLog.LogEntry(userLogEntry);
         return(null);
     }
 }
Esempio n. 8
0
 protected RFProcessingTrackerHandle SaveEntries(List <RFCatalogEntry> entries, bool raiseEvent, RFUserLogEntry userLogEntry) // raiseEvent = true
 {
     if (raiseEvent)
     {
         return(GetService().SubmitAndProcess(entries.Select(e => new RFCatalogEntryDTO(e)), userLogEntry));
     }
     else
     {
         foreach (var entry in entries)
         {
             _context.SaveEntry(entry, raiseEvent);
         }
         _context.UserLog.LogEntry(userLogEntry);
         return(null);
     }
 }
Esempio n. 9
0
 public RFProcessingTrackerHandle SaveEntryAsync(RFCatalogEntry entry, RFUserLogEntry userLogEntry)
 {
     return(SaveEntry(entry, true, userLogEntry));
 }
Esempio n. 10
0
 public RFProcessingTrackerHandle SaveEntriesAsync(List <RFCatalogEntry> entries, RFUserLogEntry userLogEntry)
 {
     return(SaveEntries(entries, true, userLogEntry));
 }
Esempio n. 11
0
 public RFProcessingTrackerHandle RunProcess(bool isGraph, string processName, RFGraphInstance instance, RFUserLogEntry userLogEntry)
 {
     try
     {
         Log.Info(this, "RunProcess {0} / ({1},{2})", processName, instance != null ? instance.Name : null, instance != null ? instance.ValueDate : null);
         LogRequest();
         var activity = new RFRequestActivity(_context, _engineConfig);
         // TODO: how should we treat non-graph?
         return(RegisterTracker(activity.Run(isGraph, processName, new RFEngineProcessorGraphInstanceParam(instance), userLogEntry)));
     }
     catch (Exception ex)
     {
         Log.Exception(this, "RunProcess", ex);
         return(new RFProcessingTrackerHandle
         {
             TrackerCode = "error"
         });
     }
 }
Esempio n. 12
0
 public RFProcessingTrackerHandle SubmitAndProcess(IEnumerable <RFCatalogEntryDTO> inputs, RFUserLogEntry userLogEntry)
 {
     try
     {
         Log.Info(this, "SubmitAndProcess {0}", inputs.Count());
         LogRequest();
         var activity = new RFRequestActivity(_context, _engineConfig);
         return(RegisterTracker(activity.Submit(inputs.Select(e => e.Deserialize()), userLogEntry)));
     }
     catch (Exception ex)
     {
         Log.Exception(this, "SubmitAndProcess", ex);
         return(new RFProcessingTrackerHandle
         {
             TrackerCode = "error"
         });
     }
 }