- Welcome
- Introducing Babelway B2B Integration
- Starting with Babelway
- Managing Account Environments
- Managing Channels
- The Catalogue
- Tracking Messages
- Managing Alerts
- Managing Your Account
- Best Practices
- Channels
- List of Channels
- View Change Log
- General
- Gateway In
- Message In
- Transformation
- Message Out
- Gateway Out
- Email Gateway Out
- Ftp Client Gateway Out
- SFTP Client Gateway Out
- Ftp Server Gateway Out
- AS2 Gateway
- Http Client Out Gateway
- Web Gateway
- Generic Gateway
- Internal Gateway Out
- Null Gateway
- OFTP Server Gateway out
- OFTP client Gateway out
- Http Out Gateway
- SOAP Gateway
- Soap Client Out Gateway
- X.400 Gateway out
- Aggregator Gateway Out
- Email Gateway Out
- Email Notifications
- Routing
- Testing
- List of Channels
- Building a Channel
- The Catalogue
- Tracking Messages
- Alerts
- Account Management
- Rest API
- Receive Orders From
- Receive Orders from Colruyt
- Receive Orders from Carrefour
- Receive Orders from Brico
- Receive Orders from Castorama
- Receive Orders from Cora BE
- Receive Orders from Delfood
- Receive Orders from Delhaize
- Receive Orders from DEliXL
- Receive Orders from Intergamma
- Receive Orders from Intermarche
- Receive Orders from JavaFresh
- Receive Orders from Makro
- Receive Orders from Match
- Receive Orders from Carrefour France
- Receive Orders from Colruyt
- Integrate Orders with
- Integration with Tradeshift
- Integration with Exact Online or Exact Globe
- Channel:SAP Idoc XML Order05 w/ Http client out
- System Metadata
- ODETTE Messages List
- External References
See: Managing Channels - Message Edit Functions
Create loops to manage repetitive parts of your message definition.
Loops and grouping
A message is based on three node types as defined in the Message Definition chapter.
To specify that a value or a structural node can occur more than once, you need to enclose it in a Loop. A Loop is a virtual node representing the multiplicity of a node or a set of nodes. It is defined by its minOccurs and maxOccurs properties:
MinOccurs defines the minimum number of repetition of the node or the set of nodes that should occur. It may be 0 or any positive number.
MaxOccurs defines the maximum number of repetition of the node or the set of nodes that should occur. It is either a positive number or the value " unbounded " (that represents an undetermined number of repeat).
CSV Sample:
By definition a CSV message is composed of a header containing some header items followed by one or many lines containing line items. The number of line items correspond to the number of header items.
header1,header2,header3,header4 123,aaa,abc,000 456,bbb,def,111 789,ccc,ghi,222 ...
Here is the message tree for this CSV:
The headers and line nodes are structural nodes while header and line items are value nodes. To specify that the line can appear more than once, there is a virtual Loop node enclosing the line node.
Grouping
A Loop can define the multiplicity of a node sequence. To identify a node sequence in a Loop, you must manually group those relevant nodes using one of the following grouping type:
Group By: groups together all nodes having the same value as the Grouping value.
Group Adjacent: groups together all nodes having the same value as the Grouping value, provided that they are also adjacent in the message sequence.
Group Starting With: processes the nodes in the supplied sequence in turn, starting a new group whenever one of the node matches the Grouping value.
Group Ending With: processes the nodes in the supplied sequence in turn, closing the current group whenever one of the node matches the Grouping value.
Loop parameters can be edited by right-clicking on the loop node in the message tree in the in or out message tab durint channel editing.
The grouping value is an XPath expression identifying the grouping pattern.
By right clicking on any node, you can:
Create Loop: to enclose the selected node in a new loop node.
Remove from Loop: to remove the selected node from its parent loop.
Put in next/previous Loop: if the selected node is adjacent to a loop node you can make it join that loop to create a multiplicity on a nodes sequence (in that case, specify a Grouping value ).
Regrouping a Loop
An existing loop can also be regrouped using one of the Grouping type. To do this you can use the Regroup this Loop in the loop contextual menu. This will create a new enclosing loop that requires specifying the Grouping type and the Grouping value.
Example with a DESADV message in a CSV format:
TruckId,PalletId,PacketId,Quantity,Item 1, 1, 1, 5,Item 1 1, 1, 1, 25,Item 2 1, 1, 1, 1,Item 3 1, 1, 2, 3,Item 4 1, 1, 2, 15,Item 5 1, 2, 1, 100,Item 6 1, 2, 1, 2,Item 7 1, 2, 3, 20,Item 8 1, 2, 3, 11,Item 9 1, 2, 3, 9,Item 10 1, 2, 4, 72,Item 11 2, 1, 1, 91,Item 12 2, 2, 1, 423,Item 13 2, 3, 1, 88,Item 14 2, 4, 1, 3,Item 15 3, 1, 1, 12,Item 16 3, 1, 1, 21,Item 17 3, 1, 1, 666,Item 18 3, 1, 2, 3,Item 19 3, 1, 2, 22,Item 20 3, 1, 2, 2,Item 21 3, 2, 1, 211,Item 22 3, 2, 1, 64,Item 23 4, 1, 1, 61,Item 24 4, 1, 1, 17,Item 25 4, 1, 2, 2,Item 26 4, 1, 2, 9,Item 27 4, 1, 2, 85,Item 28 5, 1, 1, 57,Item 29
In this example, we have a loop of lines defining an item to dispatch, where each line has the truck id where the item is stored.
We could regroup this loop of lines by TruckId so we can loop on all trucks and then loop inside each truck on all items in that truck.
To do that we select the Regroup this Loop action on the loop, select the Group By value for Grouping type and set it to ' field[1] ' (as this is the XPath of the TruckId element).
We now have a loop on all trucks and a sub loop on all item in a truck.
We can even go further and decide to group by PalletId and PacketId, that would give us four nested loops, one for all trucks, the next one for all pallets in a truck, the next one for all packets in a pallet and the last one, for all items in a packet.
Loops and Drag and Drop Mapping
Loops from the input message must be mapped to the output if you want to map one of its enclosed nodes. Otherwise the mapper cannot resolve the reference to the node since there can be more than one occurrence of the same node (as defined by the loop).
Loop to loop
Input: loop node
Output: loop node
Effect: ensures that the generated output has the same number of occurence than the input.
Filter: reduces the number of input occurence based on a criterion. See the Filter Function chapter.
If: for each occurence of the loop, checks the condition before generating an output. See the If Function chapter.
Loop to non loop
Input: loop node
Output: structural node or value node
Effect: since the output is not multiple this loop will not generate multiple outputs. It is used to resolve the reference to the input node. By default, the first occurence of a multiple input is used for the output generation. The default behaviour can be changed using a filter.
Filter: use of a criterion to select a specific occurence for the input (like taking the last occurence using 'last()' as a filter). See the Filter Function chapter.
If: checks the condition before generating an output. See the If Function chapter.
Babel Academy
Community Forum
Support



Prev








Up
Reference Manual