Create bookentry from shipment
See also: Time slot management tool (Events)
Event action – Abstract
Purpose: Creates a time slot booking based on a shipment, which can optionally be assigned static values for specific fields and attribute values from the shipment.
The event action Create bookentry from shipment will create an entity of the 'Time slot booking' type from an entity of the 'Shipment' type (see Shipments).
The time slot booking created can be classified via static assignments for selection fields according to specific criteria for the Time slot management.
The Time slot management module provides its own dynamic enumerations (Package types, Type of vehicle, Kinds of goods, Mode of transport) in which user-defined values for this classification can be stored.
In addition, the values of selected typed attributes can be transferred from the shipment to the newly created time slot booking via the Copy attributes tab.
►NOTE◄ 'Copying' only works for attribute types that are also supported for the 'Time slot booking' entity (see listing under Input forms for time slot booking). Further restrictions are described in the 'Configuration' section below.
The event action Create bookentry from shipment is typically executed to an event handler that reacts to the trigger 'Create book entry from shipment' (see Time slot management tool (Events)). This event is triggered by the ribbon macro command 'Time slot booking/Create' (see Available commands), which provides the following workflow for creating a time slot booking for an existing shipment:
A single selection within an overview or the opened input form identifies exactly one shipment for which a time slot booking is generated.
The command 'Time slot booking/Create' is executed within a ribbon macro (by clicking on a ribbon button) and triggers the event 'Create bookentry from shipment'.
An event handler reacts to the event 'Create bookentry from shipment' and executes the event action Create bookentry from shipment.
Provided that the event action can successfully generate a time slot booking, a Booking overview is opened with the volatile data of the new time slot booking.
The user can edit the created time slot booking there and create or discard it via 'Save'.
The actual 'booking', i.e. the scheduling of the generated time slot booking on a date for a specific loading point, takes place in a separate step within the Booking overview.
Configuration
The event action Create bookentry from shipment expects an entity of the type 'Shipment' (see Shipments) for which another entity of the type 'Time slot booking' is to be created.
In the typical use case (see above) of the event action, the shipment exists as a reference object and input value of the surrounding event handling.
However, the event action does not directly access the reference object (in the variable entity). Rather, it expects a list of shipments as the value of the shipments variable.
In a typical application, the shipments variable contains exactly one element, namely the shipment, which is also the reference object.
However, the preassignment of the shipments variable is only guaranteed if the event handling was triggered by the event 'Create bookentry from shipment' (see Time slot management tool (Events)).
If the event action is to be used independently of the event 'Create bookentry from shipment', an existing shipment can also be assigned to the variable shipments as an element of a list.
But then the header variable must also be initialized with an (empty) list object The event action adds the newly created time slot booking instance to this list (if successful).
The header variable also allows 'post-processing' or saving the created entity if needed (per Save changes later).
If the shipments and header variables are not 'suitably' prepared in the context of the event action Create bookentry from shipment, an error with rollback occurs at runtime.
The Create bookentry from shipment tab contains one selection field each for the specific dynamic enumerations that the Time slot management module provides for the classification of time slot bookings. Each parameter corresponds to a field in the 'Time slot booking' data model, for which a static assignment can optionally be defined: |
|
|
Parameter/Enumeration/Field |
Field name (internal) |
|
packageType |
||
typeOfVehicle |
||
kindOfGoods |
||
modeOfTransport |
||
In the second tab Copy attributes, a Repeatable element optionally allows the configuration of multiple value resolvers for attributes whose value is copied from the shipment to the new time slot booking. ►IMPORTANT◄ Unsuitable configurations for Copy attributes lead to an error with a rollback at runtime. The following rules must be observed:
|
Via the symbols |
Example
The Time slot management is used for scheduling acceptance processes for 'toxic waste' at discrete (un)loading points in a waste management company. For planned shipments with the Shipment type 'toxic waste disposal', it should be possible to create a 'time slot booking' at the push of a button. The time slot bookings created in this way result in a 'worklist' from which the controller responsible for unloading compiles a booking plan for the loading points. Characteristics of the shipment that are relevant for this detailed planning are to be automatically transferred for the time slot booking.
Runtime example:
Shown on the right is a data input form for shipments of the 'Toxic waste disposal' Shipment type with the following characteristics:
As far as this information is relevant for unloading, it should also be visible in a 'Time slot booking'. From the controller's point of view, this data should appear in the Booking overview as shown below: |
|
|
Configuration:
The following configuration applies to a typical usage scenario, i.e. a triggering of the event handling via the ribbon macro command 'Time slot booking/Create' (see Available commands).
However, the action part of the event handling also shows design options that are not part of the typical procedure.
An event handler for the Triggering event 'Create header from shipment' (see Time slot management tool (Events) is created and configured as follows:
The Action on passed rule is first shown here in overview and will be highlighted in more detail in the following sections:
|
|
The event action Create bookentry from shipment is configured as shown on the right:
►NOTE◄ The Type of packaging is not set statically here. In the post-processing of the time slot booking, an assignment for the field could be made starting from data of the shipment. However, this is not necessary. In the second tab, Copy attributes, the Typed attribute resolver is used four times to specify attributes of the program as copy attributes:
At runtime, this configuration causes corresponding typed attributes to be created in the data of the new time slot booking, provided that the shipment contains corresponding data. ►NOTE◄ Whether the Booking overview contains elements for the display of corresponding details (see Input forms for time slot booking) is irrelevant for the creation of the attributes. However, it is crucial that only attribute types are used that are supported in principle for the 'time slot booking' entity. In the present example, against this background, on the one hand the 'Reference attributes' of the shipment are problematic, since this attribute type is basically not applicable in time slot bookings. On the other hand, the plural text attribute 'Container No' cannot be copied with the standard methodology. |
|
Since not all data from the shipment can always be transferred to the newly created time slot booking using the default methodology, here are some options for specific 'post-treatment' of the entity:
|
|
►NOTE◄ In a data input form for 'Toxic waste' shipments, an element for the linked entity attribute can then be included, in which not only the reference to the time slot booking can be seen, but also, for example, its work status:
In the example, the booking overview with the data of the referenced time slot booking can also be opened via a Button (at the very top right).