CALL action will execute calling of the
RPC (RPCX) procedure with the name
ProcName. The procedure name is followed by a list of comma separated parameters.
The number (an types) of parameters must be equal to the number of parameters of the called procedure (if the number is not equal, there is generated the exception _ERR_INV_NUM_PARAMS*).
If some of the parameters is specified as an input-output one in the procedure declaration, the corresponding parameter, during the procedure call, must not be a constant (if an error occurs, there will be generated the exception _ERR_SET_CONST).
procIdent is the reference to an object of Process type, where is the object procIdent opened in. For object of Event type it is the process D2000 EventHandler, which is its parent or process on which the called Event is opened (OPENEVENT action). For an object of Picture type it is the process D2000 HI, where is this picture opened in.
If the required object is not opened in the given process, the script generates the error _ERR_OBJECT_NOT_FOUND*.
The parameter INSTANCE determines the instance number of the object (picture or event).
If a local variable of RefId type is used for the identifier objIdent, the parameters INSTANCE and ON are not admissible (their value are given by the calling context).
If RPC procedure is called between Local and Remote part of "Client and Server Event" configuration (HIS Server), objIdent is not used.
CALL [] ProcName [(paramIdent1 [,paramIdent2]...)] ...
The errors signed by the symbol * are generated in the called script. Called script (CALL action) ma detect this error merely during synchronous call and during the notation of an action with assignment. If an error occurs, its code will be assigned to the variable _ret that must be INT type.
Possible types of parameters, see the action PROCEDURE.
The calling of BROADCAST type is obligatory asynchronous. The process name (parameter procIdent) is key word ALL. By performing of this calling, the system distribute automatically a demand on procedure performing to all running processes of D2000 HI or D2000 Event Handler. These processes search all instances (or basic objects) of the scripts that are identified by parameter objIdent and generate the demands on procedure ProcName performing with relevant parameters.
The key word INSTANCE is disabled in this type of calling.
Since the D2000 V8.00.008 R9 the CALL action contains the new feature - optimization of the formal parameter transmission. This feature ensures the formal parameter of RPC procedure is a "link" to the real parameter. This causes the increasing of the speed of RPC procedure calling.
The conditions:
- the calling is realized in the same process *.EVH,
- the calling of procedure is synchronous,
- the parameter must be of Record type,
- the parameter must be IN/OUT.
The key word
PRTY enables to set the priority of executing RPC procedure. The priority is defined by the parameter
prtyIdent after
PRTY.
RPC procedures are also intended for transfer
data containers and a handle to
database connections.
When calling JAPI process, these rules apply:
- objIdent is an empty object (see the example),
- the key word INSTANCE cannot be used,
- RPC procedure, which is an implementation of ESL interface, cannot be called,
- the process identifier (procIdent) must be of IC_HOBJ_EXPR (expression of HOBJ type) type,
- the receiving of calls on JAPI process must be implemented as listener, which is registered by a method D2Session::setRPCListener.
0 komentárov