Business Process Automation

Business Number Rule Definitions

This sequence is entered in the Rule Definition field in the Business Number Rule page accessed via Business Process Automation > Power Data > Business Numbers > Business Number Rule.

Each business number rule has a rule definition. Rule definitions contain the instructions that the Business Number Generator (BNG) uses to create the sequence of numbers, letters, and other characters that comprise business number types.

Business number rule definitions define one or more of these elements:

  • Numeric sequences (001, 002, 103,...).
  • Alphabetic sequences (AAA, AAB, AAC,...).
  • Date sequences ( Jun 23 2001, Jun 24 2001,...).
  • Replacement elements (for example, a data field value from a related record).

To learn how to create or edit business number rule definitions, you need to become familiar with their structure and syntax.

Rule Definition Syntax

Every rule definition consists of one or more instructions, which are set in braces, { }. Literal text, if any, appears outside the braces. For example, this is the default rule definition for the invoice ID:

{ dddddddd:id=1}-{nnnn:contexts=1:start=1}

This rule definition consists of two instructions separated by a dash (-). Only the dash is literal text and will appear in the business number exactly as typed.

The instructions in rule definitions specify the variable sequences of characters that will appear in a generated business number. Rule definition instructions have this basic structure and syntax:

{sequence: argument=value}

The sequence part of the instruction, before the colon (:), specifies the number and type of alphanumeric characters that will appear in the sequence. For example, nnnn indicates a four-digit sequence beginning with 0001.

The arguments in an instruction, after the colon, modify the sequence. Instructions can have no arguments, or they can have multiple arguments. For example, this is an instruction with two arguments:

{ nnnn:start=1000:end=4999}).

It specifies a four-digit sequence beginning with 1000 and ending with 4999.

Every argument in an instruction must be preceded by a colon (:) with no following spaces. Some arguments can modify only certain types of sequences, but others are global arguments that can modify any type of sequence.

There are several types of rule definition instructions: numeric, alphabetic, date, replacement, and cross-reference. They are described below.

Instructions for Rule Definitions

  • Alphabetic Instructions: Alphabetic instructions specify rule definitions that include sequences of letters and other non-numeric characters.
  • Cross-Reference Instructions: Cross-reference instructions specify rule definitions that include other rule definition instructions and even entire business number rules.
  • Date Instructions: Date instructions specify rule definitions that include date sequences in various formats.
  • Numeric Instructions: Numeric instructions specify rule definitions that include sequences of numbers.
  • Replacement Instructions: Replacement instructions specify rule definitions that include data field values from specified business objects.

Global Arguments

Global arguments can modify any type of rule definition instruction. Certain global arguments are especially useful because they can relate one instruction to another instruction in a rule definition.

Global Arguments

Function

padchar

Pads a sequence that is shorter than the specified length with extra characters. Alphabetic sequences are padded to the right. Numeric sequences are padded to the left.

If no padchar argument is used in an instruction, the specified sequence is a maximum length, truncating longer values. With a padchar argument, the sequence is a fixed length, truncating longer values and padding shorter ones.

For example, { rrrr: xml=SERVPROV} truncates a Service Provider ID of ACMEFREIGHT to generate the sequence ACME. In contrast, { rrrr: padchar= : xml=SERPROV} pads a Service Provider ID of UPS with an extra space to the right to generate the sequence UPS[space].

id

Identifies a sequence for reference and use in another instruction, which usually contains a contexts or parent argument. In other words, id is a sequence-labeling argument. The value for an id argument can be any name or number.

For example, { dddddd: id=date}-{nnn: contexts=date} specifies 010101-000, 010101-001, 010101-002,..., 010102-000, 010102-001, etc. Notice that the context sequence recycles when the date sequence changes.

contexts

Relates a sequence to another sequence, which is identified by an id argument, in another instruction. See the above example.

parent

Relates a sequence to another sequence in another instruction as a parent/child. The parent sequence is identified using id. A child sequence identifies its parent sequence by using parent. When a parent sequence is recycled, so are its one or more child sequences.

For example, { nnn: parent=charlie}-{nn: id=charlie:start=1} specifies 000-01, 000-02, 000-03,..., 000-99, 001-01, 001-02, etc.

Named Range

The term "named range" represents a series of pre-assigned numbers received from a single source such as a service provider and used in a given context such as shipment reference number (BM - Bill of Lading). When a Named Range is referenced in a business number rule definition, a number from the range is used as part of a complete business number.

The business number picture segment type of "p" is used for pre-assigned numbers. The syntax is illustrated in the following rule definition:

JB-{p: range=TESTRANGE: default=BM_DATE_RULE}

The above rule generates business numbers by concatenating a prefix " JB-" and a number from a range named " TESTRANGE". If the range has run out of numbers, the business number rule BM_DATE_RULE is used in place of the range.

There are arguments to the "p" segment:

Argument

Explanation

Required

range=<name>

ID of a Named Range as defined in Power Data > Business Numbers > Named Range. A named range my be dynamic by including a %; see below for more details on dynamic ranges.

Yes

default=< bn rule>

ID of a business number Rule to use when the numbers in the named range have been depleted.

No

Dynamic Range

Dynamic ranges allow you to flexibly assign values to the range at the time of number generation. A dynamic range is indicated by including a % in the range declaration. The system recognizes the % as the start symbol for a dynamic range. The value after the % is the context ID.

For example:

The rule is:

{r*:id=1:xml=SERVPROV}-{p:range=%1}

The ranges are:

FRAMES with a rule defined as {nnnnnn:start=300000}
JB_HUNT
with rule {nnnnnn:start=200000}
WERNER
with rule {nnnnnn:start=100000}

So when you generate the number, if the service provider is WERNER, the system designates the range to be:
{p:range=WERNER}

Generating Numbers

When a named range is referenced in a business number rule, the current pre-assigned range for the named range is used to generate a number. When all the numbers in the current range are depleted, it is marked closed and the next range is set as the current one. The current pre-assigned range for a name range is the first one from a list of open ranges ordered by sequence number.

An optional default business number rule may also be provided to a named range. The default rule is used when all effective ranges have been depleted. Numbers generated by the backup business number rule do not support auditing and recycling.

Checksum

A BN picture segment type, checksum, will be used. The letter for the segment is "s", which stands for " checkSum" because letter "c" has already been taken. The syntax for the new picture segment is illustrated in the following rule definition:

DP-{n*:id=1:start=1000}-{s:algorithm=SIMPLE_MOD:parameters=-divisor 7:algorithm_context=1}

The BN engine generates a base number using the base part of the rule definition, DP-{n*:id=1:start=1000}; the checksum is then calculated for { n*:id=1:start=1000} part of the base number using SIMPLE_MOD algorithm; finally, the checksum is appended to the base BN number.

The "s" segment takes the following arguments:

Argument

Explanation

Required

algorithm=<name>

ID of the checksum algorithm, as defined in table bn_checksum_algorithm

Yes

algorithm_context=<id>

Use certain context of the base number for checksum calculation. Use the whole base number if no context is specified

Yes

parameters=<string>

Free format text

No

Note: The current picture string allows padding of numeric numbers.

Oracle Transportation Management provides public algorithms.

Related Topics