Add nodes
Learn how to add nodes to the synchronous flow.
Last updated
Learn how to add nodes to the synchronous flow.
Last updated
To continue the update, you need to add some new nodes to the flow. Follow the steps in each section to add new nodes to the synchronous flow.
Use the following steps to add this node:
Drag a New Action node to the space between Start Checkout Session (Action) and Shipping Options (Screen) nodes.
Type 'ClearData" and select digitalriverv3__DRB2B_ClearData.
Enter the following settings:
Label: DR Clear Data
API Name: DR_Clear_Data
Click Include next to Set Input Values / cartIdList.
Set cartIdList to {!cartId}.
Click Done.
Delete the connector between Start Checkout Session (Action) and Shipping Options (Screen) nodes.
Connect the Start Checkout Session (Action) node to the DR Clear Data (Apex Action) node.
Connect the DR Clear Data (Apex Action)node to the Shipping Options (Screen) node.
Use the following steps to add this node:
Add a new Assignment node.
Drag the node to the empty area between the Set Checkout Delivery Method action and the Checkout Summary screen. The node will be connected later in this topic.
Enter the following settings:
Label: Reset Tax Identifier
API Name: Reset_Tax_Identifier
Variable: {!Saved_Tax_Identifier}
Operator: Equals
Value: {!$GlobalConstant.EmptyString}
Click Done when finished.
Use the following steps to add this node:
Create a new Action node.
Drag the node to the empty area between the Set Checkout Delivery Method action and the Reset Tax Identifiers assignment node. The node will be connected later in this topic.
Enter the following settings:
Action: digitalriverv3__DRB2B_SyncTax
Label: Sync tax calculation
API Name: Sync_tax_calculation
Description: Calculates tax
Set Input Values by selecting the Include toggle to On.
Make sure the cartIds parameter value is set to {!cartId}
.
In the Advanced section, check Manually assign variables.
Make sure the Store Output Values status variable is set to {!TaxCalStatus}.
Click Done when finished.
Use the following steps to add this node:
Create a new Decision node to validate if the tax calculation status is Error
Drag a decision node into the flow between the Sync Tax Calculation action and the Reset Tax Identifiers assignment node. The node will be connected later in this topic.
Enter the following new Decision settings:
Label: ValidateTaxCalculationStatus
API Name: ValidateTaxCalculationStatus
Description: Validates tax calculation status
Edit the new Outcome Details as follows:
Label: Error Status
Outcome API Name: Error_Status
Condition Requirements to Execute Outcome: “All conditions are met (AND)”
Enter Resource as follows
Resource: {!TaxCalStatus}
Operator: Equals
Value: Error
Click Done when finished.
Connect the following tax-related nodes as follows:
Connect Set Checkout Deliver Method (Action) to Sync tax calculation (Apex action).
Connect Sync tax calculation (Apex action) to ValidateTaxCalculationStatus (Decision).
Connect ValidateTaxCalculationStatus (Decision) to Reset Tax Identifier (Assignment). Choose the Default Outcome when prompted.
Connect ValidateTaxCalculationStatus (Decision) to Subflow Error. This should use the Error Status Outcome.
Connect Reset Tax Identifier (Assignment) to Checkout Summary (Screen).
When you are finished, you should see the node diagram as follows:
Click Save to save the flow.
Use the following steps to add this node:
Create a new Decision node to validate if the Order ID has been populated. Drag the decision node into the flow between Update session (Update Records) and Cart to Order (Action) nodes. The new node will be connected later in this topic.
Enter the following settings:
Label: Check if session has orderId
API Name: Check_if_session_has_orderId
Edit the new Outcome information as follows:
Label: Order exists Outcome
API Name: Order_exists
Set Condition Requirements to Execute Outcome drop down as “All conditions are met (AND).” Enter Resource information as follows:
Resource: {!mainCheckoutSession.OrderId}
Operator: Does Not Equal
Value: {!$GlobalConstant.EmptyString}
Click Done.
Click Save.
Use the following steps to add the Clear order Data (Subflow) node to the synchronous flow:
Drag a subflow node into the flow to the right of the new Check if session has orderId (Decision) node created in the previous step. The node will be connected later in this section
In the New Sublow screen, select "Clear Order Data" from the "Referenced Flow" drop down. Use these values.
Use these values for the next set of fields
Label: Clear order Data
API Name: Clear_order_Data
In the Set Input Values section use the following values:
mainCheckoutSession: Toggle to Include. Value: {!mainCheckoutSession}
OrderId: Toggle to Include. Value: {!mainCheckoutSession.OrderId}
Manually assign variables: Checked.
Store Output Values
mainCheckoutSession: {!mainCheckoutSession}
Click Done.
Click Save.
Use the following steps to connect the Check if Session has orderId (Decision) node to the synchronous flow:
Delete the connector between "Update session" (Update Records) and "Cart to Order" (Action) nodes.
Connect the following nodes:
Update session (Update Records) node to Check if session has orderId (Decision) node.
Check if session has orderId (Decision) node to Clear order Data (Subflow) node.
Choose the "Order exists" Outcome when prompted.
Check if session has orderId (Decision) node to Cart to Order (Action) node.
This should default to the "Default Outcome."
Clear order Data (Subflow) node to Cart to Order (Action) node.
Note: Additional screen nodes shown in the screenshot will be added later in this topic.