Showing results for 
Search instead for 
Did you mean: 

Sequence Generator

Valued Contributor
Valued Contributor

Ever in a situation where you need a sequence generator in a Rulestream model? And need it to persist across saves and re-loads?


Rulestream comes with NextSequenceNumber function..the usage is quite simple:

Result = NextSequenceNumber("SequenceName") where the only argument is the name of the sequence (your own name). This means, you can generate as many sequences as you like. For e.g. one sequence to auto-assign a rule-based partnumber, another sequence to track how many times a formula has been called, etc...


By default, the sequence number is session specific: i.e. it won't persist across saves and re-loads of models. If you want it to persist, all you do is have a user-editable numeric property on the top-level part named "Next<SequenceName>" and that's it. The next time you load your model, it will continue the sequence numbering from the last time you saved the model.