Clarity

 View Only
Expand all | Collapse all

XOG - (adjustment timesheets)

  • 1.  XOG - (adjustment timesheets)

    Posted Oct 12, 2010 07:06 AM
    Hi,  I'm experimenting with XOG and uploading timesheets into Clarity 7.5.3 FP08 using the prj_timeperiods xml files  So far I have been able to upload new timesheets into open timeperiods for which no timesheet existed.Challenge ofcourse is to find a mechnism where the existing timesheet info is read by xog, manipulated and uploadedthrough XOG.  Several tests I've done resulted in messages like:- XOG-2014: Timesheet already submitted. Submitted timesheets can't be altered.- XOG-2028: Cannot create new time sheet because one already exists for resource: 413-00006334 in timeperiod : 2009-01-01T00:00:00- XOG-2015: This timesheet can not be saved because it has since been updated by another user.   Save your changes in a new file, then retrieve the same timesheet again and re-enter your time.  Each time the result in the statistics are like below:   When looking for the new timesheet, no succes.  I have been using the value id= -1 and adjustedTimeSheetID=   Does anybody have experience in uploading adjustment timesheets into open and or closed timeperiods?  Thnx  BasCapgemini Message Edited by bwee on 05-08-2009 10:24 AM [left]


  • 2.  Re: XOG - (adjustment timesheets)
    Best Answer

     
    Posted Oct 12, 2010 07:06 AM
    Hi Bas,  I checked with someone on this and have posted their response below.   If this isn't enough you should probably check KB articles or see what trainings might be available from Services.  Regards,Chris       To allow timesheets to be created via XOG import   1. Export an open timeperiod for a given resource with an existing timesheet (comment out the 'createTimesheet' filter in the read XOG) to provide a template for import (this will fill out assignment ID, internalTaskID):       Paste the content of the element and its sub-elements into an import ("write") Timeperiod XOG.       Change the start/finish to an active timeperiod where the resource has no timesheet.       On the element:             Add an attribute:   action="add" on the timesheet             Set the ID to -1             Set the version to 1       In any elements, change the dates to reflect dates within the chosen time period and set the amounts to the number of hours worked. 2. Import the XOG created in #2. 3. If this XOG is run again, a warning is issued that the timesheet already exists for the resource in the designated timeperiod and the timesheet it not imported (the timesheet now has an internal ID and a version).     Sample Timesheet XOG ---------------------- http://www.w3.org/2001/XMLSchema-instance " xsi:noNamespaceSchemaLocation="../xsd/nikuxog_timeperiod.xsd">                                                                                                                 lastModified="2004-12-08T10:10:17"                                       resourceID="PRJ_COVRG_Labor" status="0" version="1">                                                                                                                                           assignmentEstimateForTimePeriod="0"                                                       assignmentFinish="2004-10-29T17:00:00"                                                       assignmentID="5000090"                                                       assignmentPendingEstimate="0"                                                       assignmentStart="2004-10-18T08:00:00"                                                       chargeCodeID="DEV"                                                       typeCodeID="VAC"                                                       internalTaskID="5000062"                                                       projectID="PRJ_COVRG_TRACKED"                                                       projectName="PRJ_COVRG_TRACKED"                                                       taskID="~rmw" taskName="Effort" totalActuals="8">                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   


  • 3.  Re: XOG - (adjustment timesheets)

    Posted Oct 12, 2010 07:06 AM
    Hi Chris,  thanks for your response on uploading timesheets using XOG.  Looking at the XML example you provided I noticed this one is similar to the succesfull run I did. Uploading a timesheet into a timeperiod which is open and does not yet have a timesheet for that resource.  Main concern from my side lies with the uploading of adjustment timesheets.This part keeps on failing, any experience on this subject ?  ThnxBas


  • 4.  Re: XOG - (adjustment timesheets)

     
    Posted Oct 12, 2010 07:06 AM
    Hi Bas,  No you may want to check the Knowledge Base or see if another user chimes in here.  Regards,Chris


  • 5.  Re: XOG - (adjustment timesheets)

    Posted Oct 12, 2010 07:06 AM
    Hi Bas,  If your goal is to edit a timesheet that has already been created, you can export the timesheet  you're intrested in via xog and then import the write file after you've updated it.   Below is the xog file xml to read timesheets.   You can use the filter criteria to narrow your results.  By going this route, you will get the internal timesheet ID, version, action, status and resourceID.   FILE: prj_timeperiods_read.xml  xml version = " 1.0 " encoding = " UTF-8 " ?>  NikuDataBus xmlns:xsi = " http://www.w3.org/2001/XMLSchema-instance " xsi:noNamespaceSchemaLocation = " ../xsd/nikuxog_read.xsd " >  Header version = " 6.0.11 " action = " read " objectType = " timeperiod " externalSource = " NIKU " /> Query >   2002-01-01, 2002-01-15  XOGProg1Res  4  2002-01-01T15:36:03  true  true    Query > NikuDataBus >        I hope this helps,  Robert


  • 6.  Re: XOG - (adjustment timesheets)

    Posted Oct 12, 2010 07:06 AM
    Thx for the xml structures and the advice but as said I am able to  create a timesheet in an timeperiod where no timesheet exists for that resource.
    I'm also able to read a timesheet from a period. But what I like to do is read timesheet information (i know this part) and upload an adjustment timesheetinto the system. Example structure I tried to use is below:  
         
         
                 
                         
                                 
                                         
                                                 
                                                         
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                         
                                                 
                                         
                                         
                                 
                                 
                                         
                                                 
                                                         
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                                 
                                                         
                                                 
                                         
                                         
                                 
                         
                 
         
         
                 
                 
                 
                 
            This piece of code replies with error messages on existing timesheets in that period. Which is strange because I'm trying to upload an adjustment.  Maybe this helps in getting my question more clear to you.  Thnx,  BasCapgemini


  • 7.  Re: XOG - (adjustment timesheets)

     
    Posted Oct 12, 2010 07:06 AM
    Adding a note to push this forward after board consolidation.


  • 8.  Re: XOG - (adjustment timesheets)

    Posted Oct 12, 2010 07:06 AM
    Hi all,  thanks for the response.  Last week I had some sessions with a CA technician. It seems to be impossible in the current versions of CA Clarity to upload adjustment timesheets using XML Open Gate Way.  Grtz,BasCapgemini


  • 9.  RE: Re: XOG - (adjustment timesheets)

    Posted Nov 05, 2010 10:49 AM
    Bas,

    Try the following:

    To update actuals in a timesheet - Put in the timesheet id into the timesheet id field. The action needs to be “replace”. Version and Status will be based on what is specified in the prtimesheet table

    Hope this works for you.


  • 10.  RE: Re: XOG - (adjustment timesheets)

    Posted Jan 17, 2012 12:13 PM
    Hi, I've been following this post, as I need to read out a number of resource timesheets as well, but when I use the script below - the results are certainly not what I was expecting

    XOG from XOG Client

    <?xml version="1.0" encoding="UTF-8" ?>
    - <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
    <Header version="6.0.11" action="read" objectType="timeperiod" externalSource="NIKU" />
    - <Query>
    <Filter name="start" criteria="BETWEEN">2008-01-01, 2010-10-03</Filter>
    <Filter name="resourceID" criteria="EQUALS">101573</Filter>
    <Filter name="status" criteria="EQUALS">4</Filter>
    <Filter name="modifiedDate" criteria="AFTER">2008-01-01T00:00:03</Filter>
    <Filter name="includeAdjusted" criteria="EQUALS">true</Filter>
    <Filter name="createTimesheet" criteria="EQUALS">true</Filter>
    </Query>
    </NikuDataBus>

    Results:

    - <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_timeperiod.xsd">
    <Header action="write" externalSource="NIKU" objectType="timeperiod" version="12.1.0.5840" />
    <TimePeriods />
    - <XOGOutput>
    <Object type="timeperiod" />
    <Status state="SUCCESS" />
    <Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="0" updatedRecords="0" />
    <Records />
    </XOGOutput>
    </NikuDataBus>

    The only changes are resourceid and dates

    My aim is to adjust some erroneous timesheets as we have duplicate usernames defined which is impacting on reporting from & for another part of the business. What have I missed/ not clearly defined.

    Thanks

    Brendan


  • 11.  RE: Re: XOG - (adjustment timesheets)

    Posted Jan 17, 2012 12:34 PM

    brendanj1 wrote:

    What have I missed/ not clearly defined
    Have you tried a bit of "trail and error" with your XOG?

    So instead of going for a bit query like this;
    <Query>
      <Filter name="start" criteria="BETWEEN">2008-01-01, 2010-10-03</Filter> 
      <Filter name="resourceID" criteria="EQUALS">101573</Filter> 
      <Filter name="status" criteria="EQUALS">4</Filter> 
      <Filter name="modifiedDate" criteria="AFTER">2008-01-01T00:00:03</Filter> 
      <Filter name="includeAdjusted" criteria="EQUALS">true</Filter> 
      <Filter name="createTimesheet" criteria="EQUALS">true</Filter> 
    </Query>
    Perhaps try

    <Query>
      <Filter name="start" criteria="BETWEEN">2008-01-01, 2010-10-03</Filter> 
      <Filter name="resourceID" criteria="EQUALS">101573</Filter> 
    </Query>
    or even just
    <Query>
      <Filter name="start" criteria="EQUALS">2008-01-01</Filter> 
      <Filter name="resourceID" criteria="EQUALS">101573</Filter> 
    </Query>
    or variations thereof - just to see whether you are looking for data that does not match your critera.

    If you get that working then add in a condition at a time until you stop getting data and then investigate that condition?


  • 12.  RE: Re: XOG - (adjustment timesheets)

    Posted Jan 17, 2012 02:24 PM
    Hi Dave, I followed your suggestions and ran additional basic xog queries (with alternative resourceid and date ranges) and the output was exactly the same each time as my earlier posting. I checked and can confirm that I have Time Period XOG Access and I know my XOG client works as I was doing some resource update work (successfully) yesterday..... so anything else I should review/ check. Because I'm wondering if there may be a bug in my version/ environment, but..

    B


  • 13.  RE: Re: XOG - (adjustment timesheets)

    Posted Jan 17, 2012 02:42 PM
    Hi , I guess we have to give the filter dates in the format "2008-01-01T00:00:03"... do you get any results when you simply filter by <Filter name="resourceID" criteria="EQUALS">101573</Filter> (provided you have a resource with ID 101573 and also who has a timesheet :) ).

    Thanks and Regards,
    Rajini


  • 14.  RE: Re: XOG - (adjustment timesheets)

    Posted Jan 18, 2012 06:52 AM
    Rajini, Thanks am now getting all the data out and within date ranges that I've specified. The problem was the date time. In an earlier post another user provided a write (action replace) script for actuals, etc. What I'm endeavouring to achieve is to re-assign the current timesheet resource id from e.g '101573' to 'admin2', all other related information will not change. Any suggestions on best approach to do this?

    Thanks


  • 15.  RE: Re: XOG - (adjustment timesheets)

    Posted Jan 18, 2012 01:36 PM
    Hi Brendanj1, guess when you re xog for the other resource you have to consider the latest available version for the timesheet and status.
    Cheers,
    Rajini


  • 16.  RE: Re: XOG - (adjustment timesheets)

    Posted Jan 18, 2012 02:44 PM
    Rajini, Perhaps a little more detail is required. I have '2' resources username/id - tobyh/ 101471 and tobyh/ EUK00904. Resource tobyh/EUK00904 has left the company and all his previous timesheets have now been reassigned to tobyh/ 101471 - this was a mistake made in our Active Directory, which re-used the same username. tobyh/ 101471 started in 2011-09-05 but his records show projects/ tasks/ actuals going back to 2009-01-12, so I need to change all those previous entries (within the appropriate date range) back to the original user

    <TimePeriod finish="2009-01-12T00:00:00" openForTimeEntry="false" start="2009-01-05T00:00:00">
    - <TimeSheets>
    - <TimeSheet ID="5007305" approvedBy="5001005" lastModified="2009-01-20T00:01:49" resourceID="101471" status="4" submittedBy="5017270" version="6">
    - <TimeSheetEntries>
    - <TimeSheetEntry assignmentEstimate="0" assignmentEstimateForTimePeriod="0" assignmentFinish="2010-03-26T17:00:00" assignmentID="5013029" assignmentPendingEstimate="0" assignmentStart="2009-01-05T08:00:00" internalTaskID="5001033" projectID="PRJ000944" projectName="Mfr - THD - Ongoing - Non Client Specific Mgmt/ Support" taskID="~rmw" taskName="Mfr - THD - Ongoing - Non Client Specific Mgmt/ Support" totalActuals="39">
    - <DailyActuals>
    <Actual actualDate="2009-01-05" amount="8" />
    <Actual actualDate="2009-01-06" amount="8" />
    <Actual actualDate="2009-01-07" amount="7" />
    <Actual actualDate="2009-01-08" amount="8" />
    <Actual actualDate="2009-01-09" amount="8" />
    <Actual actualDate="2009-01-10" amount="0" />
    <Actual actualDate="2009-01-11" amount="0" />
    </DailyActuals>
    </TimeSheetEntry>
    </TimeSheetEntries>
    <Notes />
    </TimeSheet>
    </TimeSheets>
    </TimePeriod>

    What is the best approach to achieve this/ Is this something that can and should be done?

    B


  • 17.  RE: Re: XOG - (adjustment timesheets)

    Posted Jan 19, 2012 04:21 AM
    I think I would just do this in the application, not XOG*.

    Your problem seems to be that the same USER/RESOURCE record has been used for 2 different people.

    So you need to create a new USER/RESOURCE (probably for the new "tobyh"), change the old "tobyh" user to "old_tobyh" so you don't get confused.

    The ADJUST all the (now) "old_tobyh" timesheets since he left, adjusting them to zero hours and rebooking the same details on the new tobyh resource. Let these all approve & post and it will all be ok.

    --

    * - I just think that this easier to do in the APP than trying to write XOG code for it?


  • 18.  RE: Re: XOG - (adjustment timesheets)

    Posted Jan 19, 2012 06:40 AM
    Hi Dave, I agree with your suggestion if the issue was just related to one/ two resources, but we've identified 9 (possibly 35 more) where this re-using of AD username accounts has occured. As I'm sure you appreciate that is a lot of timesheets to go through hence trying to go down the XOG route. What are the risks of trying to replace one resourceid, over a given date range, with another resourceid if all other data remains the same.

    Thanks for any additional feedback.


  • 19.  RE: XOG - (adjustment timesheets)

    Posted Nov 05, 2010 08:41 AM
    Thanks for replying Dave.

    Here is the script that I'm trying to use

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_timeperiod.xsd">
    <Header version="6.0.11" action="write" objectType="timeperiod" externalSource="NIKU"/>
    <TimePeriods>
    <TimePeriod finish="2010-11-06T00:00:00" start="2010-10-31T00:00:00">








    <TimeSheets>
    <TimeSheet resourceID="beisner" version="1" action="add" status="0">
    <TimeSheetEntries>
    <TimeSheetEntry projectID="5001062" assignmentID="5001606" >
    <DailyActuals>
    <Actual actualDate="2010-10-31" amount="1"/>
    <Actual actualDate="2010-11-01" amount="2"/>
    <Actual actualDate="2010-11-02" amount="3"/>
    <Actual actualDate="2010-11-03" amount="4"/>
    <Actual actualDate="2010-11-04" amount="5"/>
    <Actual actualDate="2010-11-05" amount="6"/>
    <Actual actualDate="2010-11-06" amount="7"/>
    </DailyActuals>
    </TimeSheetEntry>
    </TimeSheetEntries>
    </TimeSheet>
    </TimeSheets>
    </TimePeriod>
    </TimePeriods>
    </NikuDataBus>

    I'm getting an error saying that I need a timesheet id. When I enter the timesheet id, I get error "XOG-2015: this timesheet cannot be saved because it has since been updated by another user.

    In our case, I just need to create the timesheet with the "STAT" holiday task prepopulated with the actuals.

    Thanks for you help.

    ~~~~~~~~~~~~```



    Bas,

    Can you share with me the script you used to successfully upload new timesheets into open timeperiods for which no timesheet existed.

    I'm experimenting to see if I can pre-populate STAT holidays into timesheets that have not been created.

    Thanks,


  • 20.  RE: XOG - (adjustment timesheets)

    Posted Nov 05, 2010 09:02 AM
    ^ the script will just be a variation of the CA-provided "[font=Courier New]prj_timeperiods_write.xml[font]" which comes with the XOG client download.

    "STAT holidays" (I'm interpreting that as statutory holidays - i.e. national holidays etc) are typically handled in CALENDARs though rather than timesheets? - marking the day as a non-working day at calendar level so just to be omitted in the timesheet itself when the resource fills it in. Of course your setup might be different to that!


  • 21.  RE: XOG - (adjustment timesheets)

    Posted Nov 05, 2010 10:48 AM
    Dave, I figured out how do both create and update timesheet using XOG:

    To create a timesheet where no timesheet exists in the time period - Put in “-1” in the timesheet id field. The action needs to be “add”. Version is 1. Status is “0”
    To update actuals in a timesheet - Put in the timesheet id into the timesheet id field. The action needs to be “replace”. Version and Status will be based on what is specified in the prtimesheet table.

    We will be applying this logic to prepopulate STAT holidays.

    Here is the script that I applied:


    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_timeperiod.xsd">
    <Header version="6.0.11" action="write" objectType="timeperiod" externalSource="NIKU"/>
    <TimePeriods>
    <TimePeriod finish="2010-11-06T00:00:00" start="2010-10-31T00:00:00">
    <TimeSheets>
    <TimeSheet ID="-1" resourceID="resourceid" version="1" action="add" status="0">
    <TimeSheetEntries>
    <TimeSheetEntry projectID="STAT" assignmentEstimate="0" assignmentPendingEstimate="0" assignmentID="5001606" assignmentStart= "2010-10-24T00:00:00" chargeCodeID="NONITD" assignmentFinish="2010-10-31T00:00:00" taskID="~rmw">
    <DailyActuals>
    <Actual actualDate="2010-10-24" amount="1"/>
    <Actual actualDate="2010-10-31" amount="2"/>
    <Actual actualDate="2010-11-01" amount="3"/>
    <Actual actualDate="2010-11-02" amount="4"/>
    <Actual actualDate="2010-11-03" amount="5"/>
    <Actual actualDate="2010-11-04" amount="6"/>
    <Actual actualDate="2010-11-05" amount="7"/>
    </DailyActuals>
    </TimeSheetEntry>
    </TimeSheetEntries>
    <Notes>
    <NoteData noteText="test” createdBy="resourceid" createdTime="2010-11-05T16:52:18" category="NoteCat"/>
    </Notes>
    </TimeSheet>
    </TimeSheets>
    </TimePeriod>
    </TimePeriods>
    </NikuDataBus>


  • 22.  RE: XOG - (adjustment timesheets)

    Posted Jan 17, 2012 02:45 PM
    Hi CLEisne,

    Shouldn't the verison number for timesheet update be one more than the version number in database?

    Thanks and Regards,
    Rajini


  • 23.  RE: Re: XOG - (adjustment timesheets)

    Posted Feb 03, 2012 08:58 AM
    HI.

    Please do you know hot to export timesheet? thank you


  • 24.  RE: Re: XOG - (adjustment timesheets)

    Posted Feb 03, 2012 09:08 AM

    michal.adamek wrote:

    HI.

    Please do you know hot to export timesheet? thank you
    It depends on how you want to export them?

    The standard time period XOG read - [font=Courier New]prj_timeperiods_read.xml[font] - will read timesheets to an XML file.

    (But there are various other ways to get timesheet data out of the system)


  • 25.  RE: Re: XOG - (adjustment timesheets)

    Posted Feb 03, 2012 03:40 PM
    as robric1 wrote

    f your goal is to edit a timesheet that has already been created, you can export the timesheet you're intrested in via xog and then import the write file after you've updated it

    and i want do same but i dont know how to export it to file which i can after export update.. then i know how to put it to xog but i dont know how to export.

    thank you
    br