Handling the Polymorphic Behavior of Oracle RightNow Cx Schema

Oracle Cloud Connect Web Services for SOAP defines a number of operations which either accept or return one or more instances of RNObject (which is the Base class for all primary RightNow object classes).

This feature enables the same operations to behave in a polymorphic manner, in which the input and return values can be any instance of a derived class of RNObject.

This feature accomplishes this behavior by passing in subclass instances from program language bindings, and also through the use of the xsi:type attribute in the serialized XML for the object. The xsi:type specifies the concrete type that is being substituted in the element with the type RNObject. This behavior enables developers working with Oracle Cloud Connect Web Services for SOAP to work with any type of object that inherits from the base class, RNObject and to pass this object into any operation that expects an instance of RNObject. In addition, developers can cast returned instances of RNObject to the appropriate subclass. For more information on polymorphic behavior, see Oracle Service Cloud Connect Web Services for SOAP.

Due to this polymorphic nature, mapping from source object to target object user experience is somewhat complex for standard objects that inherit RNObject. For custom objects and custom attributes, it is more complex.

The Oracle RightNow adapter elevates the element definitions as first-class citizens for standard objects, custom objects and custom fields, reducing the number of steps you must perform to create complex transformations and simplifying your experience mapping source to target definitions.

Example: Mapping A Custom Object

Following is a sample of a mapping experience of a custom object with and without Oracle RightNow adapter. The example might not be typical, but it helps you understand the mapping experience and the differences between doing so with and without the Oracle RightNow adapter.

One example shows mapping an Oracle RightNow custom object without using an Oracle RightNow adapter. The second example shows the same mapping, the difference being that the second example is greatly simplified; the adapter simplifies the process.

Example: Mapping an Object without Using an Oracle RightNow Adapter

This section provides information about creating a custom object instance without using the Oracle RightNow adapter. In this scenario, you create a SOA Composite and use the Web Service adapter to create a client for RightNow Service. The steps follow that are required when you create a data mapping using XSLT mapper from a client source schema to a custom object schema.

See Figure 4-1.

  1. In the XSLT editor, on the target schema node RNObject, right-click and select Substitution Type or Element then choose Generic Object.
  2. Set Object ObjectType->TypeName: Value of the RightNow CustomObject Name created in RightNow.
  3. Set GenericFields->dataType: Data type value of the custom attribute. for example, STRING, or INTEGER.
  4. Set GenericFields->name: name of the custom attribute.
  5. Set GenericFields->DataValue->StringValue: Value of the attribute.

Figure 4-1 Using XSLT Mapper to Map a RightNow Custom Object for the Schema without Using the Oracle RightNow Adapter-Generated WSDL



The source view is:

Figure 4-2 Sample XSL File in Source Mode

Description of Figure 4-2 follows
Description of "Figure 4-2 Sample XSL File in Source Mode"

Example: Mapping an Object with the Oracle RightNow Adapter

This section provides information about creating a custom object instance with the Oracle RightNow adapter. You create a SOA Composite and use the Web Service adapter to create a client for an integration-friendly Oracle RightNow adapter-generated WSDL.

Use the following steps to create the data mapping using the XSLT mapper from a client source schema to a custom object schema (the schema is strongly typed and referred from the integration-friendly WSDL generated by the Oracle RightNow adapter). The custom object is a first class entity in generated Local WSDL Map the fields directly in the mapper as shown below.