Skip to main content

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

  1. Log in to OSPROV with an administrator account
  2. Navigate to Settings in the sidebar menu
  3. 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:

  1. Find the running number in the list
  2. Click the Edit button (pencil icon) for that running number
  3. Modify the Last value
    • This is the last number that was used
    • The next generated number will be this value + 1
  4. 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:

  1. Find the running number in the list
  2. Click the Reset button for that running number
  3. 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

  1. Avoid editing: Only edit running numbers when absolutely necessary
  2. Document changes: Keep a record of any changes made to running numbers
  3. Consider timing: If you need to reset running numbers, do so at logical intervals (e.g., start of a new year)
  4. Use meaningful prefixes: When configuring forms, use prefixes that indicate the type of submission
  5. 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:

  1. Looks up the appropriate running number record based on the entity type and prefix
  2. Increments the "last" value by 1
  3. Formats the number with leading zeros to the specified length
  4. Prepends the prefix
  5. 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.