Guidelines for Testing Your Model

To efficiently test a large number of models, you can use the Configurator Runtime Model Test service to execute model tests without requiring user input.

The Configurator Runtime Model Test service is implemented as a SOAP web service based on a request and response payload structure. In this service model, a calling application provides an input test model XML payload to the testModel public synchronized method of the Configurator Runtime Model Test service, then after executing the requests, the service returns a corresponding result XML payload which the calling application can introspect for the result of the requests.

Features of the test service include:

  • Calling applications can launch the Configurator Runtime Model Test service using any SOAP client. The SSL port is enabled by default for this web service, because it's an external service and will be the default transport for interacting with the web service in the cloud.

  • Calling applications can submit model test service requests to the synchronized method testModel in a serialized fashion, one request at a time.

  • The Configurator Runtime Model Test service can be used in concert with other services or embedded within other applications or services.

The Configurator Runtime Model Test service's input and output payloads use a SOAP XML structure.

The Configurator Runtime Model Test service has been implemented as an autonomous service and doesn't require any other external data model entities. The service WSDL can be retrieved using the following URL format:

https://<hostname>:<port>/fscmRestApi/ConfiguratorRuntimeService?wsdl

This service supports only one synchronized method, testModel, which has a specific request and response payload structure.

The testModel method requires a request input payload which includes the necessary information to:

  • Start or restore a configuration

  • Perform operations on that configuration

  • Query the configuration for attributes

  • Save and request a configuration summary

The testModel method subsequently returns a response output payload which includes:

  • The result of the overall test

  • Each individual operation requests

  • Query requests

  • Configuration summary requests

Test Model Request Structure

The following code example shows a test model request in SOAP XML:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ns1:testModel xmlns:ns1="http://xmlns.oracle.com/apps/scm/configurator/runtimeService/types/">
      <ns1:request xmlns:ns2="http://xmlns.oracle.com/apps/scm/configurator/runtimeService/">
        <ns2:TestId>1</ns2:TestId>
        <ns2:TestName>test</ns2:TestName>
        <ns2:TestDescription>Test1</ns2:TestDescription>
        <ns2:InitializationParameters>
          <ns2:TestId>1</ns2:TestId>
          <ns2:ParameterId>1</ns2:ParameterId>
          <ns2:CallingApplicationCode>CZ</ns2:CallingApplicationCode>
          <ns2:Header>
            <![CDATA[
              <header>
                <HeaderId>1000</HeaderId>
              </header>
            ]] >
          </ns2:Header>
          <ns2:Line>
            <![CDATA[
              <line>
                <LineId>-22222</LineId>
                <InventoryItemNumber>zCZ-CN82441</InventoryItemNumber>
                <InventoryOrganizationCode>V1</InventoryOrganizationCode>
                <UnitQuantity>1.0</UnitQuantity>
                <UomCode>Ea</UomCode>
              </line>
            ]] >
          </ns2:Line>
          <ns2:CustomParameters>
            <![CDATA[
              <param>
                <WorkspaceName>My Workspace</WorkspaceName>
                <SnapshotBasedModel>true</SnapshotBasedModel>
              </param>
            ]] >
         </ns2:CustomParameters>
        </ns2:InitializationParameters>
        <ns2:OperationRequest>
          <ns2:OperationId>1</ns2:OperationId>
          <ns2:NodePath>zCZ-OC12100.zCZ-CM12240</ns2:NodePath>
          <ns2:Operation>Select</ns2:Operation>
          <ns2:SequenceNumber>1</ns2:SequenceNumber>
          <ns2:testId>1</ns2:testId>
          <ns2:NodeValue>1</ns2:NodeValue>
        </ns2:OperationRequest>
        <ns2:QueryRequest>
          <ns2:QueryId>1</ns2:QueryId>
          <ns2:NodePath>zCZ-OC12100.zCZ-CM12240</ns2:NodePath>
          <ns2:SequenceNumber>2</ns2:SequenceNumber>
          <ns2:testId>1</ns2:testId>
          <ns2:NodeProperty>
            <ns2:PropertyId>1</ns2:PropertyId>
            <ns2:PropertyName>Selected</ns2:PropertyName>
            <ns2:QueryId>1</ns2:QueryId>
          </ns2:NodeProperty>
        </ns2:QueryRequest>
        <ns2:ConfigSummaryRequest>
          <ns2:SummaryId>1</ns2:SummaryId>
          <ns2:TestId>1</ns2:TestId>
          <ns2:OutputMode></ns2:OutputMode>
          <ns2:SequenceNumber>3</ns2:SequenceNumber>
        </ns2:ConfigSummaryRequest>
      </ns1:request>
    </ns1:testModel>
  </soap:Body>
</soap:Envelope>

The basic structure of a test model request includes the elements described in the following table:

Element of the testModel Request

Description

TestId

The unique identifier for the current test.

The same test ID is also used in other elements of the test request to connect them with a given test.

TestName

A short name for this test

TestDescription

An optional description for this test

InitializationParameters

Includes all the information necessary to start a configuration session

OperationRequest

One or more operations to be performed during this test

QueryRequest

One or more queries to be performed after an operation request has been performed

ConfigSummaryRequest

The configuration summary which includes all the items that you can include for the configuration

InitializationParameters

InitializationParameters is an XML element that models an attribute of the test model request.

InitializationParameters is a required attribute that includes the necessary information to start or restore a configuration session. The following table lists the initialization parameters, both necessary and optional, to start a configuration.

Field name in InitializationParameters

Description

TestId

The unique identifier for the current test.

ParameterId

A unique identifier provided by the service to refer to this initialization parameters set

CallingApplicationCode

Indicates the calling application launching the Configurator session. This is used to determine the user interface to use for the session. This code is registered in the Manage Trading Community Source Systems in the case of external non-Oracle system or the FND Application short name (code) for Oracle Applications. Note: For CPQ there is already a seeded TCA data with application code as ORA_BM_CPQ

Line

An XML document representing a line to be configured. See the following section for additional information

Header

(Optional) Represents a quote or order header that contains the Line. This XML document is optional and when present Configurator passes the header information to other services like Oracle Pricing for pricing integration within a configuration session

CustomParameters

(Optional) A XML document consisting of additional information to Configurator for use within Configurator Extensions rules

The XML document Line represents a line to be configured. It contains, at a minimum, the information in the following list.

  • LineId: Unique identifier for the line being configured

  • InventoryItemNumber: Item number of the product or service model item to configure

  • InventoryOrganizationCode: Item validation organization code of the product or service model item. This is typically the organization from which items are imported or referenced from external applications.

  • UnitQuantity: Quantity of the item being configured

  • UomCode: Unit of measure for the item being configured

  • ConfigHeaderId: Identifier for the configuration, passed only during reconfiguration, or a session for restoring and validating

  • ConfigRevisionId: Identifier for the configuration, passed only during reconfiguration/restore and validation session

  • RequestOn (Optional): Date and time used to load the model definition for the configuration session

OperationRequest

OperationRequest is an XML element that models an attribute of the test model request.

After a configuration has started, you can perform a series of operations using the test service, similar to the operations that an end user can perform when configuring the model using a runtime user interface. A test model request can have one or more operation requests. These operations can range from toggling a Boolean feature, to setting the quantity of a standard item, to adding an instance of a referenced model and configuring it.

The following table lists the attributes of an OperationRequest.

Field name in OperationRequest

Description

TestId

The unique identifier for the current test.

OperationId

A unique identifier for the operation request

NodePath

The fully qualified path to the node on which the operation will act on

Operation

The name of the operation, such as. Select, Toggle, SetValue, or SetQuantity. See the following table for valid operations.

SequenceNumber

The sequence number to be used during the execution to prioritize this request

NodeValue

The value to be applied to the node for this test.

The following table lists the operations that you can perform within an OperationRequest, and the node types that you can perform the operations on.

Valid Operations for OperationRequest

Node Type

Select, Toggle, SetQuantity

Option Class, Option Feature, Standard Item, or Option

Toggle

Boolean Feature

SetValue

Text Feature, Integer Feature, Decimal Feature, or Transactional Attribute (All types)

AddInstance, AddInstanceWithQuanity, AddInstanceWithQuanityAndName, RenameInstance, CopyInstance, DeleteInstance, SetQuanity, SetContextPath

Model Node Reference

The operations that can be performed at the configuration level include those in the following list.

  • AutoComplete: Performs an autocomplete operation on the configuration, to include all the adjustments needed to make the configuration valid.

  • UndoAutoComplete: Reverts the autocomplete operation.

  • AdjustConfiguration: Puts the configuration into adjust mode after autocomplete, allowing changes to the automatically completed selections.

  • Save: Saves the configuration and produces a header and revision ID.

  • Finish: Finishes the configuration, by saving and closing it.

QueryRequest

QueryRequest is an XML element that models an attribute of the test model request.

In order to determine the result of an operation request, you can perform a series of query requests to introspect the node on which the operation request acted, or any other node in the model hierarchy that was changed as a result. For example, if you toggle a Boolean feature using an operation request and subsequently a rule causes a standard item to be selected, then you can add a query request to retrieve the state of that standard item.

The following table lists the fields in a QueryRequest.

Field Name in QueryRequest

Description

TestId

The unique identifier for the current test.

QueryRequestId

A unique identifier for the query request in the test

NodePath

The fully qualified path to the node on which the query operation will act

SequenceNumber

The sequence number to be used during the execution to prioritize this request

NodeProperty

The property of the node returned in the result payload. See the following table for additional information.

Each query request can include one or many node properties to be retrieved. These node properties can be of either scalar type, such as a string or number value, or a collection or list type, in which the result of the query request will return a list of values. For example, in order to determine the selection state of a standard item, the node property named Selected can be requested through a NodeProperty, as illustrated in the following example.

<ns2:NodeProperty>
<ns2:PropertyId>1</ns2:PropertyId>
<ns2:PropertyName>Selected</ns2:PropertyName>
    <ns2:QueryId>1</ns2:QueryId>
</ns2:NodeProperty>

The following table lists the fields in a NodeProperty request.

Field Name in NodeProperty

Description

PropertyId

A unique identifier for the property in the request

PropertyName

The name of the node property to be evaluated. Refer to the list of node properties for the properties supported for each node type.

QueryId

A unique identifier for the query request

CollectionProperty

A list of property requests if the named property being evaluated is a list or a collection type (such as AvailableChildren, SelectedChildren, or SelectableChildren). See the following description of CollectionProperty for additional information

Similar to the way that you select node properties, you request the scalar properties of a list or collection node property type, by adding the property name to the CollectionProperty element's list of properties, as illustrated in the following example.


<ns2:NodeProperty> 
    <ns2:PropertyId>1</ns2:PropertyId> 
    <ns2:PropertyName>SelectedChildren</ns2:PropertyName> 
    <ns2:QueryId>1</ns2:QueryId>
    <ns2:CollectionProperty>
        <ns2:PropertyId>1</ns2:propertyId>
        <ns2:CollectionPropertyId>1</ns2:CollectionPropertyId>
        <ns2:PropertyName>Name</ns2:PropertyName>
    </ns2:CollectionProperty> 
    <ns2:CollectionProperty>
        <ns2:PropertyId>1</ns2:propertyId>
        <ns2:CollectionPropertyId>2</ns2:CollectionPropertyId>
        <ns2:PropertyName>Description</ns2:PropertyName>
    </ns2:CollectionProperty> 
</ns2:NodeProperty>

The following table lists the elements that identify a CollectionProperty.

Field Name in CollectionProperty

Description

PropertyId

The unique identifier for the property name of the collection node property to be evaluated.

PropertyName

A property name from the collection node property to be evaluated

CollectionPropertyId

A unique identifier for the collection node property

ConfigSummaryRequest

ConfigSummaryRequest is an XML element that models an attribute of the test model request.

A test model request can include an optional request to retrieve the configuration summary. The configuration summary can be either brief or full, as controlled by the output mode.

The following table lists the fields of the ConfigSummaryRequest element.

Field Name in ConfigSummaryRequest

Description

TestId

The unique identifier for the current test.

SummaryId

A unique identifier for the summary request

OutputMode

The configuration summary output mode. The allowed values are:

  • Brief: Include only configuration-level information such as the validity of the configuration, and the header ID and revision ID of the configuration object.

  • Full (the default): Include the brief output and also all of the items that you can include in the configuration.

SequenceNumber

The sequence number to be used during the execution to prioritize this request

Test Model Response Structure

The model test response payload structure directly corresponds to the test model request payload. For every operation or query request there is a corresponding operation or query result that can be correlated to its request counterpart using the unique operation or query ID.

The test model response includes test level information such as the overall test status and any failure messages that prevented the configuration from starting. This level of information is also available at each operation or query result, which allows for introspection of the results at a much more granular level.

The following code example shows a test model response in SOAP XML:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
              xmlns:wsa="http://www.w3.org/2005/08/addressing">
 <env:Header>
...
</env:Header>
<env:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
           wsu:Id="Body-WCk1o7Bv0d7m0fziDdW7lQ22">
  <ns0:testModelResponse xmlns:ns0="http://xmlns.oracle.com/apps/scm/configurator/runtimeService/types/">
   <ns1:result xmlns:ns0="http://xmlns.oracle.com/apps/scm/configurator/runtimeService/"
               xmlns:ns1="http://xmlns.oracle.com/apps/scm/configurator/runtimeService/types/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:type="ns0:TestModelResponse">
    <ns0:TestId>1</ns0:TestId>
    <ns0:TestName>test</ns0:TestName>
    <ns0:TestDescription>Test1</ns0:TestDescription>
    <ns0:TestStatus>SUCCESS</ns0:TestStatus>
    <ns0:TestFailureMessage xsi:nil="true"/>
    <ns0:OperationResult>
     <ns0:OperationId>1</ns0:OperationId>
     <ns0:NodePath>zCZ-OC12100.zCZ-CM12240</ns0:NodePath>
     <ns0:Operation>Select</ns0:Operation>
     <ns0:SequenceNumber>1</ns0:SequenceNumber>
     <ns0:NodeValue>1</ns0:NodeValue>
     <ns0:OperationStatus>SUCCESS</ns0:OperationStatus>
     <ns0:OperationFailureMessage xsi:nil="true"/>
     <ns0:TestId>1</ns0:TestId>
     <ns0:ContextPath xsi:nil="true"/>
    </ns0:OperationResult>
    <ns0:QueryResult>
     <ns0:QueryId>1</ns0:QueryId>
     <ns0:NodePath>zCZ-OC12100.zCZ-CM12240</ns0:NodePath>
     <ns0:QueryResultStatus>SUCCESS</ns0:QueryResultStatus>
     <ns0:QueryResultFailureMessage xsi:nil="true"/>
     <ns0:TestId>1</ns0:TestId>
     <ns0:SequenceNumber>2</ns0:SequenceNumber>
     <ns0:ContextPath xsi:nil="true"/>
     <ns0:NodeProperty>
      <ns0:PropertyId>1</ns0:PropertyId>
      <ns0:PropertyName>Selected</ns0:PropertyName>
      <ns0:PropertyValue>true</ns0:PropertyValue>
      <ns0:QueryId>1</ns0:QueryId>
      <ns0:PropertyResultStatus>SUCCESS</ns0:PropertyResultStatus>
      <ns0:PropertyResultFailureMessage xsi:nil="true"/>
     </ns0:NodeProperty>
    </ns0:QueryResult>
    <ns0:ConfigSummaryResult xmlns:ns1="http://xmlns.oracle.com/adf/svc/types/">
     <ns0:SummaryId>1</ns0:SummaryId>
     <ns0:TestId>1</ns0:TestId>
     <ns0:ConfigHeaderId xsi:nil="true"/>
     <ns0:ConfigRevisionId xsi:nil="true"/>
     <ns0:ValidConfigurationFlag>false</ns0:ValidConfigurationFlag>
     <ns0:SequenceNumber>3</ns0:SequenceNumber>
     <ns0:RequestOn>2016-12-30</ns0:RequestOn>
     <ns0:ConfigLine>
      <ns0:LineId>1</ns0:LineId>
      <ns0:ParentLineId xsi:nil="true"/>
      <ns0:InventoryItemId>300100017155319</ns0:InventoryItemId>
      <ns0:InventoryOrganizationId>204</ns0:InventoryOrganizationId>
      <ns0:InventoryItemType>1</ns0:InventoryItemType>
      <ns0:LineQuantity xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/"
                        unitCode="Ea">1</ns0:LineQuantity>
      <ns0:UOMCode>Ea</ns0:UOMCode>
      <ns0:ConfiguratorPath>300100017155319</ns0:ConfiguratorPath>
      <ns0:SummaryId>1</ns0:SummaryId>
      <ns0:InventoryItemNumber>zCZ-CN82441</ns0:InventoryItemNumber>
      <ns0:InventoryOrganizationCode>V1</ns0:InventoryOrganizationCode>
      <ns0:UnitQuantity xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/"
                        unitCode="Ea">1</ns0:UnitQuantity>
     </ns0:ConfigLine>
     <ns0:ConfigLine>
      <ns0:LineId>2</ns0:LineId>
      <ns0:ParentLineId>1</ns0:ParentLineId>
      <ns0:InventoryItemId>300100017233297</ns0:InventoryItemId>
      <ns0:InventoryOrganizationId>204</ns0:InventoryOrganizationId>
      <ns0:InventoryItemType>2</ns0:InventoryItemType>
      <ns0:LineQuantity xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/"
                        unitCode="Ea">1</ns0:LineQuantity>
      <ns0:UOMCode>Ea</ns0:UOMCode>
      <ns0:ConfiguratorPath>300100017155319.300100017233297</ns0:ConfiguratorPath>
      <ns0:SummaryId>1</ns0:SummaryId>
      <ns0:InventoryItemNumber>zCZ-OC12100</ns0:InventoryItemNumber>
      <ns0:InventoryOrganizationCode>V1</ns0:InventoryOrganizationCode>
      <ns0:UnitQuantity xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/"
                        unitCode="Ea">1</ns0:UnitQuantity>
     </ns0:ConfigLine>
     <ns0:ConfigLine>
      <ns0:LineId>3</ns0:LineId>
      <ns0:ParentLineId>2</ns0:ParentLineId>
      <ns0:InventoryItemId>300100017232813</ns0:InventoryItemId>
      <ns0:InventoryOrganizationId>204</ns0:InventoryOrganizationId>
      <ns0:InventoryItemType>4</ns0:InventoryItemType>
      <ns0:LineQuantity xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/"
                        unitCode="Ea">1</ns0:LineQuantity>
      <ns0:UOMCode>Ea</ns0:UOMCode>
      <ns0:ConfiguratorPath>300100017155319.300100017233297.300100017232813</ns0:ConfiguratorPath>
      <ns0:SummaryId>1</ns0:SummaryId>
      <ns0:InventoryItemNumber>zCZ-CM12240</ns0:InventoryItemNumber>
      <ns0:InventoryOrganizationCode>V1</ns0:InventoryOrganizationCode>
      <ns0:UnitQuantity xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/"
                        unitCode="Ea">1</ns0:UnitQuantity>
     </ns0:ConfigLine>
    </ns0:ConfigSummaryResult>
   </ns1:result>
  </ns0:testModelResponse>
 </env:Body>
</env:Envelope>