How do I retrieve an history revision 'Reason'

I am trying to (re) set and /or get the revisions of certain Entities
When you save a new revision a reason can be provided
But how do you retrieve this back?, its not an attribute on EntityRevision
Thanks

Hi @MLUY,

Good question, and I see from your question that you’ve also been looking in the logical places (EntityRevision). As you may have guessed, currently the answer is that you can’t retrieve it back through the SDK or REST API, unfortunately.

I’ve asked a colleague to track this issue on our internal board as well. Will keep you posted.

Thanks Roeland,
I am working on a use case whereby I need to define (different) scenarios that uses certain revisions of selected entities. From a user perspective, selecting entities only by revision date is not very user friendly and prone to errors. Is there perhaps a work around that I can use for now?
Thanks
Michiel

Hi @MLUY,

Sounds like an interesting setup! If you store the different versions in a revision and you need to combine those, there are 2 main workaround that might be usable that I can think of right now:

  • Perhaps you could create versions through the api, copying a relevant version of an entity and storing it as a new child entity. That way the user can select them through an entity field and you can be sure that the correct version is chosen because you’ve saved the correct version in the latest revision, so selecting the entity is the same thing as selecting the right revision.
  • Another route might be to use the requests package to connect to the viktor api and get the entities’ revisions yourself. If you check the network inspection of either chrome or firefox you can see that the revision message is in fact there. If you request /api/workspaces/<workspace id>/entities/<entity id>/revisions you’ll get back of revisions in which message is the key you are looking for: This does of course mean knowing the entity id, and connecting to the api “manually” (see REST API | VIKTOR Documentation for how to authenticate).

Thanks Roeland, I am not familiar with the Rest API but I will start looking into this. Question, how can i get to the information you have made a screenprint off? When going through the online manual I cannot find a reference to revisions.

I also thought of the initial possibility you are describing. In principle that would work. But then I would need to freeze the entities (set them to read-only) after I have ran a simulation. So I know for sure my results are based on the state of each entity for each scenario. Not sure if that’s possible?

But because Viktor already has revision control on each entity I initially thought that would be the best way (now i am not so sure). So saving the state for all entities for a certain run on the scenario.

Hi Michiel,

You can inspect an active VIKTOR application by rightclicking and inspecting it:

Backend calls are logged in the Network tab.

I think regarding the “freezing entities” I think we should have a chat. Possibly, coming up with a smart way to use a database might prove to be more fitting.