Rank: Advanced Member
Groups: Registered
Joined: 6/23/2015(UTC) Posts: 59 Thanks: 5 times
|
Within a control action I want to iterate over elements to save and mark them as "saved" at once. The Loop action seemed to be suitable but it doesn't allow modifications to the sequence beeing iterated. What's best approach to solve this? Thanks for any hints.
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 7/21/2014(UTC) Posts: 498
Was thanked: 88 time(s) in 88 post(s)
|
I would use a single Update Node(s) call instead - will be much quicker.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/23/2015(UTC) Posts: 59 Thanks: 5 times
|
Thanks for reply. Can you give some more details please. I'm using the loop action to save any selected nodes. HTTP:success within the loop would be the right place to update a node, but this isn't allowed. Where would you place the mentioned Update Node(s).
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 7/21/2014(UTC) Posts: 498
Was thanked: 88 time(s) in 88 post(s)
|
My suggestion with Update Node was a guess, because you didn't provide any details on what you are doing. If you have a HTTP action within the Loop, then you must use the Loop indeed. You have now two possbilities:
- You build the loop with count, for example: Variable $i, For Each 1 to count( $MyTree/Root/Nodes ). In this case the sequence used in the loop is built with numbers - not source tree, and the source tree can be updated. You would access each node of the source tree with $MyTree/Root/Nodes[ $i ]
- You use an indepent tree to set the status and after the Loop you use this tree to Update Nodes in the actual tree
|
1 user thanked bbv for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/23/2015(UTC) Posts: 59 Thanks: 5 times
|
First suggested loop solution looks smart and works without overhead. Many thanks.
|
|
|
|
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.