Defines an element in the integration message.
Usage
<modifiers> element xml-nametype-definition
<modifiers> element xml-name { field-definition1 ... field-definitionn }
Modifiers
Modifier | Description |
---|---|
optional | Use it to make an element or attribute optional in the integration message. This modifier sets the initial value of the associated element or attribute to null in the workflow script representation of the message. This modifier is not available for the root element of the integration message XML hierarchy. |
unordered | Use this modifier to make the integration message schema accept child elements for an element in any order, not only the order they are declared in. |
Parameters
Parameter | Description |
---|---|
xml-name | The name of the element's XML node in the integration message. |
type-definition (required) | The type definition for the element. |
field-definition (required) | One or more element field definitions (attributes, child elements, or text node content - see the remarks for restrictions). |
Remarks
In general, to get or set the values in an element, or to create a new schema-conformant element in a workflow script, use dot notation.
A sample integration message schema with a complex element:
A workflow script that accesses the values of the complex element in a message that conforms to the schema above:
A
workflow script (triggered by the chuck.fls.xml
form) that creates and populates an integration message
that conforms to the schema
above:
When accessing the attributes or child elements of optional
elements in a
workflow script,
Figure 426. An integration message schema with an optional
parent element, used
in the workflow script samples below
you need to first check if the parent element exists to prevent a
null-reference:
For optional
XML nodes that do not have child
nodes, such as attributes or text node elements, you only need the script to explicitly
check for a null value if a null value would break the solution.
When creating
optional elements in a workflow script, use the [Name]New()
method:
The
sample script below is triggered by the cluck.fls.xml
webform, and uses the
optionalParent.dacsem
schema from
above.
Mixed content, that is, XML elements with both text nodes and child elements, is not supported in the integration message schema language. No valid integration message schema could declare the sample XML below.
Child elements and lists, however, may be declared on the same parent element:
Samples
Some of the workflow scripts in the samples below are
triggered by incoming integration messages. Others are referencing integration message schema
so that they can create outgoing integration messages. To try the following samples out for
yourself, you'll need to upload an intconf.xml
file that defines inbound and outbound integration endpoints
and the integration messages and schema that they accept, so that these workflow scripts can
reference them. You'll also need to create the inbound and outbound endpoints on your
Cloud instance that match the names specified in the intconf.xml
file.
Simple text node element
Accessing an integration message XML element value in a workflow script
Assigning a new value to an integration message XML element in a workflow script
Download the
inky.fls.xml
trigger form for the script
below.
Element with an attribute and text node content
Accessing an integration message XML element value in a workflow script
Assigning a new value to an integration message XML element in a workflow script
Download the pinky.fls.xml
trigger form for the script
below.
Element with child element
Accessing an integration message XML element value in a workflow script
Assigning a new value to an integration message XML element in a workflow script
Download the blinky.fls.xml
trigger form for the script
below.