Clarity

Expand all | Collapse all

Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

  • 1.  Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Jun 14, 2016 05:36 AM


    HI,

     

    I'm trying to XOG a load of projects on Clarity version 14.3 with ProjectID as autonumber,

    I tryed in the header overrideAutoNumbering="false" and overrideAutoNumbering="0"

    also between the <args> tag and projectID="-1" (this will create a project with id -1)

    All fail.

     

    I get the error message:

          <ErrorInformation>

            <Severity>FATAL</Severity>

            <Description>[Error] :0:0: unexpected attribute "overrideAutoNumbering"

      Invalid attribute in input document. Please remove all instances of attribute from document elements and try again.

      [Element : Header, Attribute : overrideAutoNumbering ].

    [Error] :0:0: element "Project" is missing "projectID" attribute

     

    Anyone know the quick answer?

     

    kind regards,

     

    Elwin

     

    SOLUTION:

     

    Generate the ProjectID in the same manner as you defined the Auto number. Make sure you start the first project ID a couple of numbers higher, then the last available.

    Start xogging in.

    When the autonumber reaches the same number it will take the next number which is free and skips all the xogged in ID's.

    So nothing goes wrong.

     

    Tested on Clarity 14.3



  • 2.  Re: Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Jun 14, 2016 06:13 AM

    I do recall that this has been discussed a few times (have a search?) ; I don't recall what the right answer is though ; sorry.

     

    I did notice that you say "and projectId="-1" (this will create a project with id -1)" and then you show an error that says "element "Project" is missing "projectID"". Is that just a typo (i.e. should be projectID="-1" )



  • 3.  Re: Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Jun 14, 2016 06:22 AM

    Hi David,

     

    You are right projectId must be projectID otherwise you have a failure. In case of projectID="-1" then you will have a project with ID -1.



  • 4.  Re: Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Jun 14, 2016 10:45 AM

    Hi Elwin,

     

    For the projectID I don't believe this is possible using the "overrideAutoNumbering"

    I had a ticket open with CA for this very thing, was pointed to CLRT-22265. Seems it was never resolved for stock attributes.

    Custom attributes will work with the <args name="overrideAutoNumbering" value="false"/> and a value of -1

     

    There's a stored procedure you can use to get the next in sequence and pass in.

    See this thread for some other information Project ID autonumbering with XOG in GEL

    Of course unsupported



  • 5.  Re: Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Jun 15, 2016 11:49 AM

    This has been discussed before so use search. Federico Pena would know all about it.



  • 6.  Re: Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Jun 16, 2016 05:06 AM

    Just realised I have an idea open about this, please vote it up

    XOG/Rest API Auto numbering for stock object attributes



  • 7.  Re: Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Apr 07, 2017 05:27 AM

    eVBI are you using your solution above? Does it work if you XOG in several instances and do not create any new in the GUI?

    Aurora_Gaimon  posted another approach

    https://communities.ca.com/message/241944299?commentID=241944299#comment-241944299   

    which msnizek  further clarifies that in

    https://communities.ca.com/message/241704198?commentID=241704198#comment-241704198 

    so that you use the CMN_AUTONUM_GET_NEXT_SP to create a new autonumber ID and then retrieve it with the query for use in the XML file either manually or create that with a script.

     

    I've trying to create autonumbered baselines with a gel script in a process.  If using only second query only does move the autonumbered ID up and therefore the script overwrites the last baseline.

     

    Aurora's script should work for you, but if you do not want to use the SP then the query would give next autonumbered ID so that you do not have to go too far ahead.



  • 8.  Re: Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Apr 07, 2017 07:31 AM

    Hi Martin,

     

    What I did is that I first fill a staging table during this load of the staging table I will determine a new project ID based on the last created project ID plus 10.

    After the load of the staging table is completed I immediatly execute the xog action.

    This is all done via a C# program.

     

    kind regards,

     

    Elwin



  • 9.  Re: Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Apr 07, 2017 08:17 AM

    Thanks Elwin,

    I quess it does the same as  CMN_AUTONUM_GET_NEXT_SP



  • 10.  Re: Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Apr 10, 2017 12:20 AM

    Probably, we also do a lot of verification for other fields in the same SP too. You can think of retrieving correct xog values for OBS/ lookups etc.

    And validation if a project is already created with another ID.



  • 11.  Re: Does anyone know how to XOG Projects with ProjectID autonumbered? Clarity 14.3

    Posted Apr 10, 2017 01:04 AM

    Agreed, custom solution gives more options, but may require more maintenance.