locked
Troubleshooting Suggestions for a Subscription Workflow Issue RRS feed

  • Question

  • Recently we experienced an problem with one of our Notification Subscriptions where all notifications for a given subscription were resent. I've gone through the Operations Manager and System event logs but am not seeing anything that would indicate why this happened. The Workflow Status logging within Service Manager also appears normal for this subscription.

    The criteria for this subscription is quite simple and we have been using it for several months without issue. The criteria from the Management Pack is below.

    Does anyone have any recommendations on what I should be looking at to isolate what caused this issue and prevent it in the future? This particular subscription rerunning was not that problematic but it would be really bad if this were to happen with an end user notification so I'd greatly appreciate any suggestions.

    <Rule ID="NotificationSubscription_ec15f85c_c6a4_4ff9_a7bf_0fb90a7ca547" Enabled="true" Target="SystemCenter!Microsoft.SystemCenter.SubscriptionWorkflowTarget" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
            <Category>System</Category>
            <DataSources>
              <DataSource ID="DS" TypeID="SystemCenter1!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
                <Subscription>
                  <InstanceSubscription Type="04b69835-6343-4de2-4b19-6be08c612989">
                    <QueryInstance>
                      <Criteria>
                        <Expression>
                          <SimpleExpression>
                            <ValueExpressionLeft>
                              <Property>$Context/Path[Relationship='WorkItem!System.WorkItemHasActionLog' TypeConstraint='WorkItem!System.WorkItem.ActionLog']/Property[Type='WorkItem!System.WorkItem.ActionLog']/ActionType$</Property>
                            </ValueExpressionLeft>
                            <Operator>Equal</Operator>
                            <ValueExpressionRight>
                              <Value>{b04370d9-3d4f-3981-61bb-ac9462a1fe65}</Value>
                            </ValueExpressionRight>
                          </SimpleExpression>
                        </Expression>
                      </Criteria>
                      <RecurrenceTerminateCount>1</RecurrenceTerminateCount>
                    </QueryInstance>
                  </InstanceSubscription>
                  <PollingIntervalInSeconds>60</PollingIntervalInSeconds>
                  <BatchSize>100</BatchSize>
                </Subscription>
              </DataSource>
            </DataSources>
            <WriteActions>
              <WriteAction ID="WA" TypeID="SystemCenter1!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
                <Subscription>
                  <VisibleWorkflowStatusUi>true</VisibleWorkflowStatusUi>
                  <EnableBatchProcessing>true</EnableBatchProcessing>
                  <WindowsWorkflowConfiguration>
                    <AssemblyName>Microsoft.EnterpriseManagement.Notifications.Workflows</AssemblyName>
                    <WorkflowTypeName>Microsoft.EnterpriseManagement.Notifications.Workflows.SendNotificationsActivity</WorkflowTypeName>
                    <WorkflowParameters>
                      <WorkflowParameter Name="SubscriptionId" Type="guid">$MPElement$</WorkflowParameter>
                      <WorkflowArrayParameter Name="DataItems" Type="string">
                        <Item>$Data/.$</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="InstanceIds" Type="string">
                        <Item>$Data/BaseManagedEntityId$</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="TemplateIds" Type="string">
                        <Item>6834a153-efaa-01b6-d2ea-81a19ecd1030</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="PrimaryUserRelationships" Type="string">
                        <Item>$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser' TypeConstraint='CustomSystem_Library!System.User']$</Item>
                      </WorkflowArrayParameter>
                    </WorkflowParameters>
                    <RetryExceptions />
                    <RetryDelaySeconds>60</RetryDelaySeconds>
                    <MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>
                  </WindowsWorkflowConfiguration>
                </Subscription>
              </WriteAction>
            </WriteActions>
          </Rule>

     
    • Edited by WFricke Friday, May 6, 2016 3:56 PM
    Friday, May 6, 2016 3:21 PM

All replies

  • Hello,

    Thanks for your posting!

    As the subscription works fine for months, do you know what has been changed before you encounter this issue?

    I would like to suggest you go through the article below to troubleshoot this issue:

    Duplicate OpsMgr Alert Notifications Caused by Service Manager’s OpsMgr Alert Connector And Ways Around It.

    http://blog.tyang.org/2013/04/06/duplicate-opsmgr-alert-notifications-caused-by-service-managers-opsmgr-alert-connector-and-ways-around-it/

    Regards,

    Yan Li


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, May 9, 2016 9:13 AM
  • Thank you for your reply but this notification is not being triggered by an Ops Manager alert. The subscription is one of two notifications configured to "Periodically notify when objects meet a criteria" with the criteria being Work Item Has Action -> Action type = Record Assigned, Recurrence Pattern = Notify Once and Related Recipients being the Assigned To User. We have one notification subscription targeting the Service Request class and one targeting the Incident class.

    Nothing has changed with either of these subscriptions but for some reason the Service Request based notification ran again for all Service Requests. Going through the Work Item history for the requests affected I see no updates to the Action Log (or any new entries in History) for any of these but evidently the workflow engine thinks they were all updated.


    Monday, May 9, 2016 2:38 PM
  • Unfortunately this wasn't a one time issue as the same subscription resent all notifications again this week. It seems the 'Notify Once' recurrence pattern setting isn't being applied when the workflow does it's periodic check. 

    Now I'm looking at using a subscription based off 'on create' using the Trouble Ticket Action Log class. The problem with going this route is that both Incidents and Service Request will meet the 'create' criteria. I can set two subscriptions using different templates to pull the information for the email (one from Trouble Ticket Has Action Log for IRs and one from Work Item Has Action for SRs) but one of these will always end up sending into the void because the Assigned To user will be the wrong type.

    I did try the suggestions in these rather dated articles but had errors (Write Action TypeId) when trying to import the modified MP.

    https://blogs.technet.microsoft.com/servicemanager/2009/12/15/custom-notification-workflow-on-incident-assignement-or-re-assignment/  

    https://blogs.technet.microsoft.com/servicemanager/2013/05/13/how-to-configure-notifications-for-assignmentre-assignment-as-well-as-action-log-and-user-comment-updates-for-incidents-and-service-requests-in-scsm/

    If anyone has another way of handling assignment notifications I'd love to hear it. I did not expect something as simple as sending an email to the assigned analyst to be so convoluted.


    • Edited by WFricke Friday, May 13, 2016 9:29 PM
    Friday, May 13, 2016 9:27 PM