'Soft' autonumbering inside a context - is there a simple way of doing this?
I have been contemplating a way to provide 'local' autonumbering, but inside contexts- rather than using global database sequences to drive autonumbering, is there a way of having local iterative numbering without creating as many sequences as there are contexts?
For example, you could achieve this based on whether a specific number is already in use?
e.g. a specific context might start with an unique prefix, such as a product ID, and a subtype initial e.g.
1111_DOC_*.
The rest of the number could then be determined by whether the number is already is use e.g. if 1111_DOC_001 exists, try 1111_DOC_002, then *_003, until successful.
I figured this could be possible, since when manually numbering objects, the 'number already in use' response is rather quick- though maybe not efficient enough to not overburden the system with requests when it needs to check if 900 numbers are valid to create before creating 1111_DOC_901.
You could speed up execution by writing a custom java RuleAlgorithm class that provides numbers based on existing numbers in the system, but configuration purely inside the OIR with no custom class would be even better.
I am well aware the best practice is to inject minimal intelligence into your document numbering as possible, therefore go with e.g. DOC_000001 as the number sequence. This is what I'm currently recommending as well. It does however seem relevant to want context-specific numbering in some cases, all under the same wtobject subtype so they can be searched globally.

