11Projected Asset Cache

Projected Asset Cache

This chapter describes the VORD Projected Asset Cache business service, also referred to as “Projected Asset Cache.” This chapter includes the following topics:

The “VORD” in the name of this business service originally stood for Vertical Order Management, but this business service is now used generally in Siebel Enterprise Applications as well as Siebel Industry Applications.

About Projected Asset Cache

The Projected Asset Cache is a persistent business service that loads all assets, open orders, and quote line items matching a specified search specification into memory using the most efficient SQL queries possible. Projected Asset Cache is used by the Compound Product Validation. It is used by Network Validation to populate the network nodes pick applet. It is also used by Compatibility for cross-product compatibility checking. The Projected Asset Cache can be used by any application that needs a consolidated view of product instances across the quote-to-order-to-asset lifecycle.

Projected Asset Cache automatically converts between the different field names in the Quote, Order, and Asset business components. The cache is always stored and queried using the Asset field names. Open Order and Quote line items are applied to the existing assets to generate a future projected state of the assets for a specified date.

The Projected Asset Cache business service supports multiple concurrent cache instances. When the cache is initialized, a unique identifier is returned. Subsequent queries must specify the identifier of the cache to query.

The following are two key functions to the Projected Asset Cache.

    Retrieve Data

    To retrieve data, the Projected Asset Cache queries the following business components:

    • Quote Item: Quote Item XA

    • Order Entry - Line Item: Order Item XA

    • Asset Mgmt - Asset: Asset Mgmt - Asset XA

    Within these business components, Projected Asset Cache limits the retrieval of data to only those fields and attributes required by the rules checkers. To find this information, the Projected Asset Cache:

    • Loads all the Asset records

    • Finds all open orders associated with these Asset records

    • Loads all quote line items for the current quote associated with the Compound Product.

    The Projected Asset Cache then uses a predefined Field Mapping Service business service to translate the field names among business components.

      Build the Future Requested State

      After retrieving the data, the Projected Asset Cache builds the future requested state of the product instances. It takes into consideration all assets matching the search specification and applies all open orders due to complete prior to the specified date. It then applies the current quote or order to generate the future requested state.

      The array of projected assets generated is stored in the business service. It is available for performing validations until it is released or a new initialization of the Projected Asset Cache occurs.

      Because the Projected Asset Cache can include any field in the Asset Mgmt - Asset business component, and because it also includes data from the Quote Item and Order Line Item business components, the fields must be mapped across three different business components.

      This mapping is done by the Field Mapping Service business service. You add mappings by creating new user properties on the Field Mapping Service business service.

      The following table gives an example of one field mapping, which translates the Service Point Serial Number field in the Asset Mgmt - Asset business component to the corresponding field in the Quote Item business component and in the Order Entry - Line Item business component.

      Name Value

      Asset Mgmt - Asset:Quote Item Map 2

      [Service Point Serial Number]:[Service Point]

      Asset Mgmt - Asset:Order Entry - Line Items Map 2

      [Service Point Serial Number]:[Service Point]
      Note: If you add custom fields to the business components from which the Projected Asset Cache retrieves data, and you want to use these fields either in simple expression rules or custom rules as part of a custom business service, you must add new field mappings.

        Projected Asset Cache Business Service Methods

        Projected Asset Cache methods are summarized in the following table.

        Method Comment

        Initialize Method

        Creates a new cache for assets that match the specified search expression.

        Query Method

        Filters the list of assets in the Projected Asset Cache to those that match the Search Expression.

        Reset Method

        Removes a specified cache from the Projected Asset Cache.

        Retrieve Method

        Supports a combined query of the Initialize and Query methods.

        Using the VORD Projected Asset Cache Business Service shows an example of how to structure the input parameters for the VORD Projected Asset Cache in a workflow.

          Initialize Method

          The Initialize method creates a new cache for assets that match the specified search expression. It applies open orders until the specified future date. It applies line items from the specified quote.

          The Initialize method retrieves only those fields and attributes specified by the Field and Attribute input arguments. If a Future Date is provided, open order lines satisfying the search expression that have a due date prior to the Future Date are applied to the associated assets. If a Quote Id is provided, the quote line items of the specified quote that satisfy the search expression are applied to the associated assets.

          Arguments

          Argument Description

          Search Expression

          [in] Search Expression with which to initialize the cache. Only Assets, Quote Line Items, Order Line Items and attributes that satisfy the search expression will be loaded into the cache. (Required)

          Field

          [in] Property set of fields to be retrieved by the Projected Asset Cache. (Optional)

          Attribute

          [in] Property set of attributes to be retrieved by the Projected Asset Cache. (Optional)

          Future Date

          [in] Project assets on this date. Only orders that have a due date less than this future date will be applied. (Optional)

          Quote Id

          [in] Row ID of the quote for which line items are to be queried and loaded into the Projected Asset Cache. (Optional)

          Asset Cache Key

          [out] Unique identifier with which to access the Projected Asset Cache. Used by the Query method.

          Related Information

          See Query Method and Validate Method.

            Query Method

            The Query method filters the list of components in the Projected Asset Cache to those that match the Search Expression. It then counts the number of components, sums the values of Aggregate Field, or calculates the minimum, maximum or average for each unique combination of group-by fields, and sorts the result by the Sort Field. This method is analogous to a SQL SELECT statement of the form:

            SELECT * | COUNT(*) | SUM([Aggregate Field]) | MAX([Aggregate Field]) | 
            MIN([Aggregate Field]) | AVG([Aggregate Field]), [Calculated Field] WHERE [Search 
            Expression] GROUP BY [Group By Field] HAVING [Having Expression] SORT BY [Sort By 
            Field]".  
            

            The search expression supports a list of AND clauses and OR clauses with the following operators:

            =, <>, !=, <, >, >=, <=
            

            Arguments

            Argument Description

            Asset Cache Key

            [in] Unique identifier with which to query the cache. The key identifies the projected asset cache to validate, and it is returned by the Initialize method. (Required)

            Search Expression

            [in] Consider only assets that satisfy this Boolean expression. (Optional)

            Example:

            ([Product Type] = “Connection") AND ( ([Service Address] = 
            "") OR ([To Service Address] = ""))
            

            Aggregate Function

            [in] The type of query executed against the projected asset cache. Valid values are "Sum", "Count", "Max", "Min", "Avg" or "". (Optional)

            Note: Aggregate Function does not support the use of Date fields.

            Aggregate Field

            [in] The asset field considered by an aggregate query. Example: Bandwidth. (Optional)

            Note: Date fields are not supported in aggregate queries.

            Calculated Field

            [in] Unique identifier with which to query the cache. This key is returned by the Initialize method. The Calculated Field consists of a property set containing definitions for calculated fields that are returned as part of the result set. (Optional)

            Example:

            {‘Error Text’, ‘[Count] [Product]s have no Service Address 
            selected’}
            

            Group By Field

            [in] A property set containing a comma-separated list of fields or attributes used to group by when evaluating an aggregate function. (Optional)

            Example:

            {‘Service Address’, ‘’},{‘To Service Address’, ‘’}
            

            Having Expression

            [in] Consider only groups that satisfy this Boolean expression. (Optional)

            Example:

            [Count] > 1
            

            Sort By Field

            [in] A property set containing a comma-separated list of fields by which to sort the result set. (Optional)

            Example:

            {‘Product’, ‘’},{‘Service Id’, ‘’}
            

            Result

            [out] Property set of projected asset cache entries that satisfy the search expression. The property set contains child property sets that represent rows of the result.

            Example:

            {{{‘Count’, ‘2’}, {‘Service Address’, ’50 Main St., Denver, 
            CO 80207’}, {‘To Service Address’, ‘101 California, New York 
            NY 10234’}},
            
            {{‘Count’, ‘4’}, {‘Service Address’, ’50 Main St., Denver, 
            CO 80207’}, {‘To Service Address’, ‘901 Peach Tree, Atlanta, 
            GA 98765’}}}
            

            Related Information

            See Initialize Method and Validate Method.

              Reset Method

              The Reset method deletes the specified cache (or all caches, if not specified) from the Projected Asset Cache.

              Argument

              Argument Description

              Asset Cache Key

              [in] Unique identifier with which to query the cache. This key is returned by the Initialize method. (Optional)

              Related Information

              See Validate Method.

                Retrieve Method

                The Retrieve method supports a combined Initialize or Query, and is essentially a wrapper around Initialize + Query. The input arguments are the same as those for Initialize. The output argument is that of Query.

                Arguments

                Argument Description

                Search Expression

                [in] Search Expression with which to initialize the cache. Only Assets, Quote Line Items, Order Line Items and attributes that satisfy the search expression will be loaded into the cache. (Required)

                Field

                [in] Property set of fields to be retrieved by the Projected Asset Cache. (Optional)

                Attribute

                [in] Property set of attributes to be retrieved by the Projected Asset Cache. (Optional)

                Future Date

                [in] Project assets on this date. Only orders that have a due date less than this future date will be applied. (Optional)

                Quote Id

                [in] Row ID of the quote for which line items are to be queried and loaded into the Projected Asset Cache. (Optional)

                Result

                [out] Property set of projected asset cache entries that satisfy the search expression. The property set contains child property sets that represent rows of the result.

                Example:

                {{{‘Count’, ‘2’}, {‘Service Address’, ’50 Main St., Denver, CO 
                80207’}, {‘To Service Address’, ‘101 California, New York NY 10234’}},
                
                {{‘Count’, ‘4’}, {‘Service Address’, ’50 Main St., Denver, CO 80207’}, 
                {‘To Service Address’, ‘901 Peach Tree, Atlanta, GA 98765’}}}
                

                  Using the VORD Projected Asset Cache Business Service

                  This topic shows how to structure the input parameters for the VORD Projected Asset Cache business service in a workflow.

                  To use VORD Projected Asset Cache business service in a workflow

                  • The structure for all input parameters must be as follows:

                    • All values added to the input PropertySet must be added as child PropertySets.

                    • All child PropertySets must have their type set by the SetType PropertySet method.

                      For example, for each Field argument:

                    • Create a new PropertySet, set its type to Field, and then use the SetProperty method to set the field name.

                    • Add this new PropertySet as a child to the main property used in the business service.

                      For each Search Expression argument:

                    • Create a new PropertySet, sets its type to Search Expression, use the SetProperty method to set the property name as Search Expression, and then set Search Expression as the property value.

                    • Add this new PropertySet as a child to the main property used in the business service.

                      Note: All fields used in the Search Expression field must be present in the Field PropertySet.

                      Example:

                      var assetCacheSvc = TheApplication().GetService("VORD Projected Asset Cache");
                      var svcInputs = TheApplication().NewPropertySet();
                      var svcOutputs = TheApplication().NewPropertySet();
                      var field = TheApplication().NewPropertySet();
                      var search = TheApplication().NewPropertySet();
                      field.SetType("Field");
                      field.SetProperty("Network Element Type", "");
                      var CompoundProduct = "XXXXXXX";
                      search.SetType("Search Expression");
                      search.SetProperty("Search Expression", "([Compound Product Number] = 
                      \""+CompoundProduct+"\")");
                      svcInputs.AddChild(field);
                      svcInputs.AddChild(search);
                      assetCacheSvc.InvokeMethod("Initialize", svcInputs, svcOutputs);
                      var assetCacheKey = svcOutputs.GetProperty("Asset Cache Key");