General Technical Discussions for Service

Get Involved. Join the Conversation.

Comments

  • Mark Rhoads

    One good practice is to get as much testing automated via the test harness as is possible ... it is much easier to test here than to set up and read log files, etc.

  • Justin

    Perfect, that is what I needed to know!  Thanks for your help!

  • Mark Rhoads

    The fetchObject() method should return the object or objects in the precise states that are to be tested --- they are passed as-is into the apply() method.

    So, if I want to test the prev, I just add the prev to the object and set the prev values to what I want to test, e.g. for an existing $org (created by either the setup() or fetchObject() method, I might do something like:

    $org->prev = new RNCPHP\Organization;
    $org->prev->Name = "TheFormerName";
    ...
    

     

     

  • Shreyas Pandhari

    Hi Bishnu,

    Unfortunately I haven't found any run-time debug methodology for CPM. Even  with logMessage() you need to do a flipflop from RN instance and CP Admin portal + not sure if we can set the log level to optimize the logging. Drawback of not having an IDE for php scripts associated with RN.

    If someone from product dev can help out with other ways of debugging CPM scripts.

     

    Thanks,

    Shreyas

  • Bishnu Paudel

    Thanks Ross. I was not aware of logMessage(). I will give it a try.

    Cheers,

    Bishnu

  • Ross Crockett

    Hey Bishnu,

    I haven't found a better way unfortunately but I just thought I'd mention the logMessage() function if you aren't already aware of it. You can use this to log messages that can be viewed in the debug logs within the Customer Portal admin area. Note only messages from the development area show up though (which is annoying as it would be good to debug/view logs from production), which I find better than dumping values to the screen.

  • Varun Chandran

    Hi Fabio,

    You can use Process Designer with which you can create event handlers [Custom Process Model written in PHP]. Using event handlers, you can fetch the contact object on its create, update and delete operations. You can try integrate it with your system while any of the operation is happening, through cURL/SOAP (limitations are there). You will have to work on it a little hard but you can do it.

    Hope if carves a way through.. 

    Best

    Varun

  • Andrew Rowse

    I think you are on the wrong Oracle product forum. This one is specific to the RightNow CX product.

    Maybe try this forum: https://community.oracle.com/community/developer/english/oracle_database/general_questions

  • Bishnu Paudel

    What a shame! my handler was not bound to the custom object at all. Sorry I wasted your time.

     

  • Bishnu Paudel

    Hi Varun,

    The apply function is wrapped inside the class in my code. I have other functions as well so I missed the closing "}" for class when I copied the apply function.

    Thanks,

  • Ross Crockett

    Hey Shreyas.

    I am using the cloud version, not on-premise. I am attaching the current test file, would someone with NuSOAP also in their env be able to test it out and see if they get the same issue?

    You will have to change the interface on line 37 but everything else should work. I've temporarily changed the webservice being called to a open web service which does currency conversion as a proof of concept.

    If you see more output after "Instantiating client" then you're doing better than me.

    Cheers,

    Ross

  • Bastiaan van der Kooij

    Ok continuing with my monologue; I have fixed the issue. Apparently during a multi update (and only multi), the only available fields in the object are the ones that are edited during this update together with the main ID. All other fields are not set, so I needed to fetch the object in the custom process when it was updated to work with the fields I needed. 

    No I am fetching the object for each update, like;

            if (RNCPM\ActionUpdate == $action)
            {
                $order = RNCPHP\Orders\OrderHeader::fetch($order->ID);
            }
     
  • Bastiaan van der Kooij

    I also tried to upload orders using the Data Import Wizard, to trigger the Custom process. Enabled the checkboxes for Execute External Events and made sure there was a field that was updated. But no luck, the CPM is simply not triggered....

    Creating new orders using the Data Import Wizard does work correctly, so it is only limited to batch updates that are not triggering the CPM.

  • Varun Chandran

    Wrap the apply function inside class StudyPlanRequestUpdate and try once.

    //class StudyPlanRequestUpdate starts here
    class StudyPlanRequestUpdate
            implements RNCPM\ObjectEventHandler
    {
        public static function apply( $run_mode, $action, $obj, $n_cycles )
        { 
    $subject="test subject";
            $inc = RNCPHP\Incident::fetch($obj->incident_id->ID); 
    var_dump($inc->Subject);
            $inc->Subject=$subject;
    var_dump($inc->Subject);
            $inc->save(); 
     
    return ;
    }
    }
    //class StudyPlanRequestUpdate ends here
     
    //class StudyPlanRequestUpdate_TestHarness starts here
    class StudyPlanRequestUpdate_TestHarness
            implements RNCPM\ObjectEventHandler_TestHarness
    {
    /*Code block*/
    }

     

  • Bishnu Paudel

    I think fetching of incident object is not necessary because $obj->incident_id already refers to an incident object. But this didn't help at all.