locked
Service Requests get intermittently closed by the workflow account. RRS feed

  • Question

  • I am noticing that a workflow has changed some service requests from in progress to Completed although there are still pending activities in the Activities area.  Does anyone know how to troubleshoot this?
    Wednesday, August 8, 2012 9:18 PM

Answers

  • Close, but recall that Status is an enumeration. So the value is actually a Guid. There's two ways to set it..with the Guid directly:

    <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Activity_Library!System.WorkItem.Activity']/Status$">50C667CF-84E5-97F8-F6F8-D8ACD99F181C</Property>

    or with an MP reference like this:

    <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Activity_Library!System.WorkItem.Activity']/Status$">$MPElement[Name='CustomSystem_WorkItem_Activity_Library!ActivityStatusEnum.Ready']$</Property>

    The $MPElement token automatically references the Guid for that particular mp element..and it's more readable by a human :) (Unless you start memorizing GUIDs for fun..not that I recommend that)
    • Marked as answer by Misha Rudiy Wednesday, August 15, 2012 9:23 PM
    Wednesday, August 15, 2012 5:29 PM

All replies

  • Are _all_ of the activities in "Pending"?

    Does the service request change to "Completed" almost immediately after it changes to "In Progress"? (Check the history tab).

    If so, it's because of a workflow race condition..it's rare but it happens. The workaround (for now) is to ensure that every activity in your service request template has it's Status set to "Pending". (I've submitted this bug to Microsoft.)

    Wednesday, August 8, 2012 9:38 PM
  • yes all the activities are in pending.  The workflow process closes the call so quickly that even the first activity does not get to in Progress.  What is a workflow race condition? Is there a way in the Gui to set a service request activity from a template to Pending?
    Thursday, August 9, 2012 6:50 AM
  • It looks like the Workflow that changes a service request from in progress to completed incorrectly identifies an activity before it gets changed to either pending or in progress.  Since a different workflow changes their status If the activity workflow is too slow the Service request activity workflow will close the call.  This is the only thing that seems logical.
    Friday, August 10, 2012 9:39 PM
  • What you just described is the race condition. A race condition is a flaw in parallel processing design or implementation where two processes that _should_ be sequential are not sequential. In this case, the service request status can be set before the activity status can be set.

    Unfortunately, in the console, there's no way to set a manual, review, or runbooks activity's status to "Pending" because their forms do not expose that field. You'll have to edit the template XML directly for those activities.

    Wednesday, August 15, 2012 1:46 PM
  • So in the template wouldn't you only need to set the first activity to in progress for the race condition to not happen?
    Wednesday, August 15, 2012 4:46 PM
  • You probably wouldn't want to set it to In Progress (what if you have a workflow that triggers when the first activity changes from "Pending" to "In Progress"? If it's "In Progress" initially, your workflow would never fire). You can just set it to Pending.

    And you are correct, you could get away with setting just the first activity to pending..just make sure it's the activity with SequenceId = 0. But, to be consistent, it wouldn't hurt to set all activities to pending (afterall, what if someone re-orders the activities one day, but forgets to set the new first activity to Pending?)

    Wednesday, August 15, 2012 5:06 PM
  • So in the XML I would need to add this line for the activities?

    <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Activity_Library!System.WorkItem.Activity']/Status$">Pending</Property>

    Wednesday, August 15, 2012 5:18 PM
  • Close, but recall that Status is an enumeration. So the value is actually a Guid. There's two ways to set it..with the Guid directly:

    <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Activity_Library!System.WorkItem.Activity']/Status$">50C667CF-84E5-97F8-F6F8-D8ACD99F181C</Property>

    or with an MP reference like this:

    <Property Path="$Context/Property[Type='CustomSystem_WorkItem_Activity_Library!System.WorkItem.Activity']/Status$">$MPElement[Name='CustomSystem_WorkItem_Activity_Library!ActivityStatusEnum.Ready']$</Property>

    The $MPElement token automatically references the Guid for that particular mp element..and it's more readable by a human :) (Unless you start memorizing GUIDs for fun..not that I recommend that)
    • Marked as answer by Misha Rudiy Wednesday, August 15, 2012 9:23 PM
    Wednesday, August 15, 2012 5:29 PM
  • Thanks Aaron this did the trick for me.  So did you go through and change your Default Manual, Review Parallel etc activities to Pending to take care of this problem for all your activities?
    Wednesday, August 15, 2012 9:25 PM
  • Is the Race condition fixed with SP1 or do I have to continue editing the XML of each MP?

    Thanks!


    Nevermind- I got my own answer in our test environment that no, it is not fixed at this time.  : )
    • Edited by CShaner Friday, February 22, 2013 9:17 PM new information
    Friday, February 22, 2013 9:12 PM
  • Hi

    We had the same problem and open a support issue with Microsoft. We ended up with makeing a runbook in orchestrator as a workaround. We got information from Microsoft that they think this bug will be fixed in SP1 cu2.

    Regards Jon 

    Monday, February 25, 2013 8:13 AM
  • Hey Guys,

    I have created a quick utility that will take export files and update the runbook activity template activities to 'in progress' initially -- it is available at http://scorch.codeplex.com/releases/view/103351 and the source code is available at http://scorch.codeplex.com/SourceControl/changeset/view/27750#360720 if anyone is interested. If anyone would like it to work with additional activity types let me know and I can get a new revision out.

    Wednesday, March 13, 2013 4:06 PM
  • Service Manager 2012 R2  UR4 has fix for this issue of Race Condition.

    Tuesday, November 18, 2014 3:53 AM
  • It was actually fixed in SCSM 2012 SP1 UR2 as outlined here.  http://blogs.technet.com/b/servicemanager/archive/2013/04/11/update-rollup-2-for-system-center-2012-service-pack-1-service-manager-updates.aspx

    Tuesday, November 18, 2014 6:11 PM
  • it is fixed for SCSM 2012 R2 in UR4.

    Service Manager 2012 R2  UR4 has fix for this issue of Race Condition.

    Friday, July 24, 2015 6:07 AM
  • it is fixed for SCSM 2012 R2 in UR4.

    Service Manager 2012 R2  UR4 has fix for this issue of Race Condition.

    Friday, July 24, 2015 6:08 AM
  • it is fixed for SCSM 2012 R2 in UR4.

    Service Manager 2012 R2  UR4 has fix for this issue of Race Condition.

    Friday, July 24, 2015 6:08 AM