Add nodes

Learn how to add nodes to the synchronous flow.

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.

Add the DR Clear Data (Apex Action) node

Use the following steps to add this node:

  1. Drag a New Action node to the space between Start Checkout Session (Action) and Shipping Options (Screen) nodes.

  2. Type 'ClearData" and select digitalriverv3__DRB2B_ClearData.

  3. Enter the following settings:

    • Label: DR Clear Data

    • API Name: DR_Clear_Data

  4. Click Include next to Set Input Values / cartIdList.

  5. Set cartIdList to {!cartId}.

  6. Click Done.

  7. Delete the connector between Start Checkout Session (Action) and Shipping Options (Screen) nodes.

  8. Connect the Start Checkout Session (Action) node to the DR Clear Data (Apex Action) node.

Add the Reset Tax Identifiers (Assignment) node

Use the following steps to add this node:

  1. Add a new Assignment node.

  2. 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.

  3. Enter the following settings:

    • Label: Reset Tax Identifier

    • API Name: Reset_Tax_Identifier

    • Variable: {!Saved_Tax_Identifier}

    • Operator: Equals

    • Value: {!$GlobalConstant.EmptyString}

  4. Click Done when finished.

Add the Sync tax calculation (Apex Action) node

Use the following steps to add this node:

  1. Create a new Action node.

  2. 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.

  3. Enter the following settings:

    • Action: digitalriverv3__DRB2B_SyncTax

    • Label: Sync tax calculation

    • API Name: Sync_tax_calculation

    • Description: Calculates tax

  4. Set Input Values by selecting the Include toggle to On.

  5. Make sure the cartIds parameter value is set to {!cartId}.

  6. In the Advanced section, check Manually assign variables.

  7. Make sure the Store Output Values status variable is set to {!TaxCalStatus}.

  8. Click Done when finished.

Add the ValidateTaxCalculationStatus (Decision) node

Use the following steps to add this node:

  1. Create a new Decision node to validate if the tax calculation status is Error

  2. 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.

  3. Enter the following new Decision settings:

    • Label: ValidateTaxCalculationStatus

    • API Name: ValidateTaxCalculationStatus

    • Description: Validates tax calculation status

  4. 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)”

  5. Enter Resource as follows

    • Resource: {!TaxCalStatus}

    • Operator: Equals

    • Value: Error

  6. Click Done when finished.

Connect the following tax-related nodes as follows:

  1. Connect Set Checkout Deliver Method (Action) to Sync tax calculation (Apex action).

  2. Connect Sync tax calculation (Apex action) to ValidateTaxCalculationStatus (Decision).

  3. Connect ValidateTaxCalculationStatus (Decision) to Reset Tax Identifier (Assignment). Choose the Default Outcome when prompted.

  4. Connect ValidateTaxCalculationStatus (Decision) to Subflow Error. This should use the Error Status Outcome.

  5. Connect Reset Tax Identifier (Assignment) to Checkout Summary (Screen).

  6. When you are finished, you should see the node diagram as follows:

  7. Click Save to save the flow.

Add the Check if Session has orderId (Decision) node

Use the following steps to add this node:

  1. 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.

  2. Enter the following settings:

    • Label: Check if session has orderId

    • API Name: Check_if_session_has_orderId

  3. Edit the new Outcome information as follows:

    • Label: Order exists Outcome

    • API Name: Order_exists

  4. 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}

  5. Click Done.

  6. Click Save.

Add the Clear order Data (Subflow) node

Use the following steps to add the Clear order Data (Subflow) node to the synchronous flow:

  1. 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

  2. In the New Sublow screen, select "Clear Order Data" from the "Referenced Flow" drop down. Use these values.

  3. Use these values for the next set of fields

    • Label: Clear order Data

    • API Name: Clear_order_Data

  4. 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}

  5. Click Done.

  6. Click Save.

Connect the Check if Session has orderId (Decision) node

Use the following steps to connect the Check if Session has orderId (Decision) node to the synchronous flow:

  1. Delete the connector between "Update session" (Update Records) and "Cart to Order" (Action) nodes.

  2. 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.

Last updated