Confirmation Functions

Confirmation functions are used to obtain confirmation from users via script/expression on the inSCADA platform.

Getting Approval From Users

ins.confirm(String type,String title, String message, Object object)

Confirmation about actions to be taken from users provides information for events that are happening. For example, you can have the user enter an information message about why a system has stopped. In this way, you can get reports about the reasons for stopping the system from inSCADA.

inSCADA offers 8 different methods of obtaining approval or information. You specify these methods with the Type parameter. They are

  • combo-text-yes

  • combo-text-yesno

  • combo-yes

  • combo-yesno

  • text-yes

  • text-yesno

  • yes

  • yesno

Other parameters in ins.confirm method are;

  • Title : Defines the title of the dialog to be opened.

  • Message : Defines the message of the dialog to be opened.

  • Object : It is an object that shapes the dialog window and defines the methods to be executed when the yes and no buttons are clicked.

Now let's examine how our dialog window for obtaining confirmation or information according to these parameters is formed.

var obj = {};
            obj.options = [
                "HV Circuit Breaker Opened at Transformer Center",
                "HV Circuit Breaker Opened at Unit Cubicle",
                "HV Circuit Breaker Opened at Grid Cubicle",
                "Water Sold Out",
                "Operator Fail",
                "Mekanik Fail",
                "RTU/PLC Fail",
                "SCADA Fail"];
            obj.onScript =  function(a){
                ins.notify("info", "Reason for Stopping", a.comboValue+"-"+a.textValue);
                ins.writeLog("info", "Unit 01","Reason for Stopping", a.comboValue+"-"+a.textValue);
            obj.offScript = function(a){
                ins.notify("info","Canceled","No any message"}; 
        ins.confirm("combo-text-yes", "PLEASE ANSWER..", "WYH DID THE UNIT STOP?", obj);

When you examine the above code, you can see that the object that defines our dialog window with the object obj is defined.

  • Object.options : Creates a list of options to be seen in Combobox.

  • Object.onScript : Defines the script to be executed when the Yes button is clicked.

  • Object.offScript : Defines the script to run when the No button is clicked.

The type, Title, Message, and object parameters are sent to the API on the line where the ins.confirm API is called.

Last updated