Business Process Automation

Replacement Instructions

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. This is entered in the Rule Definition field in the Business Number Rule page.

Replacement instructions specify rule definitions that include data field values from specified business objects. For example, a replacement instruction could specify that the business number rule for Invoice IDs include the relevant Service Provider IDs.

When creating rule definitions the business number context on the business number type provides valid values for the string used in the replacement instruction. On BN rules you define one BN type. That type has a specific context associated with it. In the example below, SERVPROV is one of the valid replacement values for the BN context for the BN type that is associated with the BN rule.

Replacement instructions can be modified by XML and substring arguments and have this basic structure and syntax:

{ r*: xml=value}

The r* specifies a replacement sequence, with no maximum length. The xml argument specifies a value for the sequence from an allowable data field. For example, { r*: xml=SERVPROV) specifies that the replacement sequence is a Service Provider ID.

Replacement instructions are usually modified by global arguments so that other sequences can be appended to them. For example, here is the default business number rule for the Auto-Pay Invoice ID:

{r*:id=1:xml=SERVPROV}-{nnnnnn:contexts=1:start=1}

It specifies a sequence that begins with a Service Provider ID and is followed by a six-digit number. The numeric sequence will start at 000001 for each Service Provider ID.

Using Substring Arguments

Replacement instructions can be further modified by using a substring argument. Substring arguments specify that only a certain string of characters be used from an xml value.

Substring arguments have this structure and syntax:

substring=<from>[,<to>]

<from> and <to> specify the start and end of the string of characters that should be used from the xml value. All other characters in the xml value will be removed in the replacement sequence.

<from> stands for the number of the first character (with zero designating the left most character) that should be used (that is, not removed). For example, to use only the company name XYZFREIGHT from the Service Provider ID GUEST.XYZFREIGHT, you would write this instruction:

{ r*: xml=SERVPROV:substring=6}

The optional [<,to>] stands for the number, at least one greater than <from>, for the first character in the xml value to remove from the string. For example to use only the domain name GUEST from the Service Provider ID above, you would write this instruction:

{ r*: xml=SERVPROV:substring=0,5}

Using Smart Delimiters

To better handle a scenario where the replacement instruction does not return a value within a Business Rule, the r segment (i.e. the segment specifying XML macro replacement) has been enhanced to support an optional delim parameter. Consider the following picture string:

OTM-{r*:xml=OWNER/TYPE} {r*:xml=OWNER/ID}-{r*:xml=TYPE}-{nnnnnn}

This will generate a business number keyed by owner and type. E.g., assume we are generating a bill of lading for shipment S1. We will have a uname of:

OTM-SHIPMENT S1-BILL OF LADING-000001

which is straightforward to search on and identify. If the type and ID were not available, we could have:

OTM- --000003

To better handle these cases, the r (i.e. XML macro) segment has been enhanced to take a delim parameter. This is the delimiter applied if and only if the XML macro exists and has a non-zero length. In this way, we can rewrite the initial picture as:

OTM-{r*:xml=OWNER/TYPE:delim= }{r*:xml=OWNER/ID:delim=-}{r*:xml=TYPE:delim=-}{nnnnnn}

The resulting business numbers will be:

OTM-SHIPMENT S1-BILL OF LADING-000001

OTM-STOP ANALYSIS-000002

OTM-000003

Related Topics