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.

images/download/attachments/177913538/image-2024-9-24_14-45-19-version-1-modificationdate-1727181918877-api-v2.png

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.

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:

  1. A single selection within an overview or the opened input form identifies exactly one shipment for which a time slot booking is generated.

  2. 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'.

  3. An event handler reacts to the event 'Create bookentry from shipment' and executes the event action Create bookentry from shipment.

  4. 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.

  5. 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:

images/download/attachments/177913538/image-2024-9-24_14-45-29-version-1-modificationdate-1727181928837-api-v2.png

Parameter/Enumeration/Field

Field name (internal)

Package types

packageType

Type of vehicle

typeOfVehicle

Kinds of goods

kindOfGoods

Mode of transport

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:

  1. The attribute type must be applicable for the 'Time slot booking' entity type (see Input forms for time slot booking for applicable attribute types).

  2. Plural attributes cannot be copied even if they are applicable to a 'Time slot booking' according to their type. The 'Example' (below) shows how they can be transferred.

  3. The value resolver for All attributes of one type cannot be used to copy attributes of a type across the board.

images/download/attachments/177913538/image-2024-9-24_14-46-41-version-1-modificationdate-1727182000862-api-v2.png

Via the symbols images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg and images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/forbidden.svg configurations for Copy attributes can be added or removed. Within each instance created, a value resolver must be used that returns a complete, single attribute of the shipment that is applicable by type to the time slot booking. Typically, a Typed attribute resolver is used for this purpose.

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:

  • Since a 'toxic waste' shipment in our case should always be 'bulk', only two numerical attributes Gross volume and Gross weight are provided. For planning the unloading, only the 'Gross volume' in the binding preset Volume unit 'Cubic meter' is decisive.

  • The time attribute Arrival date planned provides information about the scheduled time of delivery.

  • The company attribute Carrier specifies the company responsible for the transport.

  • The following 'Reference attributes' qualifes various characteristics of the shipment, each of which can occur either once or multiple times.

  • A list of container identifiers in the plural text attribute Container No follows below, which makes it possible to trace the origin of the shipped waste if required.

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:

images/download/attachments/177913538/image2021-8-30_9-29-51-version-1-modificationdate-1727181487716-api-v2.png

images/download/attachments/177913538/image2021-8-30_9-35-57-version-1-modificationdate-1727181487714-api-v2.png

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 Validating rule here combines a type check for the 'Shipment' entity type with an object field rule that checks whether the shipment type 'Toxic waste disposal' is specified. Details on this are omitted.

    NOTE◄ The Triggering event provides the same shipment as the only element of a list in the shipments variable. Only this is immediately processed by the event action Create bookentry from shipment.

The Action on passed rule is first shown here in overview and will be highlighted in more detail in the following sections:

  • In the first step, the event action Create bookentry from shipment is executed to create a time slot booking for the shipment and initialize it using the means of the event action.

  • The following Execute with event action accesses the created time slot booking via the header variable, which should be present in it as the only element of a list after the Buchungseintrag aus Sendung erzeuge event action has been executed. In addition to adjustments to the time slot booking that are not directly possible via the dafault functions, a reference to the newly created time slot booking is also set up in the shipment data in the process.

  • Finally, the event action Save changes later for must be executed with the shipment as the reference object so that the created reference is saved.

images/download/attachments/177913538/image-2024-9-24_16-36-50-version-1-modificationdate-1727188609418-api-v2.png

The event action Create bookentry from shipment is configured as shown on the right:

  • In the Create bookentry from shipment tab, some of the optional parameters are used to define static assignments for fields of the new time slot booking. The following classification should apply to all shipments for which the Validating rule (see above) applies:

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.

images/download/attachments/177913538/image-2024-9-24_16-37-26-version-1-modificationdate-1727188645803-api-v2.png Copy attributes tab:
images/download/attachments/177913538/image-2024-9-24_16-39-5-version-1-modificationdate-1727188744631-api-v2.png

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:

  • Within the Execute with event action shown on the right, the time slot booking is first defined as a different reference object for the subsequent event actions. The event action Create bookentry from shipment returns the time slot booking via the header variable as the only element of a list that was previously initialized when the event was executed (empty). The List item value resolver concatenated with the Variable value resolver with the Offset value of 0 defines first (here: only) element of the list.

  • The following Set value event action assigns a string to the Remarks (remarks) field that is generated from a list of all reference attributes (see All attributes of one type) via Collect values as a Concat strings of Reference type and the value of the 'reference' (reference) per attribute. The output can be seen in the runtime example above. Details are omitted.
    NOTE◄ The 'references' are only reproduced informatively by the concatenation. Systematic access to individual values is then only guaranteed to a limited extent. For the controller responsible for planning, the mirroring of the shipment data in this form should be sufficient.

  • The following Set value event action transfers the 'Container No' list from the plural text attribute of the shipment directly to the corresponding attribute of the time slot booking. Here, for source and destination, the Plural typed attribute resolver can be used successfully – unlike the Copy attributes tab of the Create bookentry from shipment event action.

  • With Save changes later, the new time slot booking is then marked for saving at the end of the transaction. This will immediately assign an ID to it. Which is needed for the next step.

  • Per Set value, the ID of the new time slot booking is noted as 'linkedEntityId' in a linked entity attribute (with the 'Time slot booking' type – SHIPMENT_TO_BOOKING) provided for this purpose in the shipment.

images/download/attachments/177913538/image2021-8-30_9-42-46-version-1-modificationdate-1727181487703-api-v2.png

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:

images/download/attachments/177913538/image2021-8-30_9-51-29-version-1-modificationdate-1727181487682-api-v2.png

  • 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).