Configuring Siebel Business Applications > Configuring Special-Purpose Applets > Configuring a Hierarchical List Applet >

Configuring a Hierarchical List Applet to Use External Data


This topic describes how to configure a hierarchical list applet to use external data. To develop this example, do the following tasks:

  1. Creating the Virtual Business Component
  2. Creating the Business Service for the Hierarchical List Applet
  3. Implementing the Customization

You can configure a hierarchical list applet to get external data from a virtual business component. A hierarchical list applet does not require special configuration on a business component other than a properly set Hierarchy Parent Field property. More configuration is required for a virtual business component.

Creating the Virtual Business Component

You start by creating the virtual business component.

To create the virtual business component

  1. In the Object Explorer, click Business Component.
  2. In the Business Components list, create a new business component using values from the following table.
    Property
    Value

    Hierarchy Parent Field

    Id

  3. In Business Components list, right-click the record you created in Step 2, and then click Edit Server Scripts.
  4. In the Scripting Language dialog box, choose eScript, and then click OK.
  5. In the BusComp Script window, expand the BusComp tree, and then click BusComp_PreInvokeMethod.
  6. In the script editing window, remove the existing script, and then enter the following script:

    function BusComp_PreInvokeMethod (MethodName)
    {
    TheApplication().Trace(this.Name() + ".PreInvoke." + MethodName + "()");
    return (ContinueOperation);
    }

  7. In the BusComp tree, click BusComp_InvokeMethod, remove the existing script, and then enter the following script:

    function BusComp_InvokeMethod (MethodName)
    {
    TheApplication().Trace(this.Name() + ".Invoke." + MethodName + "()");
    }

  8. In the Object Explorer, expand the Business Components tree, and then click Field.
  9. In the Fields list, add fields to your virtual business component using values from the following table.
    Name
    Type

    Has Children

    DTYPE_BOOL

    Is Expanded

    DTYPE_BOOL

    Last Child Info

    DTYPE_TEXT

    Outline Number

    DTYPE_TEXT

Creating the Business Service for the Hierarchical List Applet

In this topic, you create the business service for the hierarchical list applet.

To create the business service for the hierarchical list applet

  1. Display the Business Service Server Script object type.

    The business service server script is a child of the business service. For more information, see Displaying Object Types You Use to Configure Siebel CRM.

  2. In the Object Explorer, click Business Service.
  3. In the Business Services list, add a new business service using values from the following table.
    Property
    Value

    Name

    Hierarchical List Service

    Server Enabled

    Check mark

  4. In the Object Explorer, expand the Business Service tree, and then click Business Service Server Script.
  5. In the Business Service Server Scripts list, add a new record using values from the following table.
    Property
    Value

    Name

    Init

    Program Language

    JS

    Sequence

    1

    Script

    Enter the following script:

    function Init (Outputs)
    {
    with( Outputs )
    {
    SetProperty ("Parent Row Id", "");
    SetProperty ("Amount", "");
    SetProperty ("Description", "");
    // SetProperty ("Has Children", "N");
    // SetProperty ("Is Expanded", "N");
    // SetProperty ("Outline Number", "0");
    // SetProperty ("Last Child Info", "");
    }
    return( CancelOperation );
    }

    You can copy the text from this book, and then paste it into the Script property. To view the correctly formatted script, right-click Hierarchical List Service in the Business Services list, choose Edit Service Scripts, expand the general tree, and then click Init.

  6. In the Business Service Server Scripts list, add a new record using values from the following table.
    Property
    Value

    Name

    Query

    Program Language

    JS

    Sequence

    2

    Script

    For more information, see Script for the Query Method when Configuring a Hierarchical List Applet.

  7. In the Business Service Server Scripts list, add a new record using values from the following table.
    Property
    Value

    Name

    Service_PreInvokeMethod

    Program Language

    JS

    Sequence

    3

    Script

    Enter the following script:

    function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

    {

    TheApplication().Trace( this.Name() +".PreInvokeMethod( " + MethodName + " )");

    switch( MethodName )

    {

    case "Init":

    return( Init (Outputs) );

    case "Query":

    return( Query (Inputs, Outputs) );

    }

    return (ContinueOperation);

    }

  8. Add code to the Query method of the business service so that the method provides output that is meaningful for these fields:
    • Has Children. Y or N, depending on if the record references children or does not reference children.
    • Is Expanded. Y or N, depending on if Siebel CRM displays the record as expanded or not expanded in the applet.
    • Outline Number. A string that describes the position of the record in the hierarchy. For example. 1.2 or 2.1.1.
    • Last Child Info. A string that represents a binary sequence that indicates if the record and the parent of the record is the last record in the list of children. For more information, see About Last Child Info.

      The code can be similar to the code that you added in Step 7.

  9. To maintain the values appropriately, add code to the Update method.

    The Update method is specific to your custom implementation and requires a mechanism to update the records of the virtual business component. The exception is if all records are read-only, then no Update method is required.

About Last Child Info

The output for Last Child Info in this example is a string of three bits that Siebel CRM displays for each level in the hierarchy if more records exist. Consider the test values in the Query method for this example. The following situations apply for a tree that includes three levels:

  • If an item exists in the tree that is at position 1.3.2, and if item 1.3.3 does not exist, then the third bit is 1, which you can think of as xx1. Otherwise the third bit is 0, which you can think of as xx0.
  • If the parent record at position 1.3 is the last child, then the second bit is 1, which you can think of as x1x. If item 1.4 does not exist in the tree, then Siebel CRM considers the record as the last child.
  • If the grandparent record at position 1 is the last child, and if item 2 does not exist in the tree, then the first bit is 1, which you can think of as 1xx.

Implementing the Customization

In this topic, you implement the customization.

To implement the customization

  1. Apply any modifications that you made in the base table to the SRF file.
  2. If you defined a new screen, then add the screen to the application screen object.
  3. Compile your modifications.
  4. In the Siebel client, add the view to the list of views, and then add an appropriate responsibility so that the user can access this view.
  5. Test your modifications.
Configuring Siebel Business Applications Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.