protected virtual PipelineBatchContext GetPipelineBatchContext(PipelineBatch pipelineBatch) { var pipelineBatchContext = new PipelineBatchContext(); var newPlugin = new PipelineBatchRuntimeSettings { ShouldPersistSummary = true, PipelineBatchMode = string.Empty }; pipelineBatchContext.AddPlugin(newPlugin); return(pipelineBatchContext); }
public bool Sync() { try { Guid pipelineItemId = Guid.Parse(SalesforceDefPipelineBatchId); IItemModelRepository itemModelRepo = Sitecore.DataExchange.Context.ItemModelRepository; ItemModel pipelineBatchItemModel = itemModelRepo.Get(pipelineItemId); var converter = pipelineBatchItemModel.GetConverter <PipelineBatch>(Sitecore.DataExchange.Context.ItemModelRepository); var convertResult = converter.Convert(pipelineBatchItemModel); PipelineBatch pipelineBatch = convertResult.ConvertedValue; PipelineBatchContext pipelineBatchContext = new PipelineBatchContext(); var runner = new InProcessPipelineBatchRunner(); runner.RunAsync(pipelineBatch, pipelineBatchContext); Log.Info("Successfully synced xConnect contact to Salesforce on session end via DEF", this); return(true); } catch (Exception ex) { Log.Error($"Error syncing xConnect contact to Salesforce on session end via DEF. PipelineBatchId = {SalesforceDefPipelineBatchId}", ex, this); return(false); } }
protected override void OnStartingProcessing(PipelineBatch pipelineBatch, PipelineBatchContext pipelineBatchContext, ILogger logger) { _logger = logger; base.OnStartingProcessing(pipelineBatch, pipelineBatchContext, logger); }