Class OrderTransitionResult

Read-only result of OrderMgr.attemptOrderTransition(Order).

getCompleted() and getRemaining() preserve lifecycle order and partition the applicable steps. getExecuted() contains only applicable steps invoked by the current request. Progress reflects the steps currently applicable for the installed Commerce Apps and the order’s current state. A final result requires no further processing in this invocation. Final results include successful placement, a domain failure that transitions the order to FAILED, and no attempt when the order is not in CREATED status. For a FAILED order, getBasket() returns the reopened basket, or null when the underlying operation did not reopen a basket.

Constant Summary 

ConstantDescription
REASON_ORDER_NOT_CREATED: String = “order_not_created”Stable reason indicating that no transition was attempted because the order is not in CREATED status.
STEP_FRAUD: String = “fraud”Post-payment fraud lifecycle step identifier.
STEP_GIFT_CARD: String = “giftcard”Gift-card capture lifecycle step identifier.
STEP_PAYMENT: String = “payment”Payment-app processing lifecycle step identifier.

Property Summary 

PropertyDescription
basket: Basket (read-only)The reopened basket for a FAILED order, or null when the underlying operation did not reopen a basket (for example the basket was already removed or the open-basket limit was reached) or no domain failure occurred.
completed: String[] (read-only)
error: Boolean (read-only)Whether this terminal result represents a domain failure that transitioned the order to FAILED.
executed: String[] (read-only)
final: Boolean (read-only)
reason: String (read-only)
remaining: String[] (read-only)
step: String (read-only)

Constructor Summary 

This class does not have a constructor, so you cannot create it directly.

Method Summary 

MethodDescription
getBasket()The reopened basket for a FAILED order, or null when the underlying operation did not reopen a basket (for example the basket was already removed or the open-basket limit was reached) or no domain failure occurred.
getCompleted()
getExecuted()
getReason()
getRemaining()
getStep()
isError()Whether this terminal result represents a domain failure that transitioned the order to FAILED.
isFinal()

Methods inherited from class Object 

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

Constant Details 

REASON_ORDER_NOT_CREATED 

REASON_ORDER_NOT_CREATED: String = "order_not_created"

Stable reason indicating that no transition was attempted because the order is not in CREATED status.


STEP_FRAUD 

STEP_FRAUD: String = "fraud"

Post-payment fraud lifecycle step identifier.


STEP_GIFT_CARD 

STEP_GIFT_CARD: String = "giftcard"

Gift-card capture lifecycle step identifier.


STEP_PAYMENT 

STEP_PAYMENT: String = "payment"

Payment-app processing lifecycle step identifier.


Property Details 

basket 

basket: Basket (read-only)

The reopened basket for a FAILED order, or null when the underlying operation did not reopen a basket (for example the basket was already removed or the open-basket limit was reached) or no domain failure occurred. BasketMgr.getCurrentBasket() returns this basket only when it remains the session's current basket; otherwise callers should use this return value.


completed 

completed: String[] (read-only)


error 

error: Boolean (read-only)

Whether this terminal result represents a domain failure that transitioned the order to FAILED. Unexpected provider or infrastructure exceptions are not represented as soft results; they propagate. When true, getStep() identifies the failed lifecycle step, or is null for placement failure.


executed 

executed: String[] (read-only)


final 

final: Boolean (read-only)


reason 

reason: String (read-only)


remaining 

remaining: String[] (read-only)


step 

step: String (read-only)


Method Details 

getBasket() 

getBasket(): Basket

The reopened basket for a FAILED order, or null when the underlying operation did not reopen a basket (for example the basket was already removed or the open-basket limit was reached) or no domain failure occurred. BasketMgr.getCurrentBasket() returns this basket only when it remains the session's current basket; otherwise callers should use this return value.

Returns:

  • the reopened basket, or null if none

getCompleted() 

getCompleted(): String[]

Returns:

  • applicable steps already completed, in lifecycle order

getExecuted() 

getExecuted(): String[]

Returns:

  • applicable steps invoked during this request, in lifecycle order

getReason() 

getReason(): String

Returns:

  • a stable non-error terminal reason, or null when not applicable

getRemaining() 

getRemaining(): String[]

Returns:

  • applicable steps not completed, including the stopped step, in lifecycle order

getStep() 

getStep(): String

Returns:

  • the pending or failed step, or null for terminal success, placement FAILED, or no applicable pending step

isError() 

isError(): Boolean

Whether this terminal result represents a domain failure that transitioned the order to FAILED. Unexpected provider or infrastructure exceptions are not represented as soft results; they propagate. When true, getStep() identifies the failed lifecycle step, or is null for placement failure.

Returns:

  • true if this terminal result is a domain failure that transitioned the order to FAILED

isFinal() 

isFinal(): Boolean

Returns:

  • whether no further processing is required in this invocation