Object to client xml
Value resolver – Abstract
Purpose: Returns the data structure of the input value as text in client XML format.
See also: Client xml to object
The Object to client xml value resolver returns the data structure of the input value as text in client XML format (see XML data encoder).
The Class field name parameter defines the name of the XML attribute to be used in the output format to declare the 'class' of objects.
Configuration
The Class field name parameter allows the input of a static text as a Text field, which is used in the output format to declare the 'class' of objects within the XML structure.
The default value is the class string.
If no Class field name is specified, the reference to the data type in the output XML is omitted without replacement.
►IMPORTANT◄ The default value for the Class field name parameter can be overwritten in the configuration technically with any static string. However, only 'names' that are also suitable as XML attribute names should be specified here. If the specified Class field name contains invalid characters (special characters, spaces), the encoder fails at runtime with an error message.
Examples
The same configuration always forms the basis for the following examples of the Object to client xml:
The dispatch of an e-mail notification is triggered by different triggering events (not shown in the image). The most important details of the 'situation' in which the event was triggered are reproduced as client XML in the e-mail attachment:
As shown on the right, the required information in the Object Resolver parameter of an Execute with event action is packed by a Create list value resolver into a list that is the reference object for the following E-Mail event action. ►NOTE◄ The variable contextEntity (see Save Object in variable parameter) can be used to access the entity in the data context of the triggering event, e.g. to use its data in the subject or the body of the e-mail. |
|
Example: List object as default client XML
On the right, the configuration for the Attachments tab of the E-Mail event action attaches the contents of the unspecific list of objects (Objekt[]) present as the reference object of the event action to the generated e-mail in the default client XML format (with the Class field name class). The attached file is assigned the File name '.log.xml' and the Mime type text/xml by statically defined texts. |
|
Runtime example:
|
Client XML (with Class field name: class)
< Object class = "list" > < item class = "de.lobster.scm.denum.DynamicEnumDto" > < enumName >de.lobster.scm.actionevent.CustomActionEvent</ enumName > < name >XF_TEST</ name > </ item > < item class = "java.lang.Long" > < value >1901</ value > </ item > < item class = "string" >Super user limited</ item > < item class = "de.lobster.scm.utils.date.DateTime" > < dateValue >1647820800000</ dateValue > < timeZone class = "string" >UTC</ timeZone > </ item > </ Object > |
Example: List object as client XML with non-standard 'Class field name'.
The configuration on the right is unchanged except for the different value clazz for the Class field name parameter. |
|
Runtime example:
|
Client XML (with Class field name: clazz)
< Object clazz = "list" > < item clazz = "de.lobster.scm.denum.DynamicEnumDto" > < enumName >de.lobster.scm.actionevent.CustomActionEvent</ enumName > < name >XF_TEST</ name > </ item > < item clazz = "java.lang.Long" > < value >1901</ value > </ item > < item clazz = "string" >Super user limited</ item > < item clazz = "de.lobster.scm.utils.date.DateTime" > < dateValue >1647820800000</ dateValue > < timeZone clazz = "string" >UTC</ timeZone > </ item > </ Object > |