public Guid Process(string filename, string exportdir) { WFLogger.NLogger.Info("Filename={0} ExportDir={1}", filename, exportdir); // user did not indicate export directory // extract directory name from filename if (exportdir == string.Empty) { exportdir = System.IO.Path.GetDirectoryName(filename); } WFProcessType wfprocesstype = new WFProcessType { DocumentToProcess = filename, ExportDirectory = exportdir }; wfprocesstype.OutputDocuments.Add(filename, "Process"); TrackingDataTree newtree = new TrackingDataTree(); newtree.Value = new TrackingData(wfprocesstype.TrackingId, filename, OperationContext.Current.GetCallbackChannel <IWFClient>()); this.TrackingTree.Add(newtree); ProcessingAsync cd = new ProcessingAsync(this.Process); cd.BeginInvoke(wfprocesstype, cd.EndInvoke, null); return(wfprocesstype.TrackingId); }
public Guid Execute(ProcessorData procdata) { procdata.OutputDocuments.Add(procdata.DocumentToProcess, procdata.WFState.Value); TrackingDataTree newtree = new TrackingDataTree(); newtree.Value = new TrackingData(procdata.TrackingId, procdata.DocumentToProcess, OperationContext.Current.GetCallbackChannel <IWFClient>()); this.TrackingTree.Add(newtree); if (string.IsNullOrEmpty(procdata.ExportDirectory)) { if (string.IsNullOrEmpty(procdata.DocumentToProcess)) { procdata.ExportDirectory = System.Environment.CurrentDirectory; } else { procdata.ExportDirectory = System.IO.Path.GetDirectoryName(procdata.DocumentToProcess); } } ProcessingAsync cd = new ProcessingAsync(this.Process); cd.BeginInvoke(procdata, cd.EndInvoke, null); return(procdata.TrackingId); }