question

Borja Lorenzo avatar image
0 Likes"
Borja Lorenzo asked Felix Möhlmann commented

How to get subnodes with different token, in a transport (TE)

I would know how to get to subondes into a transporter (resource).

In this case the transporter is a forklift:

1719895804992.png

I would like to use only the Unload activity, but the items contained in the forklift have different tokens. One is 'token.pulled', which comes from a list, and the other is 'token.item', which comes from the Create Object activity (previous activity).

1719895816672.png

I don't know how to get these subnodes.

token.resource.subnodes.length doesn't work.

Thaks in advantace for your help





transportersubnodesunload different items
1719895804992.png (23.9 KiB)
1719895816672.png (27.1 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

I don't understand what's the issue here. You have references to two different items in two different labels. So use two Unload activities and put a different label in each or place the Unload activity into a Subflow and call that two times with a Run Sub Flow activity, passing a different item to the sub flow token each time.

I guess building a loop with a Decide activity would also be possible: Check if there is a subnode in the transporter (token.resource.subnodes.length > 0). If so, unload the first subnode (token.resource.first). If not, send the token to different connections to continue the flow.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Borja Lorenzo avatar image Borja Lorenzo commented ·

The process can function with two Unload activities or with a Run Sub Flow that contains only one Unload activity, as you also suggested trying. Both methods work flawlessly. Upon checking the forklift, there are two items with two different tokens because one item originates from a list and another is generated directly in the forklift. They share the same labels as the first item, but the name of its token is token.item.


Regarding your question, it is possible to unload two items from the forklift using only one UNLOAD activity without employing a Run Sub Flow. I tried item.resource.subnode but didn't work,

where item.resource represents the forklift.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Borja Lorenzo commented ·
An Unload activity only allows you to pass in a single item reference. To unload more than one item you need to do either of the following:

- Use multiple Unload activities
- Use a Subflow
- Use a loop structure
- Use a Move Object activity and pass in an array that contains all items references. This does not use the unload time as specified on the transporter but always happens instantly. You can combine this with a Delay Task activity.


1 Like 1 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Borja Lorenzo commented

A: you append each element of an array by loop structure to a new empty array by source code snippets in process flow or writes a complete source code.append-values-as-flatten-array.jpg

B: you push your arrays and single value references onto a list. Then all array values occure as single values in this list. You can pull the complete list entries and you get an array of entries.


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Borja Lorenzo avatar image Borja Lorenzo commented ·

Thank you for your proposal. I would like to know if there is any expression to use in the "item" box to retrieve all contents of a transporter in that case, using only one Unload activity and without using Run subflow or adding tables or more custom codes.

1719907677943.png

Thanks in advance

0 Likes 0 ·
1719907677943.png (9.3 KiB)