Hello everyone,
I'm trying to version a model by using ARIS report scripting code but I have a question regarding archive () method (Versioning class).
The help says:
archive ( ArisObject[] p_ToArchiveItems, String p_Description, VersioningOptions p_Options, boolean p_waitInCaseConcurrentVersioningRunning )
Which items are expected in the first parameter? I have tried to put the model only but it did not work.
My code is:
var itemList = new Array(); //Items Array itemList.push(???); //what should I add? var result = compVersioning.archive(itemList,"version 003",compVersioningOptions,true); //creating model versioning
I have tried also to put the model + objDefList but without success.
The help is not clear about this parameter.
I appreciate your help.
Best regards.
Torsten Haase on
Hi Pablo,
your script ran into a disadvantage of a typed parameter. Using "new Array[]" creates an untyped array but the method Versioning.archive requires the parameter to be typed (ArisObject[]).
The only (but not very user-friendly) way is to pick a method of the API which returns models, call this method and empty the result array. Now you have an empty array of the correct type. For example:
function createModelArray() { var aModels = ArisData.getSelectedModels() while (aModels.length>0) aModels.pop() return aModels }Afterwards you can add models to the result array and calling .archive() will succeed.
Best regards,
Torsten