serialize map/list()

This function can be used to serialise maps and lists.

Serialisation practically only means that objects are put into a form that allows these objects to be transferred to another place (e.g. another profile). There, these objects can then be restored (deserialization).

The function returns the serialised data. For deserialization the function "deserialize map/list()" can be used.

Note: The concept is not intended for mass data.

Parameters


Parameter

Description

a

Name of the map or list to be serialised. Note: If no value is specified (b can also remain empty then), the objects with prefix "autoserialize_" are used, see examples below. The function then has no return value and the variable "VAR_AUTOSERIALIZE_DATA" (if defined) already contains the serialised data right after the function has been executed and not only after phase 3.

b

Value map if a is a map and value list if a is a list.

Examples


Please import the following two profiles and set them active: Profile-serialize.pak, Profile-deserialize.pak.

In profile serialize , the map mymap (with one entry) is serialised. The serialisation data is stored in variable var__SERIALIZED_DATA . The profile then calls the second profile deserialize via Message.

In the second profile, the variable MSG_CALL_var__SERIALIZED_DATA (passed via Message from profile serialize ) is read, the deserialization is executed and the entry is read from the map.

Automatic serialisation/deserialisation


Serialisation and deserialization can also be carried out automatically.

If a new profile is created, the system variable VAR_AUTOSERIALIZE_DATA is automatically created (otherwise please create it manually in both profiles).

If you use the prefix autoserialize_ in names of maps or lists, they are automatically serialised (in the source profile) and deserialized (in the target profile).

Please import the following two profiles and set them active: Profile-auto_serialize.pak, Profile-auto_deserialize.pak. Important note: If you use automatic serialization and deserialization, you do not have to create the described system variable in either the calling or the called profile. In addition, the MSG_CALL_ prefix does not have to be used in the subsequent profile and no explicit deserialization has to be performed. You therefore always have direct and immediate access to automatically serialized maps and lists in the subsequent profile. The same applies to subprofile calls.

For using autoserialization/autodeserialization in workflows, see section Variables (workflows).

Time of autoserialization

Automatic serialisation takes place at the end of phase 3 (or in the event of an error when phase 3 is aborted) or after each record if the option Enter output channels for each record is set. In case the system variable VAR_AUTOSERIALIZE_DATA is to be filled immediately, see parameter a. Important note: When calling functions "start new workflow()", "fire workflow-event()", "add/set workflow variable()" and "call sub profile for source tree()", autoserialization is done immediately and not after phase 3.