none
timer jobs for project server 2010 RRS feed

  • Question

  • Can someone point me in the right direction for developing a project server timer job that sits in the background and wakes up to approve tasks that contain certain values from enterprise custom fields?

    I am trying to hunt down how to start on this and any pointers would be helpful. Cannot find any documentation on this or I am not typing the correct keywords. Thanks.


    Nilesh Kelkar | nkelkar.wordpress.com
    Monday, September 12, 2011 3:51 PM

All replies

  • I would suggest in the first instance that you should use an Event handler and not a SharePoint timer job, something like OnPublished if you are interrogating published tasks?

    More information on using Events can be found here:

    Alternate if you do want to use a timer job, I have previously re-used some of the code in this blog:

     

    HTH,

     


    -- Martin Laukkanen Project Server Blog - http://www.nearbaseline.com/blog
    Tuesday, September 13, 2011 6:55 AM
  • Agreed with Martin, You can use Statusing Event source where you can trap the Approval updated in project & get the custom fields value. If project manager just approves the tasks but doesn't publish the plan, You will not be able to get the fields or you may consider the desgin as per the Scenarios for Project Server Development.
    http://msdn.microsoft.com/en-us/library/ee767682.aspx

     


    Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
    Tuesday, September 13, 2011 11:21 AM
  • Hi Nilesh, You should also take a look at the built in rule engine for task approval - Approval Center, Manage Rules,  In SP1 we also added the ability to autopublish after approval.  Saves building something that might already exist...

    Best regards,

    Brian.


    Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page
    Friday, September 16, 2011 11:19 PM
    Owner
  • Thanks Brian. I am aware of SP1 and the publishing rule.

    That's not what I am looking for. I am looking for the "StatusingEventReceiver Class" event handler and how to get the assignment/task update from the event post submit. The class is here http://msdn.microsoft.com/en-us/library/gg237995.aspx

    What I am able to do is get the Assignment GUIDs in the event, but I cannot somehow figure out how to "update" these "n" guids as approved. And there seems to be no documentation on this.

    Use Case - I am sure there is plenty others who need a similar rule - as the ootb rules kick in only when a field is updated - which is not what we want. We want to approve all tasks where as an example, the Ent Custom Field (ECF) City value is "WatchOutFor". To expand on this, we have 50 tasks in a project - not all tasks need to be micro managed by the PM, they need to watch out for only those tasks that have ECF City=WatchOutFor. So in a project of 50 tasks, there are say 8 that have ECF City=WatchOutFor. The PM's want to auto-approve the other 42 tasks and with SP1 publish it as well. What they want is the 8 tasks to remain in the approval centre so they can take a look before approving.


    Nilesh Kelkar | nkelkar.wordpress.com
    • Edited by Nilesh Kelkar Monday, September 19, 2011 4:14 PM edit text
    Monday, September 19, 2011 3:52 PM
  • To add on to this, I would recommend if you can please look into developing an ootb rule for one of the next service packs or fixes for project server that do the following:

    When a FIELD (equal to, not equal to, contains) VALUE

    The field can be a task or assignment one, and the value is a text based one.

    The ootb rules in the current project server kick in only when the field is updated (which does not happen in all scenarios)


    Nilesh Kelkar | nkelkar.wordpress.com
    Monday, September 19, 2011 3:55 PM
  • Thanks for the feedback Nilesh - I will pass it on to the product group.  I haven't worked with this specific event handler for a while - but does this link help? http://msdn.microsoft.com/en-us/library/microsoft.office.project.server.events.statusupdateapprovalsposteventargs.statusapprovals_di_pj14mref.aspx.  This gets a dataset that contains summary information about submitted status updates.

    Best regards,

    Brian.

     


    Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page
    Monday, September 19, 2011 4:06 PM
    Owner