Runtime Events reload cache

Starting a series "Runtime objects cache". And the first runtime object I'll be covering is Runtime Events (RTE).

Background:

If you are working with RTE you probably know about "Reload Runtime Events" menu command, which allows you to clear RTE cache in your current session. But, what if you are working with multiple sessions? For example, doing your configuration under one user / application and testing it under another, where you don't have access to RTE screen. It could also be a case where you don't want to lose a context. And finally, you might be creating RTE indirectly, from workflows start connector. It all leads you to restarting a Siebel client or losing a context.

Solution:

It turns out "Reload Runtime Events" command is an implicit BC method supported by generic CSSBusComp class. It means we can run that command from any applet and let it propagate to BC. Thanks to Siebel OUI we can run any applet method right from the browser console. As simple as that:

SiebelApp.S_App.GetActiveView().GetActiveApplet().InvokeMethod("ClearCTEventCache");

Here I've made a bookmarklet out of it, so you can run Reload RTE command from browsers bookmark toolbar in any application/view/context without any pre-configuration:

  • Source code: Snippet
  • /* 
    @desc Reloads Runtime Events
    @author VB(xapuk.com)
    @version 1.1 2019/04/20
    */
    if("undefined" === typeof SiebelApp){
        alert("Please, log into Siebel application first!");
    }else{
        var v = SiebelApp.S_App.GetActiveView();
        var ap = v.GetActiveApplet();
        if ("undefined" === typeof ap) {
            ap = v.GetAppletMap()[Object.keys(v.GetAppletMap())[0]];
        }
        if ("undefined" === typeof ap) {
            alert("No applet found!");
        } else {
            ap.InvokeMethod("ClearCTEventCache", null, {
                "cb": function(e) {
                    alert("Runtime Events were reloaded!");
                },
                "errcb": function(e) {
                    console.log("Err", e);
                    alert(e.toString());
                }
            });
        }
    }
    
  • Bookmarklet code: Snippet
  • javascript:void function(){if("undefined"==typeof SiebelApp)alert("Please, log into Siebel application first!");else{var e=SiebelApp.S_App.GetActiveView(),t=e.GetActiveApplet();"undefined"==typeof t&&(t=e.GetAppletMap()[Object.keys(e.GetAppletMap())[0]]),"undefined"==typeof t?alert("No applet found!"):t.InvokeMethod("ClearCTEventCache",null,{cb:function(e){alert("Runtime Events were reloaded!")},errcb:function(e){console.log("Err",e),alert(e.toString())}})}}();
    
  • Bookmark link: Drag&drop me

Bonus:

You can use the same approach to reset List of Values cache:

SiebelApp.S_App.GetActiveView().GetActiveApplet().InvokeMethod("ClearLOVCache");

 

and View/Responsibility cache:

SiebelApp.S_App.GetActiveView().GetActiveApplet().InvokeMethod("ClearResponsibilityCache");