Examples of Using Web Services with Configure-to-Order

Use these example payloads to get some ideas on how you can use web services with configure-to-order.

Basic Queries

Query on Simple Condition

Use findCtoItemStructure to get the entire structure of configured item VIK12-100.

<?xml version="1.0" encoding="UTF-8"?>
<ns1:findCtoItemStructure xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/">
  <ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
    <ns2:fetchStart>0</ns2:fetchStart>
    -- start at index 0
    <ns2:fetchSize>-1</ns2:fetchSize>
    -- Get all rows
    <ns2:filter>
      <ns2:conjunction>And</ns2:conjunction>
      <ns2:group>
        <ns2:conjunction>And</ns2:conjunction>
        <ns2:upperCaseCompare />
        <ns2:item>
          <ns2:conjunction>And</ns2:conjunction>
          <ns2:upperCaseCompare />
          <ns2:attribute>ConfigItemNumber</ns2:attribute>
          -- Condition on ConfigItemNumber
          <ns2:operator>=</ns2:operator>
          <ns2:value>VIK12-100</ns2:value>
          --value for Configured Item Number
        </ns2:item>
      </ns2:group>
      <ns2:nested />
    </ns2:filter>
    <ns2:excludeAttribute />
  </ns1:findCriteria>
  <ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
    <ns2:retrieveAllTranslations />
  </ns1:findControl>
</ns1:findCtoItemStructure>

Query on More Than One Condition and Filter Results

Use findCtoItemStructure to get the entire structure for each configured item created between 09-Dec-2018 and 09-Dec-2019 where the configuration model is VIK12. Don't include the InventoryItemId attribute or the ParentInventoryItemId attribute in the response.

<ns1: findCtoItemStructurexmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStr uctureService/types/">
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
   <ns2:fetchStart>0</ns2:fetchStart>
   <ns2:fetchSize>-1</ns2:fetchSize>
   <ns2:filter>
      <ns2:conjunction>And</ns2:conjunction>
      <ns2:group>
         <ns2:conjunction>And</ns2:conjunction>
         <ns2:upperCaseCompare></ns2:upperCaseCompare>
         <ns2:item>
            <ns2:conjunction>And</ns2:conjunction>
            <ns2:upperCaseCompare></ns2:upperCaseCompare>
            <ns2:attribute>CreationDate</ns2:attribute>
            <ns2:operator>between</ns2:operator>
            <ns2:value>2018-10-9</ns2:value> -- Use format YYYY-MM-DD.
            <ns2:value>2019-12-09</ns2:value>
         </ns2:item>
         <ns2:item>
            <ns2:conjunction>And</ns2:conjunction>
            <ns2:upperCaseCompare></ns2:upperCaseCompare>
            <ns2:attribute> BaseModelItemNumber </ns2:attribute>
            <ns2:operator>CONTAINS</ns2:operator>
            <ns2:value>VIK12</ns2:value>
         </ns2:item>
      </ns2:group>
   </ns2:filter>
   <ns2:findAttribute>InventoryItemId</ns2:findAttribute> --List of attributes to include or not include in response.
   <ns2:findAttribute>ParentInventoryItemId</ns2:findAttribute>
   <ns2:excludeAttribute>true</ns2:excludeAttribute> --true means don't include in response.
</ns1:findCriteria>
</ns1: findCtoItemStructure>

Refresh, Then Query on More Than One Condition

Use findCtoItemStructure to get the entire structure for each configured item created between 09-Dec-2018 and 09-Dec-2019 where the configuration model is VIK12. Use RefreshStructure to refresh the explosion repository.

<ns1: findCtoItemStructurexmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/">
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
   <ns2:fetchStart>0</ns2:fetchStart>
   <ns2:fetchSize>-1</ns2:fetchSize>
   <ns2:filter>
      <ns2:conjunction>And</ns2:conjunction>
      <ns2:group>
         <ns2:conjunction>And</ns2:conjunction>
         <ns2:upperCaseCompare></ns2:upperCaseCompare>
         <ns2:item>
            <ns2:conjunction>And</ns2:conjunction>
            <ns2:upperCaseCompare></ns2:upperCaseCompare>
            <ns2:attribute>CreationDate</ns2:attribute>
            <ns2:operator>between</ns2:operator>
            <ns2:value>2018-10-09</ns2:value> -- Use format YYYY-MM-DD.
            <ns2:value>2019-12-09</ns2:value>
         </ns2:item>
         <ns2:item>
            <ns2:conjunction>And</ns2:conjunction>
            <ns2:upperCaseCompare></ns2:upperCaseCompare>
            <ns2:attribute> BaseModelItemNumber </ns2:attribute>
            <ns2:operator>CONTAINS</ns2:operator>
            <ns2:value>VIK12</ns2:value>
         </ns2:item>
         <ns2:item>
            <ns2:conjunction>And</ns2:conjunction>
            <ns2:upperCaseCompare></ns2:upperCaseCompare>
            <ns2:attribute> RefreshStructure </ns2:attribute>
            <ns2:operator>=</ns2:operator>
            <ns2:value>true</ns2:value> -- Use true or false with RefreshStructure.
         </ns2:item>
      </ns2:group>
   </ns2:filter>
</ns1:findCriteria>
</ns1: findCtoItemStructure>

Get Large Structures

Get Large Structures

If the web service response for a configured item structure includes more than 500 rows, then you must call the service one time for each set of 500 rows. For example, if the structure contains 1550 rows, then you make four calls.

  • First call gets rows 0 through 499

  • Second call gets rows 500 through 999

  • Third call gets rows 1,000 through 1,499

  • Fourth call gets rows 1,500 through 1,550

You must not set the start value to a value greater than 0 in the first call. The start value for the second call is greater than zero, so the web service doesn't refresh the repository. Setting the start value to 0 in the first call makes sure the web service refreshes the entire structure.

In this example, assume your response contains 690 rows.

  • The first call sets the start to 0 and size to 500 to get rows 0 through 499.

  • The second call sets the start to 500 to get rows 500 to 690.

Here's the first call.

<?xml version="1.0" encoding="UTF-8"?>
<ns1:findCtoItemStructure xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/">
  <ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
    <ns2:fetchStart>0</ns2:fetchStart>
    <ns2:fetchSize>500</ns2:fetchSize>
    <ns2:filter>
      <ns2:conjunction>And</ns2:conjunction>
      <ns2:group>
        <ns2:conjunction>And</ns2:conjunction>
        <ns2:upperCaseCompare />
        <ns2:item>
          <ns2:conjunction>And</ns2:conjunction>
          <ns2:upperCaseCompare />
          <ns2:attribute>CreationDate</ns2:attribute>
          <ns2:operator>BETWEEN</ns2:operator>
          <ns2:value>2018-12-09</ns2:value>
          <ns2:value>2019-12-09</ns2:value>
        </ns2:item>
      </ns2:group>
    </ns2:filter>
    <ns2:excludeAttribute />
  </ns1:findCriteria>
  <ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
    <ns2:retrieveAllTranslations />
  </ns1:findControl>
</ns1:findCtoItemStructure>

Here's the second call.

<?xml version="1.0" encoding="UTF-8"?>
<ns1:findCtoItemStructure xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/">
  <ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
    <ns2:fetchStart>500</ns2:fetchStart>
    <ns2:fetchSize>500</ns2:fetchSize>
    <ns2:filter>
      <ns2:conjunction>And</ns2:conjunction>
      <ns2:group>
        <ns2:conjunction>And</ns2:conjunction>
        <ns2:upperCaseCompare />
        <ns2:item>
          <ns2:conjunction>And</ns2:conjunction>
          <ns2:upperCaseCompare />
          <ns2:attribute>CreationDate</ns2:attribute>
          <ns2:operator>BETWEEN</ns2:operator>
          <ns2:value>2018-12-09</ns2:value>
          <ns2:value>2019-12-09</ns2:value>
        </ns2:item>
      </ns2:group>
    </ns2:filter>
    <ns2:excludeAttribute />
  </ns1:findCriteria>
  <ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
    <ns2:retrieveAllTranslations />
  </ns1:findControl>
</ns1:findCtoItemStructure>

Refresh, Then Get Large Structures

Using findCtoItemStructure to get a large structure might take a lot of time because it must first refresh the explosion repository to get structure details, and then query the data. To avoid this problem, make two calls.

  • Refresh the repository.

  • Get the structure.

Use the same parameter values in each call.

Here's the first call.

<?xml version="1.0" encoding="UTF-8"?>
<ns1:refreshConfigStructure xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/">
  <ns1:configList xmlns:ns2="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/">
    <ns2:CreationDateFrom>2018-12-09</ns2:CreationDateFrom>
    <ns2:CreationDateTo>2019-12-09</ns2:CreationDateTo>
  </ns1:configList>
</ns1:refreshConfigStructure>

Add subsequent calls to get the structure. See the Get Large Structures section, above.

Other Queries

Group Your Conditions

In this example, use findCtoItemStructure to get the entire structure of each configured item created between 09- Dec-2018 and 09-Dec-2019 for configuration model VIK12. Use the OR conjunction to group your conditions.

<?xml version="1.0" encoding="UTF-8"?>
<ns1:findCtoItemStructure xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/">
  <ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
    <ns2:fetchStart>0</ns2:fetchStart>
    <ns2:fetchSize>500</ns2:fetchSize>
    <ns2:filter>
      <ns2:conjunction>And</ns2:conjunction>
      <ns2:group>
        <ns2:conjunction>And</ns2:conjunction>
        <ns2:upperCaseCompare />
        <ns2:item>
          <ns2:conjunction>And</ns2:conjunction>
          <ns2:upperCaseCompare />
          <ns2:attribute>CreationDate</ns2:attribute>
          <ns2:operator>BETWEEN</ns2:operator>
          <ns2:value>2018-12-09</ns2:value>
          <ns2:value>2019-12-09</ns2:value>
        </ns2:item>
      </ns2:group>
      <ns2:group>
        <ns2:conjunction>Or</ns2:conjunction>
        --Group with the OR condition.
        <ns2:upperCaseCompare />
        <ns2:item>
          <ns2:conjunction>And</ns2:conjunction>
          <ns2:upperCaseCompare />
          <ns2:attribute>BaseModelItemNumber</ns2:attribute>
          <ns2:operator>=</ns2:operator>
          <ns2:value>VIK12</ns2:value>
        </ns2:item>
      </ns2:group>
    </ns2:filter>
    <ns2:excludeAttribute />
  </ns1:findCriteria>
  <ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
    <ns2:retrieveAllTranslations />
  </ns1:findControl>
</ns1:findCtoItemStructure>

Get Transaction Attributes

Use findCtoItemStructure to get the entire structure of the VIK12-100 configured item. Filter the result so it only includes details for transactional attribute names that start with MFG_Transactional_Attributes, and that contain the value Black.

<ns1:findCtoItemStructure xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/"
   >
<ns1:findCtoItemStructure>
<ns1:findCriteria>
<ns2:fetchStart>0</ns2:fetchStart>
<ns2:fetchSize>-1</ns2:fetchSize>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>ConfigItemNumber</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>VIK12*100</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:childFindCriteria> -- This is the structure for adding conditions based on TIA
<ns2:fetchStart>0</ns2:fetchStart>
<ns2:fetchSize>-1</ns2:fetchSize>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>AttributeName</ns2:attribute>
<ns2:operator>STARTSWITH</ns2:operator>
<ns2:value>MFG_Transactional_Attributes</ns2:value>
</ns2:item>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>CharacterAttributeValue</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>Black</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:childFindCriteria/>
<ns2:childAttrName>CtoTransactionAttr</ns2:childAttrName> -- This value is fixed and needs to be passed if we want filter based on the TIA
</ns2:childFindCriteria>
</ns1:findCriteria>
<ns1:findControl>
<ns2:retrieveAllTranslations>false</ns2:retrieveAllTranslations>
</ns1:findControl>
</ns1:findCtoItemStructure>

Get Entire Item Structure According to Transaction Attribute

Get the entire item structure for configured items created between 09-DEC-2018 and 09-DEC-2019, and where the value of transaction attribute SCO_color is Black.

You call the service two times.

  • Get configured items that match the filter.

  • Use values that the first call returns as the parameters, such as ConfigItemNumber.

Here's the first call.

<?xml version="1.0" encoding="UTF-8"?>
<ns1:findCtoItemStructure xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/">
  <ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
    <ns2:fetchStart>0</ns2:fetchStart>
    <ns2:fetchSize>500</ns2:fetchSize>
    <ns2:filter>
      <ns2:conjunction>And</ns2:conjunction>
      <ns2:group>
        <ns2:conjunction>And</ns2:conjunction>
        <ns2:upperCaseCompare>false</ns2:upperCaseCompare>
        <ns2:item>
          <ns2:conjunction>And</ns2:conjunction>
          <ns2:upperCaseCompare>false</ns2:upperCaseCompare>
          <ns2:attribute>CreationDate</ns2:attribute>
          <ns2:operator>BETWEEN</ns2:operator>
          <ns2:value>2018-12-09</ns2:value>
          <ns2:value>2019-12-09</ns2:value>
        </ns2:item>
        <ns2:item>
          --This block contains logic for filtering configured items according to TIA
          <ns2:conjunction>And</ns2:conjunction>
          <ns2:upperCaseCompare>false</ns2:upperCaseCompare>
          <ns2:attribute>CtoTransactionAttr</ns2:attribute>
          <ns2:operator>Exists</ns2:operator>
          <ns2:nested>
            <ns2:group>
              <ns2:conjunction>And</ns2:conjunction>
              <ns2:upperCaseCompare>false</ns2:upperCaseCompare>
              <ns2:item>
                <ns2:conjunction>And</ns2:conjunction>
                <ns2:upperCaseCompare>false</ns2:upperCaseCompare>
                <ns2:attribute>AttributeName</ns2:attribute>
                <ns2:operator>=</ns2:operator>
                <ns2:value>SCO_Color</ns2:value>
              </ns2:item>
              <ns2:item>
                <ns2:conjunction>And</ns2:conjunction>
                <ns2:upperCaseCompare>false</ns2:upperCaseCompare>
                <ns2:attribute>CharacterAttributeValue</ns2:attribute>
                <ns2:operator>=</ns2:operator>
                <ns2:value>Black</ns2:value>
              </ns2:item>
            </ns2:group>
          </ns2:nested>
        </ns2:item>
      </ns2:group>
    </ns2:filter>
    <ns2:excludeAttribute />
  </ns1:findCriteria>
</ns1:findCtoItemStructure>

Here's the second call.

<?xml version="1.0" encoding="UTF-8"?>
<ns1:findCtoItemStructure xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/">
  <ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
    <ns2:fetchStart>0</ns2:fetchStart>
    -- start at index 0
    <ns2:fetchSize>-1</ns2:fetchSize>
    -- Indicates all the rows should be returned
    <ns2:filter>
      <ns2:conjunction>And</ns2:conjunction>
      <ns2:group>
        <ns2:conjunction>And</ns2:conjunction>
        <ns2:upperCaseCompare />
        <ns2:item>
          -- This block has to be repeated for all the configured items returned from the previous call
          <ns2:conjunction>And</ns2:conjunction>
          <ns2:upperCaseCompare />
          <ns2:attribute>ConfigItemNumber</ns2:attribute>
          -- Condition is Based on ConfigItemNumber
          <ns2:operator>=</ns2:operator>
          <ns2:value>VIK12*100</ns2:value>
          -- Configured Item Number returned from the previous call
        </ns2:item>
      </ns2:group>
      <ns2:nested />
    </ns2:filter>
    <ns2:excludeAttribute />
  </ns1:findCriteria>
</ns1:findCtoItemStructure>

Remove the Item Structure

Remove the structure of a configured item from the repository.

Here's a payload that removes the structure of all configured items that include VIK12 as the item number.

<?xml version="1.0" encoding="UTF-8"?>
<ns1:deleteConfigStructure xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/">
  <ns1:configList xmlns:ns2="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/">
    <ns2:BaseModelItemNumber>VIK12</ns2:BaseModelItemNumber>
  </ns1:configList>
</ns1:deleteConfigStructure>