Calculate dangerous goods points
Resolver – Abstract
Purpose: Evaluates the dangerous goods attributes contained in the reference object to determine an overall score in conjunction with the ADR details of the respective dangerous goods substance.
The Calculate dangerous goods points resolver evaluates dangerous goods attributes in the context of the reference object, in order to calculate dangerous goods points based on the ADR details of the dangerous goods substance.
Manifests, Shipments, Orders or a Common business object are suitable input objects for this evaluation.
Besides, the resolver also accepts individual line items of these business object types as input objects. In this case, only dangerous goods attributes linked immediately to the line item (via a 'product') are evaluated. Sub-items must be evaluated individually, as they are not part of the data structure of the parent line item.
The evaluation applies the following calculation for each relevant dangerous goods attribute:
The relevant quantities are derived from property Outer quantity (outerQuantity), which combine indications of Outer quantity value (value) and Outer quantity unit (unit), featuring choices for the unit based on dynamic enumerations Weight & mass units and Volume unit. Selected units are converted to one of the base units for dangerous goods points, which are predefined as 'Litres' (l) for volume units or 'Kilograms' (kg) for units of mass. Valid definitions for these conversions must be provided in the definitions of the respective dynamic enumerations.
The relevant quantity is rounded down to an integer number of base units (l or kg) for each individual dangerous goods attribute.
CAUTION
As decimals are 'implicitly truncated' as part of the evaluation, each affected dangerous goods attribute will contribute less dangerous goods points to the total than it would according to different calculation/rounding rules. Whether this practice is acceptable for a given application context of the resolver, should be subject to careful consideration. In case of doubt or to meet specific requirements, the calculation process should be designed explicitly (e.g. involving a For each loop in an event handler).
The integer value for the relevant quantity of a dangerous goods attribute is multiplied by the Multiplier (multiplier) defined as part of the master data indicated as ADR details for the relevant dangerous substance. The product of these factors defines the dangerous goods points of the dangerous goods attribute.
The value returned by the resolver is the total of all dangerous goods points evaluated from individual dangerous goods attributes. As this return value is defined to be of type Long, a value of 0 is also returned, if no dangerous goods attributes are found at all.
Configuration
The Calculate dangerous goods points value resolver expects a reference object that contains or can contain dangerous goods attributes.
It does not use parameters.
Example
An association criterion is designed to discriminate, whether or not the total of dangerous goods points evaluated for shipments joined by a manifest exceeds a certain limit (here: 1000 points).
Configuration:
The association criterion is configured as shown on the right:
►IMPORTANT◄ Observe the warning regarding rounding effects (item 2 in the calculation procedure above), if operative decisions depend on this type of association criterion. |
|