Running Numbers
The Running Numbers feature in OSPROV manages the sequential numbering system used throughout the application. Running numbers are used to generate unique identifiers for various entities such as submissions, workflows, and forms. This manual explains how to view, manage, and reset running numbers in the system.
Accessing Running Numbers
- Log in to OSPROV with an administrator account
- Navigate to Settings in the sidebar menu
- Select Running Numbers
Understanding Running Numbers
Running numbers in OSPROV are used to generate unique identifiers with the following format:
PREFIX + SEQUENTIAL NUMBER
For example: SUB-000001, WF-000023, FORM-000007
The system maintains separate running number sequences for different entity types:
- Submissions: Used for workflow submissions
- Workflow: Used for workflow definitions
- Form: Used for form definitions
- Custom: Used for custom entities
Running Numbers List
The Running Numbers page displays a list of all running number configurations in the system, including:
- Name (entity type)
- Table (database table)
- Prefix (text prefix used)
- Last (the last number used)
- Action buttons (Edit, Reset)
Editing a Running Number
To edit a running number's current value:
- Find the running number in the list
- Click the Edit button (pencil icon) for that running number
- Modify the Last value
- This is the last number that was used
- The next generated number will be this value + 1
- Click Save to update the running number
Warning: Editing running numbers can potentially create duplicate identifiers if not done carefully. Only edit running numbers when absolutely necessary and with a clear understanding of the consequences.
Resetting a Running Number
To reset a running number to zero:
- Find the running number in the list
- Click the Reset button for that running number
- Confirm the reset when prompted
Warning: Resetting running numbers will cause the system to start generating identifiers from 000001 again. This should only be done in specific circumstances, such as at the beginning of a new year if your organization uses year-based numbering.
How Running Numbers Are Used
Running numbers are automatically used by the system in various places:
Workflow Submissions
- Each new workflow submission receives a unique identifier
- The prefix is typically defined in the form settings
- Example:
REQ-000123
Workflows
- Each workflow definition receives a unique identifier
- The default prefix is "WF-"
- Example:
WF-000045
Forms
- Each form definition receives a unique identifier
- The default prefix is "FORM-"
- Example:
FORM-000089
Best Practices for Running Numbers
- Avoid editing: Only edit running numbers when absolutely necessary
- Document changes: Keep a record of any changes made to running numbers
- Consider timing: If you need to reset running numbers, do so at logical intervals (e.g., start of a new year)
- Use meaningful prefixes: When configuring forms, use prefixes that indicate the type of submission
- Plan ahead: Consider how many digits you'll need for your numbering system based on expected volume
Technical Details
How Running Numbers Are Generated
When a new identifier is needed, the system:
- Looks up the appropriate running number record based on the entity type and prefix
- Increments the "last" value by 1
- Formats the number with leading zeros to the specified length
- Prepends the prefix
- Returns the complete identifier
Custom Running Numbers
For custom implementations, developers can use the following methods:
// Generate a number with prefix and 6-digit number
RunningNumber::generate('custom', 'PREFIX-', 6);
// Result: PREFIX-000001
// Generate just a sequential number without formatting
RunningNumber::generateSimple('custom');
// Result: 1
By properly managing running numbers, you can ensure that all entities in your OSPROV system have consistent, sequential, and unique identifiers.