Windchill setting a large version of the code

Source: Internet
Author: User

     Public Static voidSetversion (Finalversioned versioned, String version)throwswtexception {Try {            if(Version = =NULL|| Version.trim (). Length () = = 0) {                //If The version ID string is null and the load file did not//specify it.Version =NULL; if(Versioned.getversioninfo ()! =NULL) {                    //If The object already have a Versioninfo object then//assume it is correct//and no further action is needed. Otherwise, make a//default Versioninfo object.                    return; }            }            //Get The version series of the object.Multilevelseries MLS =NULL; FinalMastered master =Versioned.getmaster (); if(Master! =NULL) {                FinalString Masterseriesname =master.getseries (); if(Masterseriesname = =NULL) {                    if(versionedinstanceofwtcontained&& ((wtcontained) versioned). GetContainer ()! =NULL) {                        //Retrieve the series based on the OIR in effect for//The container and object Type/soft type.MLS =versioncontrolhelper. getversionidentifierseries (versioned);                    Wt.vc.VersionControlServerHelper.changeSeries (Master, Mls.getuniqueseriesname ()); }                } Else {                    //Series name is already set in the master, just use it.MLS =multilevelseries. newmultilevelseries (Masterseriesname); }            }            if(MLS = =NULL) {                //Unable to get the series from the master, just use the//default series.MLS =Multilevelseries.newmultilevelseries ("Wt.vc.VersionIdentifier", version); }            if(Version! =NULL) {                //Set The revision ID value if it is given in the load file.mls.setvaluewithoutvalidating (Version.trim ()); }            //Replace The default VID object (if there is one) with the correct//One .Versionidentifier vid =Versionidentifier.newversionidentifier (MLS); Versioncontrolserverhelper.setversionidentifier (versioned, vid,false /*validateincreasing*/); } Catch(wtpropertyvetoexception e) {loadserverhelper.printmessage ("\nsetversion:" +e.getmessage ());            E.printstacktrace (); Throw Newwtexception (e); } Catch(Exception e) {Throw Newwtexception (e); }    }

The code is provided by Kaka great God, Special records.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.