Using Requests

This chapter describes requests, which are programmatic attempts to modify a configuration.

This chapter covers the following topics:

About Requests

A request is an attempt to modify a configuration by setting the logical state or numeric value of a node in the configuration Model (such as an Option or BOM Item). The table Methods Typically Used to Make Requests lists some methods of this type:

Methods Typically Used to Make Requests
Method Described In ...
IState.setState() Getting and Setting Logic States
ICount.setCount() Getting and Setting Numeric Values
IOPtion.select() Access to Options

Getting Information about Requests

The class oracle.apps.cz.cio.Request exposes logic requests. A Request object can be used to represent several kinds of requests.

The Request object provides a set of methods for determining the value of the request, and the runtime node on which the request has been made:

The Request object also provides a set of methods for determining the type of the request. These methods are listed in the table Type Methods of the Class Request. (In the value column, the test for the value of the request is case-sensitive.)

Type Methods of the Class Request
This returns TRUE if ... ... the request made was for ... The value of the request is ...
isNumericRequest() changing the numeric value of a runtime node a Number
isStateRequest() changing the state of a runtime node True, False, Toggle, Tnknown
isTrueStateRequest() changing the state of a runtime node to True True
isFalseStateRequest() changing the state of a runtime node to False False
isToggleStateRequest() toggling the state of a runtime node Toggle
isUnknownStateRequest() unsetting the state of a runtime node Unknown

User Requests

You can obtain a list of the Request objects that represent all current user requests in the system, by using the method Configuration.getUserRequests() in your Configurator Extension.

...
IRuntimeNode node = getRuntimeNode();
Configuration config = node.getConfiguration();
List requests = config.getUserRequests();
Iterator it = requests.iterator();
while (it.hasNext()) {
  Request req = (Request)it.next();
  IRuntimeNode node = req.getRuntimeNode();
  String value = req.getValue();
}
...

Nonoverridable Requests

You can specify a set of logic requests to be applied to a configuration at any time that have a higher priority than user requests. Such requests are called nonoverridable requests.

You apply nonoverridable requests automatically on the creation of a configuration, following the practice illustrated in Using Nonoverridable Requests and in the following steps:

  1. Begin a configuration transaction, using Configuration.beginConfigTransaction().

    ConfigTransaction tr = config.beginConfigTransaction();

    See Using Logic Transactions for details about transactions.

  2. Specify that the transaction contains nonoverridable requests, using ConfigTransaction.useNonOverridableRequests().

    tr.useNonOverridableRequests();
  3. Specify the desired user requests using the appropriate methods.

    BooleanFeature feat = (BooleanFeature)node.getChildByName("Feature_1234");
    feat.setState(IState.TRUE);

    See User Requests for details about setting logic requests.

  4. When you have set all the desired nonoverridable requests, commit the logic transaction.

    config.commitConfigTransaction(tr);

These steps are combined in Using Nonoverridable Requests. For a fuller example of using nonoverridable requests, see Setting Nonoverridable Requests.

Using Nonoverridable Requests

...
      ConfigTransaction tr = config.beginConfigTransaction();
      tr.useNonOverridableRequests();
      BooleanFeature feat = (BooleanFeature)node.getChildByName("Feature_1234");
      feat.setState(IState.TRUE);
      config.commitConfigTransaction(tr);
...

Usage Notes on Nonoverridable Requests

Limitations on Nonoverridable Requests

Failed Requests

When you use LogicalOverridableException.override() to override a logical contradiction (see Overriding Contradictions), the override() method returns a List of Request objects. These Request objects represent all the previously asserted user requests that failed due to the override that you are performing.

See Getting a List of Failed Requests for an example.