I am building a data tree (much like the viewer model tree), however I need to upload multiple files at a time (a mix of parts and assemblies). There are 2 times when I create this tree. The first is when my app loads, I loop thru all the objects in the bucket and call GetMetadataAsync to obtain the model guid and then call GetModelviewMetadataAsync to obtain the hierarchy which is then passed to the client side
The code for this is
var oa = new OAuthController(_configuration);
dynamic oauth = await oa.GetInternalAsync();
DerivativesApi derivative = new DerivativesApi();
derivative.Configuration.AccessToken = oauth.access_token;
dynamic mDyn = await derivative.GetMetadataAsync(urn);
string guid = "";
foreach (KeyValuePair<string, dynamic> metadataItem in new DynamicDictionaryItems(mDyn.data.metadata))
{
guid = metadataItem.Value.guid;
}
dynamic hierarchy = await derivative.GetModelviewMetadataAsync(urn, guid);
When this is called for items existing in the bucket, all works as expected:
urn = dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dW1rcnozZzV4bm15ZmNyNTY3Z3FtcXFoa3ltczRpMnMtZGVidWczLTEyMzQ1LzNtbSUyMGZvbGRlZC5pcHQ=
guid = 0162f7fd-df63-4dc2-bb9b-dd7cb8b493c2
hierarchy = {"data":{"type":"objects","objects":[{"objectid":1,"objects":[{"objectid":2,"objects":[{"objectid":3,"name":"Solid1"}],"name":"3mm folded"}],"name":"3mm folded"}]}}
My problem occurs when I add a new file to the bucket and need to append to my data tree. Once loaded I call "TranslateAsync" and configure a webhook to notify me when the translation is complete. On the callback, I get the urn for the job, delete the webhook and then attempt to get the metatdata (all on the server side). This is the result I get for the same code and same part as above
urn = dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dW1rcnozZzV4bm15ZmNyNTY3Z3FtcXFoa3ltczRpMnMtZGVidWczLTEyMzQ1LzNtbSUyMGZvbGRlZC5pcHQ=
guid = f7156859-17f8-4a63-9c1c-4db53e4e97fa
hierarchy = {"result":"success"}
Notice the urn is the same, but the guid is different as is the result (hierarchy)
Could someone please help me understand what is going on here.
Many thanks