Skip to content

Add lifecycle to trip and consignment and a way to remark on the lifecycle #4

Closed

Description

@bmeesters

Type of request

  • I'd like to add something to the OTM 5 spec
  • I'd like to change something in the OTM 5 spec

Is your feature request related to a problem?
If so, please describe the problem. For example: with the current specification I cannot model [...]. Or: I'm unable to
provide the use case [...].

Currently Consignments and Trips have a status, but the status options are not complete. It is not possible to mark a Trip or Consignment as Finished/Delivered.

Describe the solution you'd like
What would you like to add or change to the specification? Please be as clear and concise as possible.

The status in a Consignment and in a Trip is remarable similar to the lifecycles we already use. It might be better to deprecate the status and use a lifecycle instead. Also, to support everything the current status can we should have a new lifecycle cancelled. However, sometimes a status alone is not enough, we might want to know why something was cancelled, so we also propose to add a statusRemark. Lastly, the modified field is not very helpful since it does not provide any information on what was modified or when. So a final proposal is to add a 'lastModified to each entity (like the creationdate), it is very easy to determine then whether something was modified (creationDate != lastModified). If you want more information about an audit trail using events is the most appropriate choice.

To sum everything up:

  • Add a lifecycle field to Consignments and Trips.
  • Add a new lifecycle cancelled.
  • Add a statusRemark to entities/actions/events that have a lifecycle.
  • Add a lastModified to every entity.

Describe alternatives you've considered
Did you try to solve it with the current specification? If so, how? Please be as clear and concise as possible.

Another alternative is to extend the status field with completed. However maintaining two lists might be confusing. On the other hand, how should the actions below a 'cancelled' trip behave? Should all of them be cancelled?

Additional context
Add any other context or screenshots about the feature request here.

Activity

  1. bmeesters commented on Mar 4, 2021

    @bmeesters
    ContributorAuthor

    After internal discussion at Simacan the conclusion was that we try to combine things that cannot be combined. In general OTM5 expects nested actions to be of the same lifecycle. For example a load action in a planned stop is expected to also be planned. However if you add a lifecycle to a trip or a consignment this severely limits how you can use the actions within those entities. For example cancelling a trip would require to also change all actions within that trip to cancelled.

    So the proposal from Simacan is to just extend the current Status field with a complete.

  2. thomaskolmans commented on Mar 4, 2021

    @thomaskolmans

    I do not understand how a this would change it to the worse from how it is now, the opposit actually. Let's say you cancel a trip, the lifeCycle of the related actions are now still "active" and that does not make sense to me either. It would make more sense to me if you cancel a Trip or Consignment that the underlying actions are also cancelled. I actually really liked the proposed changes, they made total sense to me at least.

    In regards to those last 2 points, what will happen with the "statusRemark" and "lastModified"? I think those are good changes in any case. As well as, will there be a in_transit/active status too apart from the "complete"? Then we pretty much have a full lifeCycle again...

  3. bartkummel commented on Mar 4, 2021

    @bartkummel

    Hi Thomas,

    I was part of the internal discussion mentioned by @bmeesters , so let me explain our considerations.

    If you zoom out, you can see that OTM is merely a language to share data between multiple systems and even multiple domains. That means, there will be multiple states within those systems. Some states might map well to the life cycles in OTM, but others probably won't. (This wil stay true, no matter how many life cycles you would add.) I think the best OTM can do is being transparant about the differences between systems and domains, instead of trying to unify everything.

    The way we envision life cycles is: there are a limited number of life cycle phases that are common to the whole domain that is covered by OTM. And life cycles are limited to actions and events in OTM for a good reason. In OTM, the entities are the constant factor, they exist over all life cycles. The actions and events happen in a specific life cycle. We would like to keep the model clear and keep this clear distinction. There can be an event to cancel something. That might lead to some state field to change, but that has nothing to do with the life cycle. (Note that OTM itself doesn't do anything. It is the systems that "talk" OTM that do stuff, like changing the state of an entity whenever an event occurs.)

    That said, we must not deny that there are multiple systems communicating with each other and that the state of an entity within one or more of those systems is valuable information; OTM should be able to express that information. But I think that, by limiting it to just that –information about the state of an entity in some system– we can keep simple things simple, while staying open to do complicated things with more effort.

    So, what to conclude? I think we should consider:

    • keeping the option open to add more state fields where appropriate;
    • add more enumerated values to state fields where needed;
    • giving state fields more specific names, to be more clear about the intent and prevent confusion;
    • adding a lastModified field, as proposed by Bas;
    • adding specific remark fields where needed and appropriate;
    • keep the number of life cycle phases small and only use them on events and actions.

    I hope this helps and are looking forward to seeing this boil down to concrete improvements in OTM.

    Best regards,
    Bart Kummel

  4. thomaskolmans commented on Mar 4, 2021

    @thomaskolmans

    Hi Bart,

    Agreed! As these objects are clearly statefull and those states are not yet enitrely defined in my opinion. Thus when communicating between systems they will miss vital information right now.

    Look forward to the suggested state fields, in the discussion on the website itself there was an interesting suggestion already.

  5. bartkummel commented on Mar 4, 2021

    @bartkummel

    For future reference, @thomaskolmans is referring to this discussion, I think: https://www.opentripmodel.org/discuss/602ea278d8d02a0035a56952

    I'll leave it to @bmeesters to come with a more concrete proposal.

  6. bmeesters commented on Mar 5, 2021

    @bmeesters
    ContributorAuthor

    I think the suggestions in the opentripmodel.org chat are good. So then the full proposal would be:

    • Add active and completed as status fields on both the consignment and the trip.
    • Add a lastModified to every entity.

    On top of that, a statusRemark would be very useful. However I think we might want more. A realized action for example does not indicate whether something realized successfully or was failed/cancelled. A remark could help here but is very unstructured and hard to process automatically.

    So my proposal is to add a new ticket for a status result as some complex object and discuss that separately. Any thoughts?

  7. thomaskolmans commented on Mar 7, 2021

    @thomaskolmans

    Yes, those 2 changes sound good to me. I also agree that we should be wanting more, I actually ran into this thought breakpoint just now while implementing a cancellation flow.

    If an object with a status or lifeCycle is cancelled or has changed status, there is no field (apart from externalAttributes or remark in some cases) that communicates well what actually happened. With actions you could use the remark field for it.

    I'll have a think for a solution from our perspective in the coming days.

  8. bmeesters commented on Mar 12, 2021

    @bmeesters
    ContributorAuthor

    @thomaskolmans Any new thoughts on this? Otherwise I suggest to just go with my previous proposal and open a new ticket.

  9. added this to the OTM 5.1 milestone on Mar 25, 2021
  10. rvanweegberg commented on Mar 25, 2021

    @rvanweegberg

    A bit late, but I want to suggest to add as status field on both the consignment and the trip.

  11. bmeesters commented on Mar 25, 2021

    @bmeesters
    ContributorAuthor

    @rvanweegberg Sorry I don't fully understand, what new status do you want to propose?

  12. rvanweegberg commented on Mar 25, 2021

    @rvanweegberg

    I want to add status 'Confirmed'.

  13. bmeesters commented on Mar 26, 2021

    @bmeesters
    ContributorAuthor

    Alright, let's zoom out a bit and look at the complete process of either delivering some consignment and driving a trip (since they are very similar). I think they contain the following steps that each should be a status:

    1. A trip is created by some party (maybe the shipper) that is not responsible for actually driving the trip, the trip is thus requested and not yet confirmed. An alternative to requested could be draft in case it is not complete yet, but the party creating doesn't have to request it since it has the authority to accept it themselves.
    2. The trip is received by the party driving the trip (the carrier), potentially modified, and then send back as accepted. Since we already have accepted I don't think we also need confirmed. Even though I think confirmed is a little bit better. However cannot remove a status, so better to have one than have both IMO.
    3. The trip is starting and can be considered active. Personally I prefer in in transit, since that would better for both trips and consignments, especially if they are not actively moving but also not at their final destination.
    4. Finally, at some point the trip is finished / consignment is delivered. I am not sure what would be best here, I suppose completed could work for both.
    5. In between a trip can be modified or cancelled. I think the former has become unnecessary with the proposal to add a lastModified time, but the latter is still useful.

    This brings us to the following list: requested, accepted, inTransit, completed and cancelled.
    Alternatively we can use: draft, confirmed, inTransit, completed and cancelled.

    draft and requested are not entirely the same, but close enough that I question whether we need both. The same goes for accepted and confirmed.

    In case of option 1 we need to deprecate modified, in case of option 2 we would also need to deprecate requested on top of modified. Any preferences? @thomaskolmans, @rvanweegberg, @bartkummel?

  14. thomaskolmans commented on Apr 6, 2021

    @thomaskolmans

    Is it possible to both have requested and draft, especially for the TransportOrder as both of these states are a very likely possibility with other interpretation for systems too.

    Further, I understand the preference for in transit as opposed to active, however active would also cover TransportOrders. The modified state does not communicate anything in context of the Trip, Consignment or TransportOrder state, as it does not communicate anything that a lastModified doesn't.

  15. bmeesters commented on Apr 7, 2021

    @bmeesters
    ContributorAuthor

    I think that both draft and requested could work. As long as we clearly describe when to use which. I personally don't see how active would be better than in transit for TransportOrders? It's in transit as long as not all consignments have been delivered. I think active is not great for something that is static and not actively doing anything.

  16. thomaskolmans commented on Apr 7, 2021

    @thomaskolmans

    No, sorry I actually agree now thinking about it again. inTransit is a lot more explanatory then active, just on that front alone I think it's better.

    Yes a clear definition should be provided between draft and requested.
    How about:

    draft: a preliminary version
    requested: asking for something officially

    Those definitions have to be adjusted to the context of course, but I thought this was pretty clear from the dictionary.

  17. bmeesters commented on Apr 8, 2021

    @bmeesters
    ContributorAuthor

    Sounds good to me,

    so the new list would be: draft, requested, confirmed, inTransit, completed and cancelled, right?

  18. bmeesters commented on Jun 1, 2021

    @bmeesters
    ContributorAuthor

    Closing this as it is now official part of OTM5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OTM 5.1This ticket is included in OTM 5.1enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions