Action chain sequencing is failing

Hi all,

I have a set of 4 tables, OrdersCP, Consumable Products, Consumable Packages and Packages. The use case is as follows:

  1. Consumable Products, Consumable Packages are children of (part of) OrdersCP.
  2. A Consumable Package consists of several Consumable Products (each of different quantity.)
  3. An OrderCP contains one or more Consumable Products and one or more Consumable Packages
  4. When a Consumable Package is added to an Order, its constituent Consumable Products need to be added to the Products table.

I have actions defined to do #4 in tables Orders, and PkgItems and it works fine if there is 1 PkgItem in an order but it doesnโ€™t work when there are 2 or more PkgItems in an Order.

The action chain doesnโ€™t seem to process the PkgItems in sequence and creates more lines in Consumable Products than needed.

Here are the actions and some details I have set up.

  1. Action Add Package Items

  2. Action Add to CP Order: loop

  3. Action Add to CP Order: add item

  4. Action Add to CP Order: incr copied

  5. Action Add to CP Order: repeat

This seems like a bug but maybe there is a different way to set it up. I think the repeat action is the culprit but I am not sure.

@Steve @Aleksi @Phil - any suggestions?

Thanks.

Solved Solved
0 7 361
1 ACCEPTED SOLUTION

Iโ€™m still not quite understanding the data hierarchy, and exactly which data is used to create the records.


One way that Iโ€™ve converted an โ€œexecuteโ€ฆโ€ action, in order to make it run in serial, is as follows.

Child records in this case already each had a sequence number (1,2,3,4โ€ฆ) for them to be run in. I then added a Y/N Type [Complete?] column to each.

The Parent record had an โ€œexecuteโ€ฆโ€ action, which ran the Childโ€™s action, but only on the single record that matched

MINROW( โ€œchildโ€ , โ€œsequence numberโ€ , NOT( [Complete?] ) )

The Childโ€™s action was a group of 3 actions.

  1. Execute the desired action.
  2. Set [Complete?] to TRUE
  3. Loop. this is an โ€œexecuteโ€ฆโ€ action pointing back to the Parentโ€™s โ€œexecuteโ€ฆโ€ action.

View solution in original post

7 REPLIES 7

I donโ€™t understand what the loop is for? Since youโ€™ve already specified the action to run on all related Consumable Packages. Seems to me like that would create n^2 number of records, instead of n. Maybe I misinterpreted though?

The loop is for copying n items (of Consumable Products) from Consumable Packages to Consumable Products. So, say Pkg1 has 2 items and Pkg2 has 3 items, I need 5 rows in Consumable Products.

Ideally I would like to set it up so that rows in Consumable Packages are processed in sequence (so, Pkg1-Item1, Pk1-Item2, Pkg2-Item1, Pkg2-Item2, Pkg2-Item3) but what I see happening is that it doesnโ€™t. It seems to be doing Pkg1-Item1, Pkg2-Item2, Pkg1-Item2 etc.

Well I can at least respond to that. โ€œExecute an action on a set of recordsโ€ does NOT execute in serial order. See the following thread

Clarification: Does Consumable Packages have an EnumList column where the products are selected, and then you want those to be converted to Consumable Product records?

Thanks for that link to the other thread.

Orders CP has child records of Consumable Packages which are Packages so yes, there is a List of Consumable Packages that each member of the List needs to be processed one after another. I think I need to add a looping variable for that in the actions but not sure where and how.

I have logic for controlling the inner loop but not the outer loop, if that makes sense.

Iโ€™m still not quite understanding the data hierarchy, and exactly which data is used to create the records.


One way that Iโ€™ve converted an โ€œexecuteโ€ฆโ€ action, in order to make it run in serial, is as follows.

Child records in this case already each had a sequence number (1,2,3,4โ€ฆ) for them to be run in. I then added a Y/N Type [Complete?] column to each.

The Parent record had an โ€œexecuteโ€ฆโ€ action, which ran the Childโ€™s action, but only on the single record that matched

MINROW( โ€œchildโ€ , โ€œsequence numberโ€ , NOT( [Complete?] ) )

The Childโ€™s action was a group of 3 actions.

  1. Execute the desired action.
  2. Set [Complete?] to TRUE
  3. Loop. this is an โ€œexecuteโ€ฆโ€ action pointing back to the Parentโ€™s โ€œexecuteโ€ฆโ€ action.

Cool, thanks @Marc_Dillon. This will work for me, I think. Let me try.

Top Labels in this Space