The behavior of instance variables in Siebel scripting. (Doc ID 1489661.1)

Last updated on MARCH 02, 2017

Applies to:

Siebel Tools - Version 8.0.0.13 SIA [20448] and later
Information in this document applies to any platform.
Checked for Relevance on JUL-11-2016

Symptoms

From :  8.0.0.13 SIA [20448] version, Siebel VB / eScript / COM to 8.1.1.8 SIA

This is note from Product Manager.  (Express thanks  Kerry Macarthur.)
======================================================

Problem

This article describes the way that scriptable Siebel objects (Business Services and Business Components) with variables declared in their general declarations section are instantiated in scripts and handled by the object manager.

This article clearly illustrates the behavior of the methods GetService and GetBusComp and how object manager responds to these two methods in the case where the object has variables or script in its general declarations section.

Customer perceived behavior

When declaring a variable in the general declarations section of an object such as a business service so that the variable could be accessed from any method in the object you may assume that calling GetService on that method would do the following.

  1. Initialize the variables (This does happen.)
  2. Create a new and separate instance of the business service. (This does not always happen.)

         You may believe that every time script calls GetService or GetBusComp, it gets a new and separate instance of the object. This is not necessarily true. 

Actual existing behavior

 When calling GetBusComp or GetService a pointer to any existing instance in the object manager is returned and only if there is no existing instance of the object will the object manager return a new instance. 

GetBusComp has a caveat since it is called in the context of a business object. A business component can be a child of many business objects. When calling GetBusComp on the same parent business object the same instance of the business component is returned. When calling GetBusComp on different parent business objects a new instance of the business component is returned. 

For example:

 Results

10/15/12,12:02:07,START,8.1.1.9 [IB2012_25] LANG_INDEPENDENT,SADMIN,2040,2604

1. In general declarations section of TestGeneralDeclarations BS before A is declared and initialized. undefined

2. In general declarations section of TestGeneralDeclarations BS AFTER A is declared and initialized to 0. 0 

1. Service_PreInvokeMethod event of the CallTestGeneralDeclarations BS after instantiating the first instance of the BS A is expected to be zero and is: 0 

1. In setAToOne method of TestGeneralDeclarations BS before A is set to 1. A is: 0

2. In setAToOne method of TestGeneralDeclarations BS AFTER A is set to 1. A is: 1 

2. Service_PreInvokeMethod event of the CallTestGeneralDeclarations BS after calling the method to set A to one.  A is expected to be 1 and is: 1 

1. In general declarations section of TestGeneralDeclarations BS before A is declared and initialized. 1
     A is  in s
ame instance so 1 is the value before general declarations initialization.

2. In general declarations section of TestGeneralDeclarations BS AFTER A is declared and initialized to 0. 0

3. Service_PreInvokeMethod event of the CallTestGeneralDeclarations BS after instantiating the SECOND instance of the BS.  A is expected to be 0 and is: 0

4. Service_PreInvokeMethod event of the CallTestGeneralDeclarations BS looking back at the first instance of the BS. A is expected to be zero and is: 0 

1. In setAToOne method of TestGeneralDeclarations BS before A is set to 1. A is: 0

2. In setAToOne method of TestGeneralDeclarations BS AFTER A is set to 1. A is: 1 

5. Service_PreInvokeMethod event of the CallTestGeneralDeclarations BS after calling the method to set A to one on the second instance.  A is expected to be 1 and is: 1

6. Service_PreInvokeMethod event of the CallTestGeneralDeclarations BS looking back at the first instance of the BS. A is expected to be one and is: 1 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms