2

I created a pipeline and a command which runs the pipeline with XC 9.3.

The code of my command looks as follows:

public class MyCommand : CommerceCommand
{
  ...

  public virtual async Task<string> Process(CommerceContext commerceContext, string id)
  {
    using (CommandActivity.Start(commerceContext, this))
    {
      string res = await pipeline.Run(new MyArgument(id), 
        commerceContext.PipelineContextOptions);
      return res;
    }
  }
}

When I call GetPipelines() from Postman I see that the pipeline and its block are registered. Next when I attach the debugger I see that the pipeline is instantiated once the Command is constructed.

But when the pipeline.Run method gets called nothing happens. Its look like creation of the pipeline fails. After some dotpeeking this seems to happen in the Pipeline base class:

Sitecore.Framework.Pipelines {
  public abstract class Pipeline<...> {

    public override Task<TOutput> Run(TInput arg, TContext context)
    {
      return this.Configuration.CreateRunner().Run<TOutput>(this.Name, (object) arg, (IPipelineExecutionContext) context);
    }

  ...
  }
}

Any clues on why the pipeline does not run? What am I missing here?

1
  • Is it possible, that you post the content of the interface and the class of the pipeline? Are there any errors appearing in log? Can you also from nodeconfiguration post the configured pipeline including blocks?
    – Christian
    Commented Apr 29, 2020 at 18:52

1 Answer 1

1

Most likely the pipeline definition is injecting another pipeline. Look at the implementation of your "pipeline" (not the interface). Then look at the IPipelineConfiguration in the constructor of that class, Is it injecting the Interface of the pipeline you created?

Example constructor:

public TestPipeline(IPipelineConfiguration<ITestPipeline> configuration, ILoggerFactory loggerFactory) : base(configuration, loggerFactory) { }

Confirm that the ITestPipeline is correctly injected and no other pipeline is injected

1
  • This was indeed the problem. I totally missed that, thanks a lot!
    – Joost
    Commented Apr 30, 2020 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.