<< Click to Display Table of Contents >> Navigation: Connectors > Smallworld > Routine Calls > Registration |
The Smallworld Connector provides a set of methods for the purpose of registering routine objects. These methods should be used in a registration script that is executed after the Connector is loaded into the Smallworld image and before the Connector is activated (see Environment).
A.Exemplar Type Registration
dts_manager.register_type(
p_dts_key,
p_exemplar,
p_slots)
▪p_dts_key: the key by which this type will be known throughout DTS
▪p_exemplar: the slotted exemplar the type describes (this should be the actual exemplar, not just its name)
▪p_slots: the slots on the exemplar that should be included in the type as a vector of this form:
{
{<name>, <dts_type>, <options>...},
...
}
o<name>: the name of the slot on the exemplar
o<dts_type>: the DTS type key for the slot. Can be a pre-defined type, or a compound type that has already been registered using this method or the next one.
o<options>...: a list of key-value pairs defining various options for the slot
•The only option currently supported is :is_vector?, which expects a value of _false or _true and determines if the parameter is a <dts_type> or an array of <dts_type>. If not provided, the default is _false.
The Smallworld Connector will strictly adhere to the types it is instructed to used on each slot. If it is provided with a different object type, communication may fail.
B.DS Type Registration
dts_manager.register_ds_type(
p_dts_key,
p_collection,
p_fields)
▪p_dts_key: the key by which this type will be known throughout DTS
▪p_collection: the collection that this type describes (this should be a handle on the actual collection, not just its name)
▪p_fields: the fields from p_collection that should be included in the type as a vector of field names:
{<field1>, <field2>, ...}
C.Remote Call Registration
dts_manager.register_api_call(
p_dts_key,
p_name,
p_parameters,
p_results,
_optional p_options)
▪p_dts_key: the key by which the remote call will be known throughout DTS
▪p_name: the name which will be used to invoke the method or procedure locally
▪p_parameters: the input parameters of the method/procedure as a simple_vector of this form:
{
{<dts_type>, <options>...},
...
}
o<dts_type>: the DTS type key for the parameter. Can be a pre-defined type, or a compound type that has already been registered using one of the type registration methods
o<options>... : a list of key-value pairs defining various options for the parameter.
•The only option currently supported is :is_vector?, which expects a value of _false or _true and determines if the parameter is a <dts_type> or an array of <dts_type>. If not provided, the default is _false.
▪p_results: the outputs of the method/procedure, in the same form as p_parameters, except:
oSingle results can also use the :stream? option with a value of _true or _false, which determines whether the routine will produce a stream output.
Routines that have a result marked as stream, should only have that single result - registering multiple results will cause errors.
For more information regarding stream-valued routines in Smallworld, please see the dedicated documentation page.
▪p_options: a property_list containing various options for the remote call
o:procedure? : (_true or _false) represents whether or not this call is to a procedure. If _false, the call is to a method and a :target option is also expected. The default value is _true.
o:target : the name of the exemplar which will be used to invoke the method.
Methods are invoked statically on the exemplar provided in p_options[:target], so it should function as a singleton in when receiving the p_name message
p_name and p_options[:target] should be fully qualified with the package name, as well as brackets (if required)
The Smallworld Connector will strictly adhere to the types it is instructed to used on each parameter. If it is provided with a different object type, communication may fail.