CA Service Management

  • 1.  Old status at spel code

    Posted Jun 28, 2017 07:40 AM

    Hi,

     

    I want to see old status at database for created zVFTR_OldStatus srel crs at cr table.I use POST_VALIDATE zVFTR_ADCLflag() 143 FILTER(EVENT("UPDATE")); spel.The cose is below.

     

    string param;
    param=persistent_id;

    send_wait(0, top_object(), "call_attr", "cr", "val_by_key", "persistent_id", param, (int) 1, "status");
    string ex_status;
    ex_status = msg[1];

    zVFTR_OldStatus=ex_status;

    logf(ERROR, "status: '%s' zVFTR_OldStatus: '%s' ex_status: '%s' ref_num: '%s'",status, zVFTR_OldStatus,ex_status,ref_num);

     

    And see logf at std.log. When execute select zVFTR_OldStatus,status,* from call_req where ref_num='42607130' this attr. is null.

     

     

    What is the cause of the problem?

     

    Regards,

    Burcu



  • 2.  Re: Old status at spel code

    Posted Jun 28, 2017 07:57 AM

    Hi,

    I'm not sure what wrong with your code but you can try this one:

    // Mod file
    MODIFY cr POST_VALIDATE zVFTR_ADCLflag(status) 4000001 FILTER(status{});
    // SPL file:
    cr::zVFTR_ADCLflag(...) {
         string old_val, new_val;
         int msg_i;
         old_val = argv[2];
         new_val = argv[3];
         logf(SIGNIFICANT, "%s > stutus changed: %s > %s", persistent_id, old_val, new_val);
         send_wait(0, this, "call_attr", "zVFTR_OldStatus", "set_val", old_val, "SURE_SET");
         if (msg_error()) {
              logf(ERROR, "%s > Failed to update status:", persistent_id);
              for (msg_i=0;msg_i<msg_length();msg_i++)
                   logf(ERROR, "\tmsg[%d]: %s", msg_i, msg[msg_i]);
         }
    }

    Regards,

    cdtj



  • 3.  Re: Old status at spel code
    Best Answer

    Posted Jun 29, 2017 03:32 AM

    Hi,

    I try this but  changed the code a little and it's working.You can see the below.Thanks.

     

    string new_val;
    string param;
    param=persistent_id;
    int msg_i;
    send_wait(0, top_object(), "call_attr", "cr", "val_by_key", "persistent_id", param, (int) 1, "status");
    string old_val;
    old_val = msg[1];


    logf(SIGNIFICANT, "%s > stutus changed: %s > %s", persistent_id, old_val, new_val);
    logf(ERROR, "status: '%s' old_val: '%s' new_val: '%s' ref_num: '%s'",status, old_val,new_val,ref_num);
    send_wait(0, this, "call_attr", "zVFTR_OldStatus", "set_val", old_val, "SURE_SET");
    if (msg_error()) {
    logf(ERROR, "%s > Failed to update status:", persistent_id);
    for (msg_i=0;msg_i<msg_length();msg_i++)
    logf(ERROR, "\tmsg[%d]: %s", msg_i, msg[msg_i]);
    }

    Regards,

    Burcu