---
schema_version: "1"
id: 71a2634431b1b59a6360f5d62e911394f0b10d27746dd2e9638c707cdeda82bc
title: RE_Order.DoWork Interface
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/RE_order_do_work_interface.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/RE_order_do_work_interface.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5fa625814c740f286312f41794e0ced3656befdffb3f68c8253e90914615ead5
description: The RE_Order.DoWork Apex interface provides the capability to perform additional work after an order and the related records are committed to the database.
---
# RE\_Order.DoWork Interface

The RE\_Order.DoWork Apex interface provides the capability to perform additional work after an order and the related records are committed to the database.

The transaction gets rolled back if there are any errors reported during the doWork execution.

## Namespace

cgcloud

## Example Implementation

cgcloud.RE\_Order.DoWork;

## Supported Methods

## doWork()

Append the work to be executed after the order and its related records are committed to the database.

**API Version:** 59.0

**Signature:** global void doWork()

**Example**

global class RetailOrderSaveCustomization implements System.Callable {
  public class MyAfterCommitWork implements cgcloud.RE\_Order.DoWork {
    cgcloud\_\_Order\_\_c m\_order = null;

    MyAfterCommitWork(cgcloud\_\_Order\_\_c order) {
      m\_order = order;
    }

    // This method will be called after the order and related record
    // changes are committed to the database.
    // If any error is thrown during the execution of doWork, the transaction
    // will be rolled back
    global override void doWork() {
      system.debug('Im here!');
    }
  }

  public Object call(String m, Map<String, Object> params) {
    cgcloud.RE\_Order orderWrapper = (cgcloud.RE\_Order) params.get('order');
    cgcloud\_\_Order\_\_c order = (cgcloud\_\_Order\_\_c) orderWrapper.getOrder()
      .getRecord();

    orderWrapper.registerWork(new MyAfterCommitWork(order));
    return null;
  }
}