Create versioned speckle streams

Hi there,
i was wondering about how to create different versions of a stream.
What I found out so far:

  • a single stream represents only one version with an individual stream id (new versions must obviously get a new stream id)
  • there is a “parent” and “children” attribute in the SpeckleStream class

Does that mean, I only need to add the parent stream id to the new version? Do I also need to update the parents children attribute?

Also I tried the StreamUpdateAsync method and it seems to overwrite the old stream?! Is this intended behavior? Am I supposed to only throw updated/new objects in there?

A nice example would also be highly appreciated! :wink:

Cheers
Til

Good afternoon Mr. @tlmn! If you want to clone a stream, there’s the stream clone API route. Let me know if this solves your problem!

The behaviour of that route is to literally “copy-paste” the original stream into a new stream. The new stream will have its parent field populated with the orginal’s streamId, whereas the original will have the child’s id appended to the children field.

Hey @dimitrie,
thx for the quick reply!
I´m not sure, if this solves my problem, but least it creates a version history… :wink:

Also I would like to change/edit my objects and other stuff in my child stream… So cloning might not be the right route to go?!

I think it might! Once you cloned things, you can always update the child stream! Just mind you, pass in the request body only the fields you want to overwrite!

PS: I wouldn’t call a 5h response time fast

Cool, that seems to work… theoretically… :wink:

Am I allowed to have grandchildren and grandgrandchildren and so on?
Somehow only the first child shows up on the server.
Or are all children supposed to be from the same initial parent?

Also all my objects change every revision unfortunately and I didn´t manage to reduce my payload yet…

grand children are not appended to the grandparent’s children list, but you can always get them from their parent’s children list, which is the grandparent’s original children list.

If you clone a child, you’ll make a grandkid. If you clone the parent, you’ll make a child. So, in your case, you do probably want to clone the father rather than the child.

I can’t believe i wrote the above!

haha :slight_smile:
i think i got it, and that´s also what i´d expect.

1 Like

happy you do, as i barely understand what i wrote there :grimacing:

So I only see versions of a certain stream in the web viewer when it has children? It doesn´t show me the whole version history with grandchilds and so on?


In this example i created 5 versions, but only the direct ancestor shows up…

Sorry for asking so many questions… :]

That’s the intended behaviour I’m afraid, as from the current application clients you can’t really create “grandchildren”. It would not be that hard to add what you want there, albeit you’ll want to log that as an issue on github so it won’t be forgotten!

PS: And absolutely no worries for “asking so many questions”! That’s what this forum is for!

Just out of curiosity: That means the graphs @pauldotnet created to show different stakeholders and the development of data in a project does not show a “family tree”?
Would people usually just create a new stream to push changes?
How are they connected otherwise than by a parent-child relationship?
Just wondering how that works without grandchildren…

It’s using a completely different way, based on source/receiving files and users! He’ll explain more when he remembers his discourse password :smiley:

There’s some extra info he wrote up here: https://speckle.systems/docs/web/speckleviz

1 Like

Hi @tlmn,

The documantation page that @dimitrie recommended you to read explains (or intends to explain) precisely what the graph shows/does. If something is unclear, please let me know and I will try to improve the docs.

To answer your question, the graph does not take into account the versions (children) of the exposed streams. We are thinking of adding an option where the user can select a stream on the graph, unfold and access all its related children streams (a bit like the Speckle Receivers and Senders in Grasshopper). I will try to remember this discussion and let you know if this ever happen!