MLFB - Machine-readable Product Indication¶
The MLFB is the most common numbering system at Siemens. The module should be able to validate if the MLFB is correct and following the defined syntax. Moreover, it should format the number into output formats. Consuming systems are using the module to validate and format their numbers before persisting or sending data or validate user input behind user interfaces.
Original PDF:
MLFB.pdf (SN 01030)
Identification¶
1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|
N | A | A | N | N | N |
Additional checks: An MLFB consists of at least block 1. The minimum assignment ob block 1 comprises data positions 1 to 6.
9
or Z
within the MLFB as an identifier for "Further Basic Technical Data" and identifier -Z
for "Special Options".
As the root MLFB, a number is recognized that has one or more periods in letter or numeral positions as from data position 5.
Validation¶
As a requesting service, I want to get information if one or more strings I have sent are following the MLFB syntax, that I can ensure to proceed/persist only correct product numbers.
The validation should only be executed for identified numbers.
The return string is called Normbyte and is two characters long. The Normbyte is there to encode validation and classification results.
RegEx (https://regex101.com/r/o4J7vb/1)
^([1-9])([A-HJ-NP-Z]{2})(\d)([\d\.]{2,4}$|[\d\.]{4})(?:([A-HJ-NP-Z\.]{1,2}$|[A-HJ-NP-Z\.]{2}))?(?:([\d\.]{1,3}$|[\d\.]{3}))?(?:([A-HJ-NP-Z\.]{1,2}$|[A-HJ-NP-Z\.]{2}))?(?:([\d\.]))?$
Classification¶
As a requesting service, I want to get information about the state of the number if it is validated as correct, that I have more details about the product number.
The classification should only be executed for valid numbers.
The return string is called Normbyte and is max. two characters long. The Normbyte is there to encode validation and classification results.
NB | Description |
---|---|
F | MLFB without appended -Z and not containing digit 9 and not containing letter Z |
F1 | MLFB without appended -Z and containing digit 9 and/or containing letter Z |
F2 | MLFB with appended -Z and containing digit 9 and/or letter Z |
F3 | MLFB with appended -Z and not containing digit 9 and not containing letter Z |
F7 | Internally assigned MLFB, 7 positions |
F9 | Root MLFB (MLFB that contains at least one special character . at any position) |
Formatting¶
As a requesting service, I want to format my product numbers in two different output formats which are following the numbering standards, that I can ensure my numbers are structured everytime the same.
The formatting should only be executed for valid numbers.
PRINT¶
If Number of digits > 7 then insert hyphen (-
) at position 8
If number of digits > 12 then insert hyphen (-
) at position 13
SORT¶
Clean number without hyphen and blank except appended -Z
at the end of the number.
Shortcode¶
As a requesting service, I want to get information about the state of a short code if it is in combination with a MLFB, that I have more details about the short code.
Input is the MLFB and short code:
- Same MLFB as for MLFB processing in general
- Short Code is a String with maximum of 32
ANN
orANA
patterns, split by+
. (e.g.G1E+Q4W+T11+Y11
)
The result of the classification should be the following:
- Warning code
- Warning message
Every single error has a defined error code of two digits. (e.g. 12
) In case of multiple errors there is an prioritized array with code(int) and type(String) This priority decides which error codes will be displayed.
Example input conditions:
- Normbyte
X
_No error code and type - Normbyte
F
_Optional warnings without maximum amount
The error type is the corresponding textual description of an error. Every error code has an error type.