Siebel eSales Administration Guide > Shopping Service Methods Reference > Siebel eSales Workflow Methods >

Reorder Method


Reorder is the reverse of CreateOrder. It creates a quote from an existing order.

Preconditions for Calling the Reorder Method

  • Field maps are used to copy fields from the Order to Quote and Order Entry - Line Items to Quote Item business components, in the reverse of the CreateOrder method. Field maps are used to copy records from the Order Item XA to the Quote Item XA business component.

    Sample field maps are shown in Table 38. See the Shopping Service business service user properties in Siebel Tools for more details.

    Table 38. Sample Field Maps for the Reorder Method
    Name
    Value

    Quote|Order FieldMap 100

    Contact Id|Contact Id

    Quote Item|Order Item FieldMap 100

    Class Registration Id|
    Class Registration Id

    Quote Template Item XA|Quote Item XA FieldMap 100

    Attribute Id|Attribute Id

Arguments for the Reorder Method

The Reorder method has the arguments shown in Table 39.

Table 39. Reorder Arguments
Name
Type
Data Type
Optional
Comments

Return Error Code

Input

String

Y

If equal to N, the method will not return errors.

When a method returns an error, the workflow stops. To avoid stopping the workflow, you can set this input to N. This way the Shopping Service will not return an error, but instead save the error message in the output argument Error Message. You can then handle the error message as you want.

Error Message

Output

String

Y

Stores error messages.

Quote Id

Output

String

Y

ID of the quote that is created.

Order Id

Output

String

Y

Not used.

ReturnVal

Output

String

Y

Returns Success or Fail. Not used.

Pseudo-Algorithm for Reorder

  1. Get the Order Entry - Orders, Order Entry - Line Items, and Order Item XA business components. Get an instance of the Catalog business object and of the Quote, Quote Item, and Quote Item XA business components from this Catalog business object instance.

    The Order Entry - Orders business component is already positioned on the correct record, as the Reorder method is row-sensitive.

  2. Create a record in the Quote business component. Use Quote|Order FieldMap n to copy fields from the Order Entry - Orders business component to Quote.
  3. For each record in the Order Entry - Line Items business component, copy it to the Quote Item business component using Quote Item|Order Item FieldMap n field maps. To maintain hierarchical relationships, copy the parent record before copying its child records. Also, copy records from the grandchild business component Order Item XA to Quote Item XA.

    NOTE:  As Order Entry - Line Items and Quote Item have hierarchies, you cannot simply loop through the records in Order Entry - Line Items and copy them to Quote Item. You need to maintain the hierarchical relationship. To do this, you need to copy the parent record before you copy its child records.

    In the Shopping Service implementation, records are first loaded from Order Entry - Line Items and a tree in the memory is generated. The tree is then traversed from the root, so the parent record is copied before the child records.

  4. When doing step 3, for each record in the Order Entry - Line Items business component:
  5. Set the Error Message output argument if there is any error;

    If Return Error Code = N, do not return an error;

    Else return an error.

Siebel eSales Administration Guide Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.