I’m struggling on implementing a bulk action to change the field of a type called “order number” in order to populate this field with a sequential number.
In the single “create thing” workflow I’m easily getting the order number by using this expression:
order number = do search for “thing”: count + 1
but If I apply the same expression into an API Workflow make change action, I get the same number for all the records.
You’re not reading the very clear explanation in Morgan’s post carefully. You don’t just do this in some random backend workflow, you do this in a database Trigger workflow.
for what I understood, the field change would be applied on a database trigger, order creation in the mentioned example, but what I was looking for was a “bulk execution” of “incremental number” for each thing in my DB.
Ran a database Trigger against c. 250k records. It fired < c. 250k times. Not by that much, but it missed a couple.
Ramble on Sequential Numbering … A huge big massive IBM mainframe system running at an Italian Insurance company absolutely 100% no-excuses had to number invoices and receipts sequentially with no gaps unless you registered those gaps with the government.
The solution was non-trivial and the load testing extensive. We had to single thread a “dealer” to push out numbers. Which nowadays would probably look like an in-memory database (Redis or something like that). Still non-trivial.