This is a public Forum  publicRSS

Topic

    Saravanan Sekar
    Asynchronus CPM not working properlyAnswered
    Topic posted April 16, 2018 by Saravanan SekarPro 
    100 Views, 4 Comments
    Title:
    Asynchronus CPM not working properly
    Content:

    Hi All,

     

    I am using curl in CPM to create record in EBS system, once the record created am mapping that respective record ID against the Incident.

    Here, the record gets created successfully and the ID also coming (Tested Completely in Test_harness as well as in Controller with the existing incident), but when I call the CPM from business rule for new records (dynamically), the EBS record ID value is not getting stored against incident but the record created successfully in EBS system. 

     

    I am also using RNCPHP\ConnectAPI::commit(); in my code to stop triggering more than once.

     

    Any input is welcome, Thanks in advance.

    ~ S.Saravanan

    Version:
    18 A

    Best Answer

    Saravanan Sekar

    Hi DIlip, Yes I got solution,

    Hi Lukk, from log I couldn't find any error. Actually there is no error, after I have added the below lines od code, its started to work fine.

    $incident->save(RNCPHP\RNObject::SuppressAll);
    RNCPHP\ConnectAPI::commit();
     
    Thanks,
    S.Saravanan

     

    Answer

     

    • Luuk

      It's not really related to your question, but you don't have to commit to stop the code from triggering more than once.

      You can use:

      public static function apply( $run_mode, $action, $incident, $n_cycles ) {   

      }

      See there's a n_cycles variable. You can use that to stop after x times.

      Ontopic: Do you have any way to view error messages? The incident update (with the id from the EBS) is probably giving some error. Hence not updating.

    • Saravanan Sekar

      Hi Luuk, I will write log and try to catch the error and update here.

       

      Regards,

      ~S.Saravanan

    • Dilip Jayachandra

      Hi Saravanan,

      Please share the solution if you got

      Regards,

      Dilip

    • Saravanan Sekar

      Hi DIlip, Yes I got solution,

      Hi Lukk, from log I couldn't find any error. Actually there is no error, after I have added the below lines od code, its started to work fine.

      $incident->save(RNCPHP\RNObject::SuppressAll);
      RNCPHP\ConnectAPI::commit();
       
      Thanks,
      S.Saravanan