Siebel Object Interfaces Reference > Siebel Object Interfaces Reference > Object Interfaces Reference >

Business Service Events


This topic describes business service events. It includes the following topics:

Service_InvokeMethod Event

Siebel CRM calls the Service_InvokeMethod event after it calls the InvokeMethod method on a business service. This event does not return any information. For more information, see Service_PreInvokeMethod Event.

Server Script Format

Service_InvokeMethod(MethodName, InputArguments, OutputArguments)

The arguments you can use in this format are the same as the arguments that are described in Table 84.

Browser Script Format

OutputArguments=oService.InvokeMethod(methodName, InputArguments)

Table 88 describes the arguments for the Browser Script format of the Service_InvokeMethod Event

Table 88. Arguments for the Browser Script Format of the Service_InvokeMethod Event
Argument
Description

methodName

A string that contains the name of the method that Siebel CRM must run.

InputArguments

A property set that identifies the arguments that the method uses as input.

In Browser Script, you cannot use an output property set for this format.

Usage

You can use this event in the following ways:

  • In Server Script. It can add properties to or modify values of the properties in the property set that the OutputArguments argument identifies.
  • In Browser Script. It cannot modify, store, or update the values of the properties in the output property set.

If you call a business service method through Browser Script, then the business service that this method calls can use a browser or the Siebel Server. For high interactivity mode, Siebel CRM determines if the business service resides in the browser. If the business service does not reside in the browser, then it sends the request to the Siebel Server.

Browser Script can call a business service on the browser or the Siebel Server. Server Script can call only a business service on the Siebel Server.

Used With

Browser Script, Server Script

Examples

To handle transactions that are not approved, the following example in Siebel eScript adds custom logic to the predefined Credit Card Transaction Service business service:

function Service_InvokeMethod (MethodName, Inputs, Outputs)

if (Outputs.GetProperty("SiebelResponseMessage") != "Approved")

{

// special handling for failed transactions here

}

Service_PreCanInvokeMethod Event

Siebel CRM calls the Service_PreCanInvokeMethod event before it calls the PreInvokeMethod event. This configuration allows you to determine if the user possesses the authority to call a business service method. This method returns CancelOperation or ContinueOperation. For more information, see Caution About Using the Cancel Operation Event Handler.

Server Script Format

Service_PreCanInvokeMethod(MethodName, &CanInvoke)

Table 89 describes the arguments for the Server Script format of the Service_PreCanInvokeMethod event.

Table 89. Arguments for the Server Script Format of the Service_PreCanInvokeMethod Event
Argument
Description

MethodName

A string that contains the name of the method that Siebel CRM must run.

&CanInvoke

A string that indicates if Siebel CRM can call the business service method. You can use one of the following values:

  • TRUE. Siebel CRM can call the business service method.
  • FALSE. Siebel CRM cannot call the business service method.
Browser Script Format

Service_PreCanInvokeMethod(MethodName)

The arguments you can use with this format are the same as the arguments described in Table 26.

Used With

Browser Script, Server Script

Service_PreInvokeMethod Event

Siebel CRM calls the Service_PreInvokeMethod event before it calls a specialized method on a business service. For more information, see About Specialized and Custom Methods and Service_InvokeMethod Event.

This method returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler.

Server Script Format

Service_PreInvokeMethod(MethodName, InputArguments, OutputArguments)

The arguments you can use in this format are the same as the arguments that are described in Table 84.

Browser Script Format

Service_PreInvokeMethod(name, inputPropSet)

The arguments you can use in this format are the same as the arguments that are described in Table 25.

Usage with Server Script

Siebel CRM uses the Server Script version of the Service_PreInvokeMethod event to perform the following work:

  • Performing business logic
  • Setting an output in the output property set
  • If you use a custom business service, then returning CancelOperation
Usage with Browser Script

Siebel CRM uses the Browser Script version of the Service_PreInvokeMethod event to perform the following work:

  • Performing a user interaction, such as asking for input data.
  • Setting an input property.
  • Canceling a user operation. For example, prompting the user to confirm a record deletion.

The Browser Script version is not intended to perform business logic. It does not return an output property set.

How Siebel CRM Handles a Predefined Business Service Method

Figure 6 illustrates how Siebel CRM handles a predefined business service method.

Figure 6. Handling for a Predefined Business Service Method

With a predefined business service method, the script can do the following:

  1. Call the Business Service Method.
  2. In the Service_PreInvokeMethod event, process the Method and perform any necessary custom work before it runs the C++ code.
  3. When the C++ code runs, it sets values in the outputs that the service code defines.
  4. If the C++ code runs successfully, then the Service_InvokeMethod event can inspect and modify the output, or perform other tasks depending on the successful completion of the C++ code. At this point, the calling function takes control of the script flow.
How Siebel CRM Handles a Custom Business Service Method

Figure 7 illustrates how Siebel CRM handles a custom business service method.

Figure 7. Handling for a Custom Business Service Method

With a custom business service method, the script can do the following:

  1. Call the Business Service Method.
  2. In the Service_PreInvokeMethod event, process the method and take any necessary custom actions.
  3. The script must return CancelOperation. This operation configures Siebel CRM to cancel the remaining operations that it associates with the event. If Siebel CRM does not cancel the remaining operations, then the flow continues to the C++ code.
  4. this C++ code cannot handle the custom method, so it issues an error that is similar to the following error message:

    Unknown method name

  5. Siebel CRM cancels the call to the method, so it does not run the Service_InvokeMethod event.

For more information, see Caution About Using the Cancel Operation Event Handler.

Used With

Browser Script, Server Script

Examples

The following Siebel VB example sets properties in the custom Shipping Engine business service:

Function Service_PreInvokeMethod (MethodName As String, Inputs As PropertySet, Outputs As PropertySet) As Integer

   If MethodName = "CalculateShipping" Then

      Dim sShipper As String, sShipMethod As String
      Dim dWeight As Double, dSize As Double, dCost As Double
      Dim sZone As String, DelDate As Variant
      Dim sCost As String, iReturn As Integer

      iReturn = ContinueOperation
      sShipper = Inputs.GetProperty("Shipping Company")
      sShipMethod = Inputs.GetProperty("Ship Method")
      dWeight = Val(Inputs.GetProperty("Weight"))
      dSize = Val(Inputs.GetProperty("Volume"))
      iZone = Val(Inputs.GetProperty("Zone"))
      DelDate = DateValue(Now)

      Select Case sShipper
         Case "GlobalEx"
            Select Case sShipMethod
               Case "Next-Day Air"
                  dCost = 14 + dWeight
                  DelDate = DelDate + 1
               Case "Second-Day Air"
                  dCost = 11 + (dWeight * .54)
                  DelDate = DelDate + 2
            End Select

         Case "Airline"
            Select Case sShipMethod
               Case "Next-Day Air"
                  dCost = 5 + (dWeight * .3) + (dSize * .33) + _
                     (Val(sZone) * .5)
                  DelDate = DelDate + 1
               Case "Second-Day Air"
                   dCost = 4 + (dWeight * .3) + (dSize * .2) + _
                     (Val(sZone) * .3)
                  DelDate = DelDate + 2      

               Case "Ground"
                  dCost = 3 + (dWeight * .18) + (dSize * .1) + _
                     (Val(sZone) * .1)
                  DelDate = DelDate + 2 + Int(Val(sZone) * .8)
            End Select
      End Select

      sCost = Format(dCost, "Currency")
      Outputs.SetProperty "Cost", sCost
      Outputs.SetProperty "Delivery Date", DelDate
      iReturn = CancelOperation

   End If

   Service_PreInvokeMethod = iReturn

End Function

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