General Architecture	Where to store handlers, pipelines, and plugins
39 Questions
4 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the purpose of specifying the correct TIn and TOut parameter and result object types when implementing a new pipe?

  • To associate the pipe with the appropriate pipeline (correct)
  • To allow the pipe to execute without any parameters
  • To ensure the pipe can process any type of input
  • To determine the order of execution for the pipe

What happens when the ResultCode is set to ResultCode.Error in the Execute method?

  • The pipeline exits immediately (correct)
  • The pipeline continues to execute the next pipes
  • An error message is logged without affecting execution
  • The method returns a default value

In which project should you create a new pipe class named AddCustomerZipCode?

  • The utility functions project
  • The Configured Commerce project
  • The main application project
  • The Extensions project (correct)

Which method serves as the entry point to a pipe and must be implemented in the new pipe class?

<p>Execute (D)</p> Signup and view all the answers

What should be done if the Customer parameter is null during the execution of the Execute method?

<p>Set the ResultCode to ResultCode.Error and return immediately (C)</p> Signup and view all the answers

What is a necessary prerequisite for adding a new pipe to a pipeline?

<p>Configured Commerce SDK installed (C)</p> Signup and view all the answers

What does the Order property value indicate within a pipeline?

<p>The priority and sequence of the pipe's execution (B)</p> Signup and view all the answers

What is a requirement for a new pipe to replace an existing pipe?

<p>It must implement the IPipe interface. (D)</p> Signup and view all the answers

Which property of the new pipe should match the pipe being replaced?

<p>The name of the pipe (A)</p> Signup and view all the answers

What does the Execute method of the FormatLabel pipe do?

<p>It sets the result label to 'new format'. (B)</p> Signup and view all the answers

What happens to the application when the FormatLabel pipe is implemented?

<p>It displays 'new format' instead of customer details. (D)</p> Signup and view all the answers

Which statement is true about the order value of the new pipe?

<p>It can be arbitrary but matching is considered best practice. (B)</p> Signup and view all the answers

What is one limitation when dealing with pipes in this context?

<p>You must replace a pipe instead of removing it. (B)</p> Signup and view all the answers

What must a pipe return from its Execute method?

<p>A result object (D)</p> Signup and view all the answers

What is the purpose of downloading the Windows Integration Service installer?

<p>To integrate Windows services into the Configured Commerce project. (D)</p> Signup and view all the answers

What must a pipe implement to be used within a pipeline?

<p>The IPipe interface (C)</p> Signup and view all the answers

What is the purpose of the 'Execute' method in a pipe?

<p>To contain the business logic of the pipe (A)</p> Signup and view all the answers

How are pipes within a pipeline ordered?

<p>In ascending order using the 'Order' property (A)</p> Signup and view all the answers

If a new pipe needs to be added to the second position in a pipeline, what order value should it have?

<p>A value between 101 and 199 (D)</p> Signup and view all the answers

What would happen if a pipe returns an error code during execution?

<p>The entire pipeline stops immediately (D)</p> Signup and view all the answers

What order value do all pipelines have by default for at least one pipe?

<p>100 (B)</p> Signup and view all the answers

To add a new pipe to the start of a pipeline, what order value should it have?

<p>Less than 100 (B)</p> Signup and view all the answers

What ensures that two pipes are executed within the same pipeline?

<p>The same parameter and result object types (TIn and TOut) (D)</p> Signup and view all the answers

What action is taken if the customer parameter is null?

<p>An error message is added to the result. (B)</p> Signup and view all the answers

In which scenario would you set the ExitPipeline flag to true?

<p>When an error is encountered that does not need an error indication. (B)</p> Signup and view all the answers

What is the significance of the result.SubCode property?

<p>It specifies the type of error encountered. (C)</p> Signup and view all the answers

How is the customer postal code handled in the pipeline?

<p>It is added to the result label if not empty. (A)</p> Signup and view all the answers

What will happen if the Execute method returns a result without setting any error flags?

<p>The execution of the pipeline will continue. (B)</p> Signup and view all the answers

What role does the ResultMessage play in the result?

<p>It communicates errors or important information. (B)</p> Signup and view all the answers

What does the Order property in the AddCustomerZipCode class indicate?

<p>The priority level of the pipe in the execution sequence. (A)</p> Signup and view all the answers

What is required to format the label successfully?

<p>A customer object must be present. (A)</p> Signup and view all the answers

What is the primary role of handlers in Optimizely Configured Commerce?

<p>Handlers are responsible for processing business logic and managing objects. (C)</p> Signup and view all the answers

How are handler chains executed in Optimizely Configured Commerce?

<p>Each handler in the chain is executed sequentially until there are no more handlers. (A)</p> Signup and view all the answers

What functionality does the GetCartHandler chain provide?

<p>It returns the cart object for the authenticated user or a specific cart identifier. (D)</p> Signup and view all the answers

In what way are pipelines similar to handler chains?

<p>Pipelines and handler chains are both made up of reusable portions of logic. (D)</p> Signup and view all the answers

What is a distinguishing feature of pipelines compared to earlier versions of Configured Commerce?

<p>Pipelines allow for easier modification of logic without breaking backwards compatibility. (C)</p> Signup and view all the answers

When is the GetProductHandler chain executed?

<p>When a user visits the Product Detail page or searches for a product. (A)</p> Signup and view all the answers

What is the 'CreateProductDtos' catalog pipeline responsible for?

<p>Creating ProductDto objects from a collection of Product data objects. (A)</p> Signup and view all the answers

Which statement correctly describes how pipelines interact with handler chains?

<p>Handler chains may share and reuse logic provided by pipelines. (B)</p> Signup and view all the answers

Flashcards

Handlers

Objects that process business logic in Configured Commerce after a REST API request.

Handler Chains

Organized sets of handlers executed sequentially.

GetCartHandler

A handler chain retrieving cart data for an authenticated user or by ID.

GetProductHandler

A handler chain retrieving a product by ID.

Signup and view all the flashcards

Pipelines

Reusable non-transactional business logic.

Signup and view all the flashcards

Pipes

Classes composing a pipeline.

Signup and view all the flashcards

IPipe interface

The required interface for classes functioning within a pipeline.

Signup and view all the flashcards

Execute method

The entry point for business logic within a pipe.

Signup and view all the flashcards

Order property

Specifies the execution order of a pipe in a pipeline.

Signup and view all the flashcards

Pipeline Order

Execution order within a pipeline based on the order property.

Signup and view all the flashcards

Pipe Order Increments

Pipe order values typically increment by 100.

Signup and view all the flashcards

Inserting Pipes

Adding a new pipe into a pipeline by specifying a new order value between other pipe orders.

Signup and view all the flashcards

Replacing pipes

Replacing an existing pipe in a pipeline with a new pipe having the same name and order value.

Signup and view all the flashcards

WindowsIntegrationService

A service for Configured Commerce installation on Windows systems.

Signup and view all the flashcards

Cart Data

Information about a customer's cart, including lines, costs and available shipping options.

Signup and view all the flashcards

Product Identifier

A unique key for identifying specific products.

Signup and view all the flashcards

Product Detail Page

A page displaying specific information about a product.

Signup and view all the flashcards

Quick Order Page

A page for looking up products quickly.

Signup and view all the flashcards

Checkout Address

Page to input address details.

Signup and view all the flashcards

Review and Pay Page

Page for confirming order information before final payment processing.

Signup and view all the flashcards

Cart Lines

Individual items in a shopping cart.

Signup and view all the flashcards

Shipping Costs

Costs related to shipping products to a customer.

Signup and view all the flashcards

Taxes

Fees charged on certain products or services.

Signup and view all the flashcards

Available Carriers

Shipping companies that can handle the order.

Signup and view all the flashcards

Non-transactional Logic

Logic that does not involve database changes for business functions.

Signup and view all the flashcards

Study Notes

Handlers

  • Handlers are objects responsible for processing business logic in Configured Commerce.
  • Handlers execute after the REST API receives and processes a request.
  • Handlers are organized into chains that operate on specific objects.
  • Each handler in a chain is executed in a configured order until there are no more handlers.
  • The GetCartHandler chain retrieves and returns the cart object for the authenticated user or using a cart identifier.
  • The GetCartHandler chain includes handlers for retrieving cart-related data such as cart lines, shipping costs, taxes, and available carriers.
  • The GetCartHandler chain is used indirectly throughout the storefront, including when a user visits the Cart page, navigates to the Checkout Address page, and proceeds to the Review and Pay page.
  • The GetProductHandler chain retrieves a product given a product identifier.
  • The GetProductHandler chain is executed when a user visits the Product Detail page or searches for a product on the Quick Order page.
  • New handlers can be added to existing handler chains to insert new business logic.

Pipelines

  • Pipelines are reusable portions of business logic that are not transactional.
  • Pipelines are made up of one or more classes, called pipes.
  • Pipelines are similar to handler chains.
  • Pipelines can be executed wherever the logic is needed.
  • Individual pipes within a pipeline can halt execution of the rest of the pipeline by returning an error code or exiting the pipeline.
  • To be used within a pipeline, a pipe must:
    • Implement the IPipe interface.
    • Return a result from the Execute method.
    • Specify an order via the Order property.
  • The Execute method is the sole entry point into a pipe and contains the business logic used by the pipe.
  • The Order property is used to specify the order of the pipe within the pipeline.
  • Pipes within a pipeline are executed in ascending order based on the Order property.
  • Pipelines have at least one pipe with an order value of 100.
  • Additional pipes typically increment the order by 100.
  • A new pipe can be added to a pipeline by specifying an order value within a specific range.
  • To insert a new pipe in between existing pipes, the order value should be between the order values of the existing pipes.
  • To add a new pipe to the start or end of a pipeline, the pipe should be given an order value less than 100 or greater than the highest order value in the pipeline, respectively.
  • It is possible to replace an existing pipe in a pipeline.
  • To replace an existing pipe, the new pipe must:
    • Implement the IPipe interface.
    • Return a result from the Execute method.
    • Specify an order via the Order property.
    • Be named the same as the pipe being replaced.
    • The Order value for the new pipe should match the Order value of the pipe being replaced.
  • You cannot "remove" a pipe, but you can create an implementation of it that does nothing.

Windows Integration Service

  • Download the Windows Integration Service installer for Configured Commerce if the WindowsIntegrationService folder is not present in your local copy of Configured Commerce.
  • Unzip the WindowsIntegrationService folder into your Configured Commerce project folder and follow the installation instructions.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Description

Explore the role of handlers in Configured Commerce, including their function and execution within the REST API framework. This quiz covers the processes involved in cart and product retrieval and highlights the importance of handler chains in the e-commerce experience.

More Like This

APIs Admin API
32 questions

APIs Admin API

SupportedAstatine4145 avatar
SupportedAstatine4145
APIs - Storefront API
32 questions

APIs - Storefront API

SupportedAstatine4145 avatar
SupportedAstatine4145
General	B2B Commerce Cloud API Reference
32 questions
Use Quizgecko on...
Browser
Browser