Siebel Advisor API Reference > Siebel-Specific Functions for Siebel Advisor >

SendSelectionInformationToServer


Usage

Use the SendSelectionInformationToServer function to post specified data to a business service and method.

NOTE:  To use this function, you need to write a business service and a method on that service.

You can use this function to create a variety of integration points with other applications as follows:

  • Create a new opportunity in Siebel Sales as a result of a web advisor session.
  • Store results of a session to a Business Component other than Quotes.
  • Call a string of Dynamic Defaults from a Business Component and open a pageset that displays them.
  • Pass an optional field promoCode (promotional code) to the method so that it will specially price the information based on that code.
  • Use a CDA Service Broker in the ISSCDA RT UI Service to:
    • Call another business service.
    • Accept information from a called business service.
    • Return a confirmation response to the client.
Syntax

SendSelectionInformationToServer(service, method, prodStr, enableLinkback, optArgs)

Argument
Description

service

Name of the Business Service to be executed.

method

Method to be used on the business service.

prodStr

Product string describing the product. Use null, without quotes around it, to specify that no product string should be sent. Use "auto" to automatically extract the product string. prodStr is added automatically when you choose to use it in the other arguments. Do not set it manually.

enableLinkback

Boolean value specifying whether to build a linkback string used for restoring state. If "true," constructs and passes the appropriate linkback string. If "false," takes no action. The linkback string gets added automatically when you choose to use it in the other arguments. It should not be set manually.

optArgs

Object including at least the following special fields: prodStr and linkBackStr. Any additional data should be included as fields in this object as a string or number. This data will be associated with the field name when sent to the method.

Example

To send the model and year of your car along with product and state information, call the function as follows:

var optArgs = new Object();
optArgs["carModel"] = "Sedan";
optArgs["Year"] = 99;
ISS.SendSelectionInformationToServer("myService", "myMethod", "auto", true, optArgs);

This call will automatically extract product information from the data model since auto is true. It will also create a linkback string for the current state of the pageset. The linkback string can then be used to open the pageset in this state.

Using the CDA Service Broker in the ISSCDA RT UI Service

You can call the CDAServiceBroker method in the ISSCDA RT UI Service to have the client receive a confirmation response after it posts a request to a business service using SendSelectionInformationToServer().

The CDA Service Broker in the ISSCDA RT UI business service acts as a broker to:

  • Call another business service
  • Accept information from that business service
  • Return a confirmation response back to the client

The following examples illustrate how to accomplish these tasks using the CDA Service Broker.

To invoke the CDA Service Broker, you must set the following parameters in the SendSelectionInformationToServer function:

Service="ISSCDA RT UI Service"

Method="CDAServiceBroker"

Example 1
CDANoReturn

Use this parameter when no confirmation is needed from the server business component.

argObj["CDAExternalServiceName"] = "My Business Service";

argObj["CDAExternalMethodName"] = "My Business Service Method";

argObj["CDANoReturn"]= "";

OL.SendSelectionInformationToServer("ISSCDA RT UI Service", "CDAServiceBroker", "auto", true, argObj);

Example 2
CDAReturnValue

This parameter requests the business service to select a value from the output property set and return it to the client.

argObj["CDAExternalServiceName"] = "My Business Service";

argObj["CDAExternalMethodName"] = "My Business Service Method";

argObj["CDAReturnValue"]= "ReturnName";

OL.SendSelectionInformationToServer("ISSCDA RT UI Service", "CDAServiceBroker", "auto", true, argObj);

In this example, the client specifies CDAReturnValue=ReturnName. After successful execution of the method, the client can retrieve the returned property value from ReturnName.

Example 3
CDAReturnHandler

If you need to retrieve the entire output property set from the server, you can build a property set handler for the client side. The name of the property set handler is passed to the server side to process the property set object. The ISSCDA RT UI Service reconstructs the property set into JavaScript objects and sends it back to the client.

argObj["CDAExternalServiceName"] = "My Business Service";

argObj["CDAExternalMethodName"] = "My Business Service Method";

argObj["CDAReturnHandler"]= OL.FrameToString(window)+'.alertEvent');

OL.SendSelectionInformationToServer("ISSCDA RT UI Service", "CDAServiceBroker", "auto", true, argObj);

function alertEvent(ps)

{

  if (ps != null)

  {

      for (bFirst = true; (arg = ps.EnumProperties (bFirst)) != null; bFirst = false)

      {

           value = ps.GetProperty (arg);

           alert(arg + "=" + value);

       }

   }

   else

   {

     alert("Empty PropertySet in function alertEvent");

   }

} </script>

NOTE:  The JavaScript object constructed from the server side code uses the constructor (which resides in the propset.js) in the SWE script. Be sure to include this script in the file where the property set handler is in your JavaScript.

Example 4
Null value

If you use a null value for optArgs, the CDA Service Broker retrieves the default property set name from the repository. The default name is defined in the Siebel repository under the ReturnPropertyName in the user property of the business service CDA RT UI Service. The CDA Service Broker calls the specified business service using the default property set name. If the default property set name in the specified business service exists in the return output property set, it will be returned to the client.

argObj["CDAExternalServiceName"] = "My Business Service";

argObj["CDAExternalMethodName"] = "My Business Service Method";

OL.SendSelectionInformationToServer("ISSCDA RT UI Service", "CDAServiceBroker", "auto", true);

Siebel Advisor API Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.