Clarity

 View Only
  • 1.  Cost Plan load via XOG

    Broadcom Employee
    Posted Jul 10, 2019 02:20 PM
    Hi All.
    I'm developing a GEL script that reads a cost plan with its details, calculates segment values starting by a total and writes it back
    I've been able to produce the XML file, but when I run it I gen an error since the <Cost> tag is not positioned just under the <Details> tag.
    In other other words, the first part of XOG below is working (this is the one I XOGged out), while the second one dones't (this is the one I produced via GEL)

    This owrks
    <Details>
       <Detail>
           <Cost>
               <segment finish="2019-10-31T00:00:00" start="2019-10-01T00:00:00" value="23000.0"/>
          </Cost>
         <Units/>
        <Revenue/>
        <GroupingAttributes>
            <GroupingAttribute code="cost_type_id" value="OPERATING"/>
            <GroupingAttribute code="transaction_class_id" value="EXTLABOR"/>
        </GroupingAttributes>
        .....

    This doesn't
    <Details>
        <Detail>
        <Units/>
        <Revenue/>
        <GroupingAttributes>
           <GroupingAttribute code="cost_type_id" value="OPERATING"/>
           <GroupingAttribute code="transaction_class_id" value="EXTLABOR"/>
        </GroupingAttributes>
        .....
       <Cost>
           <segment finish="2019-10-31T00:00:00" start="2019-10-01T00:00:00" value="23000.0"/>
        </Cost>
        </Detail>
    <Detail>

    The message I get when I run XOG of the second file is 'tag name "Cost" is not allowed'
    Do someone know how to position a tag in a specific position via GEL?
    Thanks in advance
    Fabio

    ------------------------------
    Fabio Cresta
    Client Services Consultant, Clarity
    CA technologies, a Broadcom company
    ------------------------------


  • 2.  RE: Cost Plan load via XOG

    Posted Jul 11, 2019 08:58 AM
    You must have looked  at the costPlan_write.xml of your version. (What is your version?)
    When I look at your "This works" in the detail section
    the GroupingAttributes tag comes after Cost and Unit tags as in my 15.3. sample file.

    In your "This doesn't"
    The GroupingAttributes appear to be before the Cost and unit tags.

    Why cannot you not put them in the order that you have established that works?

    I've seen eg with  project that the XOGing  is picky for the order of tags and will give the type of error you see if the sequence is not correct. Sometimes it is more helpful and tells which tags are allowed instead the not allowed.


  • 3.  RE: Cost Plan load via XOG
    Best Answer

    Broadcom Employee
    Posted Jul 11, 2019 09:44 AM
    Thanks Martti.
    I'm using 15.6.1 and there the sequence is costs, units,revenue,groupingattributes,custominformation.
    I'm not creating the whole XML form scratch, but I read a costplan with details, calculate the monthly amounts and write them back.
    If I use the gel:set tag , my segments XML is appended at hte end for the Detail tag and this gives an error.
    Right now I solved the problem by:

    1. save groupingattributes and customattributes tags in two variables
    2. use xmlt to delete the Details tag
    3. create the segments within Detail tags and add them xost plan XML
    4. add again the groupingattributes and customattributes saved

    I just wonder is there's a simpler way to accomplish this.

    Thanks
    Fabio

    --

    Fabio Cresta
    Client Services Consultant, Clarity

    ITIL Certified

    SAFe4 Agilist Certified

    Advanced Scrum Master Certified


    CA Technologies a Broadcom Company

    Viale Francesco Restelli, 1/A

    Milano, 20124
    Office: +39(0)290464669

    Mobile: +393358485084

    Fabio.Cresta@broadcom.com