opentripmodel / otm5-change-requests

Tracking and reporting bugs and change requests of the OTM5 specification.
5 stars 1 forks source link

Overview OTM5.4 accepted change requests #57

Closed bmeesters closed 2 years ago

bmeesters commented 2 years ago

As done in OTM5.3 I want to create an overview again of all the changes that are projected to make it in OTM5.4. Though there are quite a few improvements, most are very straightforward and do not need much discussion. The most important and extensive addition is the use of contextEvents on entities. This is added to accommodate the new EmissionEvent and FuelConsumptionEvents, so these events can be attached to the entities they belong to.

  1. Improve OTM5 documentation on actors and constraints: https://github.com/opentripmodel/otm5-change-requests/issues/34 status accepted. why the documentation is unclear on how to use them.

  2. Improve documentation on actor roles: https://github.com/opentripmodel/otm5-change-requests/issues/38 status accepted. why the documentation is unclear on what roles are expected and how roles can occur.

  3. Add a TransportEquipmentConstraint: https://github.com/opentripmodel/otm5-change-requests/issues/46 status accepted. why currently it is impossible to create a constraint on what equipment is expect for a trip or consignment. how add a new constraint that can refer to the possible equipment types. example

    {
        "entityType": "constraint",
        "value": {
            "type": "transportEquipmentConstraint",
            "equipmentType": "trailer",
            "equipmentSubType": "refrigerated trailer"
        }
    }
  4. Add averageFuelConsumption to vehicle: https://github.com/opentripmodel/otm5-change-requests/issues/48 status accepted. why the average fuel consumption is often used to calculate tarifs, as well as serve as input to project the emission and consumption on a certain route. how add an optional field to vehicle.The required format is <liter> l/100km. example

    {
        "entityType": "vehicle",
        "licensePlate": "11-AA-22",
        "fuel": "petrol",
        "averageFuelConsumption": "9l/100km"
        // other fields left out for brevity
    }
  5. Add consumption and fuel events, and allow them on entities.

    a. Add emissionEvent and fuelConsumed events: https://github.com/opentripmodel/otm5-change-requests/issues/49 status accepted. why consuming fuel is an integral part of logistics, however it is not possible to communicate either planned/projected and realized consumed fuel. In similar fashion, calculating and tracking emissions is also not possible without adding these events. how Create two new event types. One for consumption and one for emissions. Both will get a value-with-unit and description for additional information. example

        {
            "entityType": "trip",
            "vehicle": {}, // left out for brevity
            "actions": [], // normally stops, moves, etc.    
            "contextEvents": [{
                    "associationType": "inline",
                    "entity": {
                        "eventType": "fuelConsumedEvent",
                        "lifecycle": "projected",
                        "fuel": "petrol",
                        "value": "10",
                        "unit": "l"
                    }
                },
                {
                    "associationType": "inline",
                    "entity": {
                        "eventType": "emissionEvent",
                        "lifecycle": "projected",
                        "value": "10",
                        "unit": "co2e"
                    }
                }
            ]
        }

    b. Add a optional field contextEvents to all entities. status accepted why These fields allow you to provide events that belong to an entity in a single message, which is otherwise impossible. The original request comes forth out of 5a, to be able to attach the emission and consumption events to the trips/consignments they belong to. However there are many other use cases, such as providing the traffic and location events of a vehicle to indicate how an ETA came to be, or possibly the driven (projected or realized) amount of KMs a vehicle made on a trip used for invoice information.

  6. Add sequenceNr to all action types: https://github.com/opentripmodel/otm5-change-requests/issues/50 status accepted. why sequenceNr is already a field on stop, but not other type of actions. This is inconsistent. example

    [{
        "actionType": "load",
        "entity": {
            "consignment": { },
            "startTime": "2022-04-22T10:00Z",
            "endTime": "2022-04-22T11:00Z",
            "sequenceNr": 1
        }
    },
    {
        "actionType": "unload",
        "entity": {
            "consignment": { },
            "startTime": "2022-04-22T11:00Z",
            "endTime": "2022-04-22T12:00Z",
            "sequenceNr": 2
        }
    }]
  7. Add cancelled on action results and receiverAbsent as 'reason' type: https://github.com/opentripmodel/otm5-change-requests/issues/53 status accepted. why currently you can either succeed, fail or partly succeed an actio. However, quite often, an action is cancelled before it even starts. We cannot model this without changing the specification. example

    {
        "actionType": "stop",
        "entity": {
            "associationType": "inline",
            "result": {
                "status": "cancelled",
                "reason": "receiverAbsent"
            },
            // other fields left out for brevity
        }
    }
  8. Fix the documentation regarding entity types for AssociationCreatedEvent: https://github.com/opentripmodel/otm5-change-requests/issues/54 status accepted. why it is not as intended and inconsistent with the rest of the specification.

  9. Add actors to events: https://github.com/opentripmodel/otm5-change-requests/issues/55 status accepted. why all entities can refer to actors that are involved, however events do not have that possibility. Parties using OTM events that serve multiple customs cannot indicate whom the event belongs to. how add an optional actors field that can contain associated actors. example

    {
        "eventType": "locationUpdateEvent",
        "lifecycle": "actual",
        "actors": [
           {
            "uuid": "46653523-a150-4f3b-99e9-5ca9c7c7af6f",
            "roles": ["carrier"],
            "associationType": "reference"
           }
        ],
        "vehicle": {
            "entity": {
                "licensePlate": "AA-BB-CC"
            },
            "associationType": "inline"
        },
        "geoReference": {
            "lat": 52,
            "lon": 7,
            "type": "latLonPointGeoReference"
        }
    }
  10. Add a description to the different constraint values: https://github.com/opentripmodel/otm5-change-requests/issues/56 status accepted, no open discussion points. why constraints can become quite complex and consist of multiple parts. To indicate what a sub-constraint is used for a description is necessary. example

    {
        "entityType": "constraint",
        "value": {
            "type": "andConstraint",
            "and": [
              {
                "description": "block times",
                "type": "timeWindowConstraint",
                "startDateTime": "2021-06-23T10:00:00.000Z",
                "endDateTime": "2021-06-23T13:00:00.000Z",
              },
              {
                "description": "alert thresholds",
                "type": "timeWindowConstraint",
                "startDateTime": "2021-06-23T09:45:00.000Z",
                "endDateTime": "2021-06-23T13:15:00.000Z",
              }
            ]
        }
    }
bmeesters commented 2 years ago

See https://otm5-documentation-api-dev.redoc.ly/#section/Open-Trip-Model for a preview

bmeesters commented 2 years ago

OTM5.4 is now released