Update a Project through PSI from Workflow.StageEntered event RRS feed

  • Question

  • Hey everyone,

    I have an event handler that is supposed to fire on the Workflow.StageEntered event. This event handler updates a project level custom field and publishes the project.

    The problem is, when I try to publish, the workflow is still "moving" (either because of commit or submit), so the publish from the event handler collides with the publish from the workflow itself and everything just sits in the queue waiting for the other to finish. This eventually ends in a time out error and the workflow terminates.

    Has anyone tried to update a project from the StageEntered event? how did you get around this problem?

    EDIT: this only seems to happen after a project is Committed.


    • Edited by Paul MC2 Tuesday, September 4, 2012 6:13 PM
    Tuesday, September 4, 2012 6:12 PM


  • To anyone that cares,

    I found out a solution. In my event handler I was waiting for the queue to complete (which resulted in the time out mentioned above), so I removed the wait for queue line, and now it works.

    The drawback is, when the workflow stage loads, the value might not be there already (it may still be processing in the queue). This results in the page flickering and the user complaining, but whatever. The value gets there eventually.


    • Marked as answer by Paul MC2 Friday, January 25, 2013 2:24 PM
    Friday, January 25, 2013 2:24 PM