none
How can I start workflow from timsheet updating event handler? RRS feed

  • Question

  • I am writing a event handler to fire timesheet updating .I wan to start a workflow from this event handler and pass sum timsheet data to it. I want a sample code for accessd a special filed of timesheet .I want to know "How can i start a workflow and How can I pass information to it from updating event of timesheet".Thanks For evry one that help me.I is very emportent for me ?????????????!!!!!!!!!!!!!!!!!!

    Tuesday, September 21, 2010 5:19 AM

Answers

  • Alipashaei,

    What version of Project Server are you using? 2007 or 2010?

    Let me try to answer your questions:

    1. As I mentioned before, the dsDelta dataset only contains changes made to the timesheet. The dsDelta is a TimesheetDataSet. See the SDK for all Members and Methods to read the TimesheetDataSet. If you need to access timesheet data which is not available in the dsDelta dataset (previously saved timesheet data or prepopulated data), you need to retreive this data usng the appropriate PSI calls to the timesheet web service, or by querying the reporting database
    2. What workflow are you talking about? A Project Server workflow? A SharePoint workflow? Some custom developed workflow?
    3. I'm not sure if I understand what you mean by this. Can you please give some more details about what exactly you are trying to do?

    I hope this helps,
    Hans


    My EPM blog: Projectopolis
    Tuesday, September 21, 2010 10:14 AM
    Moderator

All replies

  • Hi alipashaei,

    The timesheet updating event contains a dsDelta dataset as one of it's arguments. This dataset however only contains the CHANGES that are being saved on the timesheet. It does not contain all fields and values on the timesheet. If you want to access previously saved data on the timesheet, you need to retreive them using PSI.

    Unless you want to access the dsDelta dataset with all the changes, you might be better of with using the Updated event. This event is fired when the queue job has finished processing the timesheet changes. Now you can access all timesheet data using PSI calls (both new and old data) or using a query to the Reporting database (this can be dangerous though because - if I recall correctly - the updated event is fired when the save queue job is finished, but the reporting sync job might still be processing).

    I hope this helps,
    Hans


    My EPM blog: Projectopolis
    Tuesday, September 21, 2010 6:33 AM
    Moderator
  • Thanks Hansh.

    I need information about starting workflow from event handler and passing data to it from event handler.

    sombody can help me???!!!!!!

    Tuesday, September 21, 2010 7:25 AM
  • Hi alipashaei,

    The way I have read your initial question, you are asking for 2 things: retreiving timesheet data from an event handler, and passing information to a workflow.

    I have tried to answer your first question. If my answer doesn't help you, you have to give us more information about where exactly you have a problem in your code (we are not going to write the code for you).

    But if you start yelling (big bold fonts and lots of exclamation marks), you are on your own on this one (as far as I'm concerned).

    So please give us more information (what you are trying to do and where exactly your problem occurs) and ask your questions politely (normal fonts like everyone else in these forums), and I'll try to help you again.

    Btw: all the information you need is in the project SDK. Good luck.

    @Moderator: one of the moderators, please move this topic to the programming forum, thank you!


    My EPM blog: Projectopolis
    Tuesday, September 21, 2010 7:38 AM
    Moderator
  • WOW!!!!

    sorry ser .I asked some question but any one dont answerd .I make it boled that evry one see that and be special.I Dont yelling.I am very polite like you.

    these are my problems:

    1.How can I access a value of a filed with DsDelta from timesheet?

     2.How can I start a workflow from updating eventhandler.?

    3.How can I pass a filed value to my workflow.?

    Thanks hansh.for all your answers .Those make me happy .?

    sorry for Bold Fonts. 

     

    Tuesday, September 21, 2010 8:21 AM
  • Alipashaei,

    What version of Project Server are you using? 2007 or 2010?

    Let me try to answer your questions:

    1. As I mentioned before, the dsDelta dataset only contains changes made to the timesheet. The dsDelta is a TimesheetDataSet. See the SDK for all Members and Methods to read the TimesheetDataSet. If you need to access timesheet data which is not available in the dsDelta dataset (previously saved timesheet data or prepopulated data), you need to retreive this data usng the appropriate PSI calls to the timesheet web service, or by querying the reporting database
    2. What workflow are you talking about? A Project Server workflow? A SharePoint workflow? Some custom developed workflow?
    3. I'm not sure if I understand what you mean by this. Can you please give some more details about what exactly you are trying to do?

    I hope this helps,
    Hans


    My EPM blog: Projectopolis
    Tuesday, September 21, 2010 10:14 AM
    Moderator
  • ser hans thanks a lot for your answer.

    *This is all senario ser hans.

    I wanna develop an approval workflow In project server 2010 that checks a filed of timesheet .

     

    I create a new category in Administrative time (name it holiday) in the timesheet. I want to create updating event handler checks this total value of this category < 20   when a person fill it and pass its value to approval workflow and workflow carry that to project manager If he/she approved that it carry to boss and if he approved workflow completed and that person request accepted.

    all of senario is my question.

    say all thing you know that help me thanks ser hans.?

    major problems is :

    @ I found Dsdelta but I cant Undrestand where if fileds name.?

    #How can I found administrative time Holiday with Dsdelta ?

     

    Thanks ser hans your the best.

     

    Tuesday, September 21, 2010 11:10 AM
  • ser hansH please answer me.wehre are you?

    even a sentence .???

    Saturday, September 25, 2010 5:50 AM
  • Hi alipashaei,

    To get the total of the administrative time, you need to do 2 things:

    • Use PSI or a query on the Reporting database to retrieve the administative time that has been entered on the timesheet in the past
    • Retreive the changes made to administrative time from the dsDelta dataset. If I recall correctly, the dsDelta only contains GUIDs, so you will have to use PSI are a query to the reporting database to find out which timesheet line is the administrative time.

    Now, add the two values together and you have your total.

    About the workflow questions: I'm not very familiar with developing custom workflows, so I'm afraid I cannot help you with that.

    I hope this helps,
    Hans


    My EPM blog: Projectopolis
    Sunday, September 26, 2010 3:59 PM
    Moderator
  • thanks ser hansh.

    thats very good.

    Monday, September 27, 2010 5:07 AM