Tuesday, November 8, 2016

Dequeuing in Oracle BRM



Although it is not recommended, but sometimes in the test environment where there is no interface to dequeue the message from advance queue, the queue is clogged and we wish to dequeue it. Here is the way to do it:


DECLARE
po_t dbms_aqadm.aq$_purge_options_t;
BEGIN
dbms_aqadm.purge_queue_table('AQ_SYNC', NULL, po_t);
END;

Execute the above from SQL client or command line.

Tuesday, February 9, 2016

Useful logging information for cm and dm_oracle

Logging settings for cm and dm_oracle

1) For logging the time taken by opcode in the cm.pinlog
    Add the following lines in $PIN_HOME/sys/cm/pin.conf

     - cm enable_pcm_op_call_stack 1
     - cm max_pcm_op_call_stack_entries 256


This will start displaying the opcode time as below:
cm_pcm_op_call_stack
                Seconds Type  Opcode (flags, notes)
            0.000000000 Enter PCM_OP_READ_OBJ (0x0)
            0.000348000 .Enter PCM_OP_READ_OBJ (0x0)
            0.478129000 .Exit  PCM_OP_READ_OBJ (0x0) - from DM 0.0.0.1
            0.502946000 Exit  PCM_OP_READ_OBJ (0x0)


2) For setting the cm to debug level

    - cm cm_loglevel 3

3) For logging the PCM_OP_SEARCH input and output flist
    Add the following lines in $PIN_HOME/sys/cm/pin.conf

    - cm CMAP_DEBUG 0xFFFFFFFF
    - cm CM_DEBUG 0xFFFFFFFF

This should be used with cm in debug level.

4) Setting the cm log level to debug when cm is running

cat cm_debug3
r << XXX  1
0 PIN_FLD_POID POID [0] 0.0.0.1 /account 1 1
0 PIN_FLD_COMPONENT STR [0] "CM"
0 PIN_FLD_LOGLEVEL INT [0] 3
XXX
#
xop PCM_OP_INFMGR_SET_LOGLEVEL 0 1
#


run the below command from $PIN_HOME/test
testnap cm_debug3

5) Setting the cm log level to error when cm is running

cat cm_debug1
r << XXX  1
0 PIN_FLD_POID POID [0] 0.0.0.1 /account 1 1
0 PIN_FLD_COMPONENT STR [0] "CM"
0 PIN_FLD_LOGLEVEL INT [0] 1
XXX
#
xop PCM_OP_INFMGR_SET_LOGLEVEL 0 1
#

run the below command from $PIN_HOME/test
testnap cm_debug1

5) Setting the dm_oracle log level to debug when cm and dm are running

cat dm_debug3
r << XXX  1
0 PIN_FLD_POID POID [0] 0.0.0.1 /account 1 1
0 PIN_FLD_COMPONENT STR [0] "DM"
0 PIN_FLD_DEBUG_FLAG ARRAY [1] allocated 20, used 2
1     PIN_FLD_NAME STR [0] "DM_DEBUG"
1     PIN_FLD_FLAGS INT [0] 255
0 PIN_FLD_DEBUG_FLAG ARRAY [2] allocated 20, used 2
1     PIN_FLD_NAME STR [0] "DM_DEBUG2"
1     PIN_FLD_FLAGS INT [0] 4090
0 PIN_FLD_DEBUG_FLAG ARRAY [3] allocated 20, used 2
1    PIN_FLD_NAME STR [0] "DM_DEBUG3"
1    PIN_FLD_FLAGS INT [0] 65535
XXX
#

run the below command from $PIN_HOME/test
testnap dm_debug3

6) Setting the dm_oracle log level to normal when cm and dm are running

cat dm_debug1
r << XXX  1
0 PIN_FLD_POID POID [0] 0.0.0.1 /account 1 1
0 PIN_FLD_COMPONENT STR [0] "DM"
0 PIN_FLD_DEBUG_FLAG ARRAY [1] allocated 20, used 2
1     PIN_FLD_NAME STR [0] "DM_DEBUG"
1     PIN_FLD_FLAGS INT [0] 255
0 PIN_FLD_DEBUG_FLAG ARRAY [2] allocated 20, used 2
1     PIN_FLD_NAME STR [0] "DM_DEBUG2"
1     PIN_FLD_FLAGS INT [0] 0
0 PIN_FLD_DEBUG_FLAG ARRAY [3] allocated 20, used 2
1    PIN_FLD_NAME STR [0] "DM_DEBUG3"
1    PIN_FLD_FLAGS INT [0] 0
XXX
#
xop PCM_OP_INFMGR_SET_LOGLEVEL 0 1
#

 run the below command from $PIN_HOME/test
testnap dm_debug1

7) Setting the dm_oracle to debug level

Add the following lines in $PIN_HOME/sys/dm_oracle/pin.conf
- dm dm_debug 0xff
- dm dm_debug2 0xffa
- dm dm_debug3 0xffff


You can find the SQL statements as below in dm_oracle.pinlog file:
SQL_STMT do_sql_update: cmd="update account_t set poid_rev = poid_rev + 1, mod_t = :mod_t, cust_seg_list=:cust_seg_list, currency=:currency, currency_secondary=:currency_secondary where poid_id0 = :poid_id0"
There will be lot more useful information in dm_oracle.log file

Wednesday, November 19, 2014

Implementing new service (CDMA) - Text format

There are a few services that are supported out of the box in BRM. These services include GSM, GPRS, IP et.c. To support  new service in BRM, lot of customization is required. This is specified in the BRM documentation,  but spread in lots of areas so it becomes pretty difficult to take help of the BRM doc to implement a new service. Here are some of the steps /guidelines to priovide support for a new service in BRM. In this context we have used CDMA service implementation.

1]. Create or extend /service storable class e.g. /service/telco/cdma
2]. Create or extend the /event class for the delayed events (if the rating is to be done by batch pipeline) e.g. /event/delayed/session/telco/cdma
3]. Map /event/delayed/session/telco/cdma event to /service/telco/cdma
     a). Edit BRM_HOME/sys/data/pricing/example/pin_event_map file
        Caution The load_event_map utility overwrites the existing event map. If you are updating the event map, you can not load new mappings only.You must load the entire event map each time you run load_event_map utility. 
If you want to load gsm events also then you should edit BRM_HOME/sys/data/config/pin_event_map_telco_gsm file

     b). Add the service - event mapping
     /service/telco/cdma : /event/delayed/session/telco/cdma : Delayed CDMA session

     c). Load the configuration to the /config/event_map using the utility load_pin_event_map
       $> load_pin_event_map -dv pin_event_map_telco_gsm

4]. Defining RUMs for new service usage events
   RUMs(Ratable Usage Metrics) are used to charge for the events. To define new RUMs(RUMs which are not already defined) for the new service, following steps should be performaed:
  a). Define new RUMs in the pin_rum configuration file
  b). Load the contents of the pin_rum file to /config/rum object by using the load_pin_rum utility

5]. Load item tags : If you want to add new/custom tag to use in the invoice/bill, you need to edit config_item_types.xml and config_item_tags.xml. In this example, we have created a new tag for CDMA service
  a). Add the new tag element in the BRM_HOME/sys/data/pricing/example/config_item_tags.xml

   <ItemTagElement>
       <ItemTag>CDMA_Telephony</ItemTag>
       <EventType>/event/delayed/session/telco/cdma</EventType>
       <ServiceType>/service/telco/cdma/*</ServiceType>
   </ItemTagElement>

  b). Load tags using load_config_item_tags
      $>. load_config_item_tags -dv config_item_tags.xml

  c). Add the item tag configuration in the config_item_types.xml

    <ItemTypeElement>
        <ItemTag>CDMA_Telephony</ItemTag>
        <ItemDescription>CDMA Telephony</ItemDescription>
        <ItemType precreate="true" type="cumulative">/item/misc</ItemType>
    </ItemTypeElement>

  d). Load using load_config_item_types
      $>. load_config_item_types -dv config_item_types.xml

 Define the new service and service class

   1). Add new service using the pipeline setup toolbox in pricing centre

     a.  Open "Pipeline Setup Tool Box" from pricing centre
     b.  Click on Product&Service
     c.  Click on Service. Make a new service
     d.  Give below entries on "Service" page:                
               

Service CodeCDMAT
NameCDMA Telephony Service
Rank1
Type of ServiceBasic(choose from drop down)
Ratable Usage Metric GroupDURATION-Duration (choose from drop down)
General Ledger Account1420-National Airtime telephony
Revenue GroupBlank
Parent ServiceBlank
BasicClick the check box
PIN Service Type/service/telco/cdma/telephony
History

       
     e.  Give below entries on "Service Class" page
           
Service CodeService ClassNameHistory
CDMAT-CDMA  Telephony Service DEFDefault Service Class for CDMA TEL 


  2. Add reference mapping
     a. Open "Pipeline Setup Toolbox" from pricing centre
     b. Click on reference mapping
     c. Click on Product & Service
     d. Enter the following entries on "Reference Mapping" page


IDCustomerData
Referenced Object/service/telco/cdma/telephony
Referenced ColumnBlank
Referenced Parameter/event/delayed/session/telco/cdma
History




  3. Map service code
     a. Open "Pipeline Setup Toolbox" from pricing centre
     b. Click on Mapping & Enhancement
     c. Click on Map group
     d. Map group looks like :


Map GroupNameHistory
ALL_RATEWireless Sample Mapping
INCOLLECTIncollect Settlement Pipeline Mapping
OUTCOLLECTIncollect Settlement Pipeline Mapping


    e. Click on ALL_RATE and edit
    f. Goto to Service Code Map and create new with the following details


Map GroupALL_RATE-Wireless Sample Mapping
NameTelephony service for CDMA
External Service CodeCDMA.*
Usage Class.*
Location Area Indicator VAS-Event.*
Quality of Service Requested.*
Quality of Service Used.*
Record Type.*
Intern Service CodeCDMAT-CDMA Telephony Service
Intern Service ClassDEF
History


Note : Make sure that in the Service Code Map, new service map should come before default service(i.e, service map with name Everything else…)

  4. Add container field for the new service
     a. Open "Pipeline Setup Toolbox" from pricing centre
     b. Click on EDR
     c. Click on EDR Container Description. This page will look like as :

EDR Container DescriptionNameHistory
ALL_RATEWIRELESS_SAMPLE contanier description
EXAMPLEExmaple container description


    d. Select ALL_RATE and edit. This will open EDR Conatiner Description with three tabs
         i. EDR Container Description
        ii. EDR Container Field
       iii. Alias Mapping
    e. Select Alias Mapping and create new Alias Mapping with the following details :


EDR Container DescriptionALL_RATE - WIRELESS_SAMPLE conatiner description
ReferenceUniData_CustA
KeyCDMAT
TypeInternal(choose from drop down)
Field IDDETAIL.A_NUMBER



Configuring Pipeline Manager to rate the events of the new service

 1. Configure the IRL_EventTypeSplitting iScript to split EDRs by service code: Add
     CDMAT:CDMAOutput
     as the last line in the PIPELINE_HOME/iScriptLib/iScriptLib_Standard/IRL_EventTypeSplitting.data

  2. Edit wireless.reg to redirect output for CDMA, add the following piece of code/configuration

#---------------------------------------- 
#The /service/cdma/telephony output stream 
#---------------------------------------- 
CDMAOutput 

   ModuleName = OUT_GenericStream 
   ProcessType = RATING_PIPELINE 
   EventType = /event/delayed/session/telco/cdma 
 
   Module
   {
     Grammar = ./formatDesc/Formats/Solution42/V670_EVENT_LOADER_OutGrammar.dsc
     DeleteEmptyStream = True 
     OutputStream
      {
        ModuleName = EXT_OutFileManager
        Module
        {
          OutputPath = ./data/out/cdma/telephony
          OutputPrefix = test_CDMA
          OutputSuffix = .out
          TempPrefix = .
          TempDataPath = ./data/out/cdma/telephony
          TemDataPrefix = cdma.tmp.
          TempDataSuffix = .data
          Replace = TRUE
        }
     }
   }
}# end of TELOutput 
 
 
CONV_CDMAOutput 

   ModuleName = OUT_GenericStream 
   ProcessType = RATING_PIPELINE 
   EventType = /event/delayed/session/telco/cdma 
   ObjectCacheType = CONVERGENT 
   Module
   {
     Grammar = ./formatDesc/Formats/Solution42/V670_EVENT_LOADER_OutGrammar.dsc
     DeleteEmptyStream = True 
     OutputStream
     {
         ModuleName = EXT_OutFileManager
         Module
         {
            OutputPath = ./data/out/cdma/telephony
            OutputPrefix = test_CDMA
            OutputSuffix = .out
            TempPrefix = .
            TempDataPath = ./data/out/cdma/telephony
            TemDataPrefix = cdma.tmp.
            TempDataSuffix = .data
            Replace = TRUE
         }
      }
   }
}# end of CONV_TELOutput


  3. Create IFW_HOME/data/out/cdma/telephony
   $>. mkdir -p IFW_HOME/data/out/cdma/telephony
 

Changes in PIN_REL for loading rated events

    1. Add the event tables for the new event in the Infranet.properties of apps/pin_rel

#/event/delayed/session/telco/cdma
infranet.rel.storable_class.event_delayed_session_telco_cdma.number_of_tables = 9
infranet.rel.storable_class.event_delayed_session_telco_cdma.table.1.name = event_t
infranet.rel.storable_class.event_delayed_session_telco_cdma.table.2.name = event_bal_impacts_t
infranet.rel.storable_class.event_delayed_session_telco_cdma.table.3.name = event_essentials_t
infranet.rel.storable_class.event_delayed_session_telco_cdma.table.4.name = event_dlay_sess_tlcs_t
infranet.rel.storable_class.event_delayed_session_telco_cdma.table.5.name = event_dlay_sess_tlcs_svc_cds_t
infranet.rel.storable_class.event_delayed_session_telco_cdma.table.6.name = event_dlyd_session_tlco_cdma_t
infranet.rel.storable_class.event_delayed_session_telco_cdma.table.7.name = event_tax_jurisdictions_t
infranet.rel.storable_class.event_delayed_session_telco_cdma.table.8.name = event_rum_map_t
infranet.rel.storable_class.event_delayed_session_telco_cdma.table.9.name = tmp_profile_event_ordering_t
 
     2. Create ctl file for CDMA before loading the events using pin_rel
        a. Copy the original event_dlyd_session_tlco_gsm_t.ctl to event_dlyd_session_tlco_cdma_t.ctl, as we are not changing anything on field level.
        b. Open event_dlyd_session_tlco_cdma_t.ctl file and change the following…

UNCOVERABLE
LOAD DATA
APPEND
INTO TABLE EVENT_DLYD_SESSION_TLCO_CDMA_T // table name changed
SINGLEROW
PARTITION
(first the partition utility is run to create partition for /event/delayed /session/telco/cdma class)
partition_utils -o add -c /event/delayed/session/telco/cdma



New service is ready to use. You can start by creating new products. deals, discounts and plans.

Monday, July 21, 2014

A simple Oracle DB function to convert timestamp to date



In BRM, all the time and date is stored in number format and it is required to convert them if you are reading it from the DB.
Lots of developers write functions or utilities to convert it to date. Here is a similar function:

create or replace function u2d(
v_tstamp IN number)
return date
as
v_date date;

begin
v_date := to_date('01-JAN-1970', 'DD-MON-YYYY') + (v_tstamp+19800)/86400;
RETURN V_DATE;
END;

Wednesday, July 10, 2013

Hash map implementation in C

I've written a hash map in C which is based on linked list data structure. It may be useful in various scenarios. Here is the list of the APIs implemented in this:


// Hash map structure
struct hash_map_t{
struct hash_map_t* nxt;
char* account_poid; //Key
int status;  // Value
}


=> HASH MAP OPERATIONS


/*
 * Function to insert/update a key-value pair
 * If the key doesn't exist, this function will create a new node and add the 
 * key-value pair, if the key already exit, its value will be updated
 */
void hash_map_set( struct hash_map_t* hm,
        char* acc_poid, 
        int         status);


/*
 * Function to free the memory allocated by hash map
 */
void    free_hash_map(struct  hash_map_t* hm);


/*
 * Function to retrieve the map node with the kep acc_poid  
 */
struct hash_map_t* getNodeWithKey(
                              struct hash_map_t* hm,
      char*                 acc_poid);

/*
 * Function to retrieve the map node using value status   
 */
struct hash_map_t* getNodeWithValue(
                               struct hash_map_t* hm,
       int                           status);
   

The code is attached at the following location:

If you've Scripd account, download it here:
https://www.scribd.com/doc/247124214/Hash-Map-Lib


Monday, April 8, 2013

BRM Errors


Title: Resource Credit Limit Issue

Issue:
2:SACJOSHI-US:CustomerCenter:0:AWT-EventQueue-0:108:1476427204:0:root.0.0.0.1:::
        Credit limit exceeded
        <location=PIN_ERRLOC_FM:5 class=PIN_ERRCLASS_SYSTEM_DETERMINATE:1 errno=PIN_ERR_CREDIT_LIMIT_EXCEEDED:81>
        <field num=0:0,0 recid=0 reserved=0 reserved2=0 time(sec:usec)=0:0>
        <facility=0 msg_id=0 version=0>

Cause: This error usually comes when you use NCR (non-currency resource) to have a +ve balance impact. By default the credit limit for NCRs is 0 in BRM. In case, you need to have a positive balance impact on NCR, you need to update the credit limit.

0 PIN_FLD_POID                                   POID [0] 0.0.0.1 /config/credit_profile 201 0
0 PIN_FLD_PROFILES                      ARRAY [2] allocated 2, used 2
1     PIN_FLD_CREDIT_FLOOR   DECIMAL [0] NULL
1     PIN_FLD_CREDIT_LIMIT     DECIMAL [0] NULL


Title: AMT procedure errors

Issue:
ORA-29280: invalid directory path
ORA-06512: at "WK33_PIN03.AMT_MV", line 347
ORA-06512: at line 1

Cause: The directory mentioned in Infranet.properties of pin_amt application is not created or if it is created you are using the name in lowercase, change it to upper case.

Issue:
ORA-29289: directory access denied
ORA-06512: at "WK33_PIN03.AMT_MV", line 347
ORA-06512: at line 1

Cause: Good news is that the directory exists but the db user with which pin_amt is being executed is not having read/write permission.

Issue:
ORA-02055: distributed update operation failed; rollback required
ORA-54013: INSERT operation disallowed on virtual columns
ORA-06512: at "WK33_PIN03.AMT_MV", line 722
ORA-06512: at line 1

Cause: Some table in the AMT_METADATA is having virtual column, check what are the custom tables added and check which one has virtual columns.


Title: Cache entry not found

E Mon Apr  8 16:13:58 2013  <<hostname>>  cm:18233  fm_bill_utils_billing.c(49):1039 1:<<hostname>>:testnap:18231:-136099600:100001:1365405238:1
        Could not find cache entry: "PIN_SEQUENCE_TYPE_PACKAGE_ID"
E Mon Apr  8 16:13:58 2013  <<hostname>>  cm:18233  fm_subscription_purchase_deal.c:805 1:<<hostname>>:testnap:18231:-136099600:100001:1365405238:1
        op_subscription_purchase_deal error
        <location=PIN_ERRLOC_FM:5 class=PIN_ERRCLASS_SYSTEM_DETERMINATE:1 errno=PIN_ERR_NOT_FOUND:3>
        <field num=^Aopsflds:0,0 recid=0 reserved=3 reserved2=0 time(sec:usec)=0:0>
        <facility=0 msg_id=0 version=0>


Resolution: As the cache entry is missing, it means CM could not load few variable, restart cm to fix this.


Title: pricing_admin.pl failed in initializing


-bash-3.2$ ./pricing_admin.pl -init
EBUF: errno=<PIN_ERR_BAD_CRYPT:15> location=<PIN_ERRLOC_DM:4> class=<UNKNOWN:0> field num=<0:0,0> recid=<0> reserved=<0>
0 PIN_FLD_POID                   POID [0] 0.0.0.1 /config/pricing_admin -1 0
0 PIN_FLD_ACCOUNT_OBJ            POID [0] 0.0.0.1 /account 1 0
0 PIN_FLD_HOSTNAME                STR [0] "-"
0 PIN_FLD_NAME                    STR [0] "config_pricing_admin"
0 PIN_FLD_PROGRAM_NAME            STR [0] "-"
0 PIN_FLD_CONFIG_INFO       SUBSTRUCT [0] allocated 6, used 6
1     PIN_FLD_HOSTNAME            STR [0] "sacjoshi-linux"
1     PIN_FLD_LOGIN               STR [0] "INTEGRATE"
1     PIN_FLD_NAME                STR [0] "brm11gdb"
1     PIN_FLD_PASSWD              STR [0] "integrate"
1     PIN_FLD_PORT                INT [0] 1521
1     PIN_FLD_SERVER_TYPE         STR [0] "oracle"
call_opcode: PCM_OP_CREATE_OBJ failed. at ./pricing_admin.pl line 504.
Initializing config object for pricing admin failed.


Resolution: - crypt md5 entry is not enabled, enable this entry in dm_oracle's pin.conf


Another issue that can sometimes occur due to installation issues is:

-bash-3.2$ ./pricing_admin.pl -set <admins.txt
EBUF: errno=<PIN_ERR_BAD_ARG:4> location=<PIN_ERRLOC_DM:4> class=<UNKNOWN:0> field num=<PIN_FLD_POID:7,16> recid=<0> reserved=<0>
0 PIN_FLD_RESULTS                  ARRAY [*] NULL
0 PIN_FLD_POID                      POID [0] 0.0.0.1 /search -1 0
0 PIN_FLD_ARGS                     ARRAY [1] allocated 1, used 1
1     PIN_FLD_POID                  POID [0] 0.0.0.1 /config/pricing_admin -1 0
0 PIN_FLD_TEMPLATE                   STR [0] "select X from /config/pricing_admin where F1 = V1 "
0 PIN_FLD_FLAGS                      INT [0] 0
call_opcode: PCM_OP_GLOBAL_SEARCH failed. at ./pricing_admin.pl line 504.
Search failed for /config/pricing_admin object.



Wednesday, November 2, 2011

Storable class to XML representation

I recently noticed this application that converts the storable class representation in database to XML format. Its syntax is:

storableclasstoxml [-h] [-r <filename> [-o <objectname>]]
-h : display help information
-r <filename> : retrieves storable class for
      1. /service and its sub classes
      2. /event and its sub classes
      3. /account class
      and write it to <filename>
-r <filename> -o <objectname> : retrieves storable class for
      <objectname> and write it to <filename>.
      <objectname> can be /service, /event, /account,
      /service/xyz or /event/xyz where xyz is a sub class
      of either /service or /event.  Multiple object types
      can be passed with comma(',') separated.

I'm not sure in which all scenarios this XML representation will be useful. If anyone get a chance to explore this or if someone has already explored, please share with me.

Wednesday, October 12, 2011

Some useful BRM flists

Here are some useful flists which will be useful for the POCs during development of Oracle BRM based applications.
1). Search flist to find the service and account objects (or POIDS) using the login field value when login is available in the the service


0 PIN_FLD_POID                      POID [0] 0.0.0.1 /search -1 0
0 PIN_FLD_FLAGS                      INT [0] 256
0 PIN_FLD_INDEX_NAME                 STR [0] "service_login_i"
0 PIN_FLD_PARAMETERS                 STR [0] "telco/voice"
0 PIN_FLD_TEMPLATE                   STR [0] "select X from /service/$1 where F1 = V1 and  F2 = V2 "
0 PIN_FLD_RESULTS                  ARRAY [0] allocated 7, used 7
1     PIN_FLD_POID                  POID [0] NULL
1     PIN_FLD_ACCOUNT_OBJ           POID [0] NULL
1     PIN_FLD_LOGIN                  STR [0] NULL
1     PIN_FLD_PASSWD                 STR [0] NULL
1     PIN_FLD_PASSWD_EXPIRATION_T TSTAMP [0] (0) 01/01/1970 05:30:00:000 AM
1     PIN_FLD_PASSWD_STATUS         ENUM [0] 0
1     PIN_FLD_STATUS                ENUM [0] 0
0 PIN_FLD_ARGS                     ARRAY [1] allocated 1, used 1
1     PIN_FLD_POID                  POID [0] 0.0.0.1 /service/ip -1 0
0 PIN_FLD_ARGS                     ARRAY [2] allocated 1, used 1
1     PIN_FLD_LOGIN                  STR [0] "your-login"


2). Search flist to find the service and account objects (or POIDS) using the alias field value when login is not  available in the the service

0 PIN_FLD_POID                      POID [0] 0.0.0.1 /search -1 0
0 PIN_FLD_FLAGS                      INT [0] 256
0 PIN_FLD_INDEX_NAME                 STR [0] "service_alias_list_name_i"
0 PIN_FLD_PARAMETERS                 STR [0] "telco/voice"
0 PIN_FLD_TEMPLATE                   STR [0] "select X from /service/$1 where F1 = V1 and  F2 = V2 "
0 PIN_FLD_RESULTS                  ARRAY [0] allocated 7, used 7
1     PIN_FLD_POID                  POID [0] NULL
1     PIN_FLD_ACCOUNT_OBJ           POID [0] NULL
1     PIN_FLD_LOGIN                  STR [0] NULL
1     PIN_FLD_PASSWD                 STR [0] NULL
1     PIN_FLD_PASSWD_EXPIRATION_T TSTAMP [0] (0) 01/01/1970 05:30:00:000 AM
1     PIN_FLD_PASSWD_STATUS         ENUM [0] 0
1     PIN_FLD_STATUS                ENUM [0] 0
0 PIN_FLD_ARGS                     ARRAY [1] allocated 1, used 1
1     PIN_FLD_POID                  POID [0] 0.0.0.1 /service/telco/gsm/telephony -1 0
0 PIN_FLD_ARGS                     ARRAY [2] allocated 1, used 1
1     PIN_FLD_ALIAS_LIST           ARRAY [*] allocated 1, used 1
2         PIN_FLD_NAME               STR [0] "9830000011"

3). Flist to create customer without plan/deals/products (PCM_OP_CUST_COMMIT_CUSTOMER)

0 PIN_FLD_POID POID [0]  0.0.0.1 /plan 9198 0
0 PIN_FLD_ACCTINFO ARRAY [0]  
1 PIN_FLD_POID POID [0] 0.0.0.1 /account -1 0
0 PIN_FLD_PAYINFO ARRAY [0]  
1 PIN_FLD_POID POID [0] 0.0.0.1 /payinfo/invoice -1 0
1 PIN_FLD_PAY_TYPE ENUM [0] 10001
1 PIN_FLD_INHERITED_INFO      SUBSTRUCT [0]
2 PIN_FLD_INV_INFO ARRAY [0]
3 PIN_FLD_ADDRESS   STR [0] "Castro Street"
3 PIN_FLD_CITY   STR [0] "San Fransisco"
3 PIN_FLD_COUNTRY   STR [0] "US"
0 PIN_FLD_NAMEINFO ARRAY [1]  
1 PIN_FLD_LAST_NAME STR [0] "LastN"
1 PIN_FLD_FIRST_NAME STR [0] "FirstN"
1 PIN_FLD_ADDRESS STR [0] "113, Castro Street"
1 PIN_FLD_CITY STR [0] "San Fransisco"
1 PIN_FLD_STATE STR [0] "CA"
1 PIN_FLD_COUNTRY STR [0] "US"
1 PIN_FLD_ZIP STR [0] "53038"
1 PIN_FLD_COMPANY STR [0] "ABC"
1 PIN_FLD_EMAIL_ADDR STR [0] "test@test.com"
0 PIN_FLD_SERVICES ARRAY [0]  
1 PIN_FLD_SERVICE_OBJ POID [0] 0.0.0.1 /service/telco/gsm/telephony -1 0

Thursday, September 29, 2011

Enabling pin_virtual_time first time after BRM 7.4 installation

During development many times we need pin_virtual_time utility to move the BRM time forward to test many scenarios like billing, invoicing, dunning et.c.
After installing the BRM 7.4 components in the server, generally the pin_virtual_time_file is not created and also the entry is commented in almost all the component's pin.conf file.
Here are some tips to enable the pin_virtual_time (may be useful to novice BRM developers/testers)

1). Uncomment pin_virtual_time entry in all the components' pin.conf file. You may run the following command :
find  $PIN_HOME/ -name "pin.conf" | xargs sed -i 's/# - - pin_virtual_time/- - pin_virtual_time/g'
2). Restart the BRM server
3). Goto the $PIN_HOME/sys/test directory and execute
    $> pin_virtual_time
    This will create the pin_virtual_time_file and from now on you can move the time.

PIN_VIRTUAL_TIME USAGE
usage: pin_virtual_time [-h|-H|-?] [-f filename] [-m mode [value]]|[-i interval]
    -h, -H, -? print this message.
    -m ... set pin_virtual_time to mode, nothing or -i query pin_virtual_time
    mode is 0 (regular), 1 (fixed) or 2 (running)
    value as [mmdd]HHMM[[cc]yy][.SS]
    interval is time between queries in seconds



Monday, September 5, 2011

Search flist to find billinfo and account poid using account_no

Following is a complex search flist for finding BILLINFO poid and ACCOUNT poid using the ACCOUNT_NO field. As such this is used while running the bill utility during test runs but consider it as a sample for searching and extracting field values from two different storable class in single search. Generally, using a simple flist this is not achievable.

0 PIN_FLD_POID                      POID [0] 0.0.0.1 /search -1 0
0 PIN_FLD_FLAGS                      INT [0] 768
0 PIN_FLD_TEMPLATE                   STR [0] " select X from /account 1, /billinfo 2 where 1.F1 = 2.F2 and 1.F3 = V3 "
0 PIN_FLD_RESULTS                  ARRAY [*] allocated 2, used 2
1     PIN_FLD_POID                  POID [0] NULL
1     PIN_FLD_LINKED_OBJ           ARRAY [2] allocated 3, used 3
2         PIN_FLD_ACCOUNT_OBJ       POID [0] NULL
2         PIN_FLD_LINK_DIRECTION    ENUM [0] 1
2         PIN_FLD_EXTRA_RESULTS    ARRAY [*] allocated 1, used 1
3             PIN_FLD_POID          POID [0] NULL
0 PIN_FLD_ARGS                     ARRAY [1] allocated 1, used 1
1     PIN_FLD_POID                  POID [0] NULL
0 PIN_FLD_ARGS                     ARRAY [2] allocated 1, used 1
1     PIN_FLD_ACCOUNT_OBJ           POID [0] NULL
0 PIN_FLD_ARGS                     ARRAY [3] allocated 1, used 1
1     PIN_FLD_ACCOUNT_NO             STR [0] "0.0.0.1-90356"

I will provide the explaination shortly.