Thursday, March 10, 2011

Adding new element in a storable class

To add a new element in a storable class, you need to use PCM_OP_WRITE_FLDS with the PCM_OPFLG_ADD_ENTRY as flag. Provide the element in the input flist with the new element id and execute PCM_OP_WRITE_FLDS with the flist. e.g., using testnap

testnap>r << xx 1
0 PIN_FLD_POID           POID [0] 0.0.0.1 /some_class 1111
0 NEW_ARRAY_NAME ARRAY [10]
1   ARRAY_FIELD1   STR [0] "VALUE1"
1   ARRAY_FIELD2   STR [0] "VALUE2"
...
...
...
xx
testnap>xop PCM_OP_WRITE_FLDS 32 1
0 PIN_FLD_POID           POID [0] 0.0.0.1 /some_class 1111

For your reference, the value of PCM_OPFLG_ADD_ENTRY is 0x20 (hexadecimal) which is equal to 32 in decimal.

2 comments:

  1. Hello ,

    Pls can you explain in detail as to how to add a new storage class ie. for instance we have /service/telco now I want to add /dualplay
    => /service/telco/dualplay
    and then we need to add new events to /events/session/telco/dualplay

    Can you pls expalin

    ReplyDelete
  2. Hi EVSK, You can extend any storable class by defining the new storable through developer center or alrenatively you can use the pin_deploy utility of BRM. As such the pin_deploy utility is easy to use and extend a new storable class as you can just take the definition of the existing class and add the data that you want in the new class. Here are the steps to extend a storable class using pin_deploy :

    1). Export the existing class definition:
    pin_deploy -smncp /service/telco > telco.podl

    2). Copy telco.podl to your class.podl
    cp telco.podl dualplay.podl

    3). Edit dualplay.podl and add the data that you want. Don't forget to change the storable class name and the table name to which the new storable class will map.

    4). Create the new storable class
    pin_deploy create dualplay.podl

    Same way you can create the new event storable by extending from the exisiting class.

    ReplyDelete