Update cookies preferences
Promotic

Object PmAction

Description:
Object represents an action that can be executed later.
This object is obsolete (but functional) and is intended only for the VBScript language. For the JavaScript language, it is simpler and more general to use a function.
Properties and methods:
Call()Calling action
PrivateDataObject containing designer defined properties
Note:
- The object can be created by the Pm.CreatePmAction method.
- This object is functional also in Web panels.


The PmAction object is handy if it is needed that "someone" creates this object (i.e. creates "action"), then passes this object forward and then "someone else sometime" executes such action. DThe important point is that "someone else" only calls the Call method and does not need to know what is actually inside (e.g. does not know that designer method is called over some object using some parameters).

The usage of the PmAction object:
The created action can be used in two ways:
1st It can be inserted into system component so that it is activated if needed.
In this case the designer does not call the Call method. The method is called by the system component. While calling it can also set some important information in the properties of the object that is then accessible in the called designer method in the oSystem parameter.
Examples of system components that can be used for PmAction:
- Closing the panel: In the OpenView method the action can be set in the oExtra.onClose entry. The action is then called when the panel is closed and the ReturnValue property is set in the oSystem parameter.
2nd The designer uses the action by calling the Call method when needed.

The example of creation and usage of the PmAction object:
Creates action: In this part, an action of the type "calling the designer method" is created (named "MyMeth1") and located in the object where there is this script (this object is accessible by using the pMe variable).
Simultaneously the designer defined properties are set in the object (that is saved in PrivateData): property "id" and "val". These properties are then available when the action is activated.
Calling action: In this place the action is activated. This script can be called "by someone else somewhere else", it only needs to have access to the created action (access to oAction value).
If the action was set in some system component, then the designer does not call the Call method (it is called by the system itself).
This way the designer method "MyMeth1" is called (method defined on the "Methods" tab) that must have two parameters:
- oSystem: Object of the PmMap type. Properties of this object are set by system based on the source of calling.
- oPrivate: Object of the PmMap type. Properties of this object are set by the designer in the PmAction.PrivateData object.
It means that this object contains new defined properties "id" and "val".
JavaScriptVBScriptSelect and copy to clipboard

// Creates action
var oAction = Pm.CreatePmAction(1, pMe, "MyMeth1");
oAction.PrivateData.id = "Temperature";
oAction.PrivateData.val = 56;
// Calling action
oAction.Call();

History:
Pm8.03.06: Created
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.