[SalesForce] Difference between pipelet and pipeline in SFCC

What is the difference between pipelet and pipeline in SFCC?

After googling the question I did not find a clear answer on my question. So, I am sorry if it is an obvious one.

Thank you.

Best Answer

See the documentation topic: Working with Pipelines

A pipeline is a logical controller that is stored as XML and is displayed as a flow chart via an Eclipse plugin called UX Studio. Pipelines have Start nodes and End nodes. Sometimes pipelines end with an Interaction node which indicates a template should be rendered to the client.

Screenshot showing the editor interface for the Page.xml Pipeline from The SiteGenesis Reference Application; It includes two pipelines: Show and Include. Additionally, a side panel entitled "Palette" includes buttons for tools used to build pipelines.

Pipelets are the components that are used to build a Pipeline. You can drag & drop Pipelets around in the interface and connect them with transitions. There are system Pipelets and you can define custom pipelets as Javascript files which have a function of this signature:

/**
 * Description of the scripting pipelet
 * @input InputParameterName : String Comment about this param
 * @output OutputParameterName : String Comment about this param
 */
function execute( pdict : dw.system.PipelineDictionary) : Number
{
  var success = false;
  // do your work and make sure to return PIPELET_NEXT or PIPELET_ERROR depending on the status of your work
  return success ? PIPELET_NEXT : PIPELET_ERROR;
}

Note that this is "the old way" and any new code should be written with Javascript controllers preferably in the style of StoreFront Reference Architecture (SFRA).

Related Topic