locked
Workflow repeatedly wrongly triggered RRS feed

  • Question

  • Last week we had a custom workflow being repeatedly triggered by one single incident for no apparent reason. The incident in question had already been closed when it started. This resulted in that the "Assigned To" user received 100-150 emails... Not very good in other words.

    The workflow looks like this.

    Criteria
    Changed from: "incident_updated" does not equal "False"
    Changed to: "incident_updated" equals "True"

    The list property "incident_updated" is part of an extension to the Incident class.

    The workflow then applies a template (which only sets the "incident_updated" property to "False") and sends a notification to the "Assigned To User".

    Incident
    See this screenshot to see what happened to the incident.
    http://img26.imageshack.us/img26/7915/ir32362history.jpg
    All entries below 2011-08-26 13:19:50 are the same as that one.

    Workflow Status
    See the following two screenshots for the status list of the workflow and the log output of one of the instances.
    http://img64.imageshack.us/img64/2095/workflowstatus.jpg
    http://img842.imageshack.us/img842/3562/logoutput.jpg

    We are running SP1 CU2 on all servers (one management server, one DW server and one web server).

    At the time I checked the event logs and there were no errors or warnings.

    I tried restarting services and thereafter rebooting the management server but it didn't stop the workflow from being triggered.
    In the end I had to disable the workflow and create a new one (with exactly the same settings).

    Please ask if you need any further details to be able to investigate what may have caused this!

    Thanks in advance!

    /Alexander

     



    Monday, August 29, 2011 8:48 AM

All replies

  • Hi,

    If your criteria is set to:

    Changed from: "incident_updated" does not equal "False"
    Changed to: "incident_updated" equals "True"

    ...then it's wrong. Was that just a typo or is it really your criteria?

    Regards
    //Anders


    Anders Asp | Lumagate | www.lumagate.com | Sweden | My blog: www.scsm.se
    Monday, August 29, 2011 9:23 AM
  • Hi,

    If your criteria is set to:

    Changed from: "incident_updated" does not equal "False"
    Changed to: "incident_updated" equals "True"

    ...then it's wrong. Was that just a typo or is it really your criteria?

    Regards
    //Anders


    Anders Asp | Lumagate | www.lumagate.com | Sweden | My blog: www.scsm.se

    Hi Anders,

    I had to look at the "old" workflow and actually it wasn't a typo. I know it's better to have it set to "does not equal true" but even so it should only trigger when the value changes FROM anything but "false" TO "true" right? But in the case of this incident the "incident_updated" property isn't changed but instead SM_Workflow repeatedly removes/adds the Closed By/Resolved By user.

    /Alexander
    Tuesday, August 30, 2011 6:27 AM
  • Idk how you list looks like, but if it only consists of True and False, then this workflow should never trigger :P
    (Oki, it might trigger once, and that is if you haven't set a default value)

    It might help if you could show us the XML code of the "Notify assigned to user when an incident is updated by email" workflow.

    Regards
    //Anders


    Anders Asp | Lumagate | www.lumagate.com | Sweden | My blog: www.scsm.se
    Sunday, September 4, 2011 10:20 AM
  • Idk how you list looks like, but if it only consists of True and False, then this workflow should never trigger :P
    (Oki, it might trigger once, and that is if you haven't set a default value)

    It might help if you could show us the XML code of the "Notify assigned to user when an incident is updated by email" workflow.

    Regards
    //Anders


    Anders Asp | Lumagate | www.lumagate.com | Sweden | My blog: www.scsm.se

    You're right. The reason it triggered and seemed to work was that we have no default value set.

    I've included the XML below. Please ignore the names of the workflow/MP as I've recreated the workflow with the same settings as the original in a separate MP to make it easier to read it..

    <ManagementPack ContentReadable="true" SchemaVersion="1.1" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <Manifest>
        <Identity>
          <ID>ManagementPack.008de1275d9c4cbbb968ed45e243bfd6</ID>
          <Version>7.0.6555.0</Version>
        </Identity>
        <Name>Email update temp MP</Name>
        <References>
          <Reference Alias="EnterpriseManagement">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomPerstorp_IncidentClass_Extension">
            <ID>Perstorp.IncidentClass.Extension</ID>
            <Version>1.0.0.10</Version>
            <PublicKeyToken>348b7193818334d9</PublicKeyToken>
          </Reference>
          <Reference Alias="EnterpriseManagement1">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Administration</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="IncidentManagement">
            <ID>ServiceManager.IncidentManagement.Library</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="SystemCenter">
            <ID>Microsoft.SystemCenter.Subscriptions</ID>
            <Version>7.0.6555.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
        </References>
      </Manifest>
      <Categories>
        <Category ID="Category.aa11888470ee432eb0c8bdfd220af377" Value="EnterpriseManagement!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
          <ManagementPackName>ManagementPack.008de1275d9c4cbbb968ed45e243bfd6</ManagementPackName>
          <ManagementPackVersion>7.0.6555.0</ManagementPackVersion>
        </Category>
        <Category ID="Category.d6f494e14fc94814bb2c517d962b8237" Target="WorkflowSubscription_e21278ae_2bd6_4dc9_8b00_20863b0bc55a" Value="EnterpriseManagement1!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions" />
        <Category ID="Category.63a41fdf46964e258223bf48f23d4fd5" Target="WorkflowSubscription_e21278ae_2bd6_4dc9_8b00_20863b0bc55a" Value="EnterpriseManagement1!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions" />
      </Categories>
      <Monitoring>
        <Rules>
          <Rule ID="WorkflowSubscription_e21278ae_2bd6_4dc9_8b00_20863b0bc55a" Enabled="false" Target="IncidentManagement!System.WorkItem.Incident.Wizard.AutomaticChangeIncident" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
            <Category>System</Category>
            <DataSources>
              <DataSource ID="DS" TypeID="SystemCenter!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
                <Subscription>
                  <InstanceSubscription Type="a604b942-4c7b-2fb2-28dc-61dc6f465c68">
                    <UpdateInstance>
                      <Criteria>
                        <Expression>
                          <And>
                            <Expression>
                              <SimpleExpression>
                                <ValueExpression>
                                  <Property State="Pre">$Context/Property[Type='CustomPerstorp_IncidentClass_Extension!ClassExtension_6d21bb87_a7af_409d_a81b_207ca8bfce58']/incident_updated$</Property>
                                </ValueExpression>
                                <Operator>NotEqual</Operator>
                                <ValueExpression>
                                  <Value>{1fa6a0d2-4173-8bbd-1fb9-a77163371a67}</Value>
                                </ValueExpression>
                              </SimpleExpression>
                            </Expression>
                            <Expression>
                              <SimpleExpression>
                                <ValueExpression>
                                  <Property State="Post">$Context/Property[Type='CustomPerstorp_IncidentClass_Extension!ClassExtension_6d21bb87_a7af_409d_a81b_207ca8bfce58']/incident_updated$</Property>
                                </ValueExpression>
                                <Operator>Equal</Operator>
                                <ValueExpression>
                                  <Value>{24c827f7-9eec-cb76-27fd-93a709378ccf}</Value>
                                </ValueExpression>
                              </SimpleExpression>
                            </Expression>
                          </And>
                        </Expression>
                      </Criteria>
                    </UpdateInstance>
                  </InstanceSubscription>
                  <PollingIntervalInSeconds>100</PollingIntervalInSeconds>
                  <BatchSize>50</BatchSize>
                </Subscription>
              </DataSource>
            </DataSources>
            <WriteActions>
              <WriteAction ID="WA" TypeID="SystemCenter!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
                <Subscription>
                  <EnableBatchProcessing>true</EnableBatchProcessing>
                  <WindowsWorkflowConfiguration>
                    <AssemblyName>Microsoft.EnterpriseManagement.ServiceManager.Incident.Workflows</AssemblyName>
                    <WorkflowTypeName>Microsoft.EnterpriseManagement.ServiceManager.Incident.Workflows.AutomaticIncidentChangeWorkflow</WorkflowTypeName>
                    <WorkflowParameters>
                      <WorkflowArrayParameter Name="InstanceIds" Type="guid">
                        <Item>$Data/BaseManagedEntityId$</Item>
                      </WorkflowArrayParameter>
                      <WorkflowParameter Name="IncidentTemplate" Type="guid">ae099e0c-a151-0949-706d-e71e2ecf22c9</WorkflowParameter>
                      <WorkflowParameter Name="NotificationRulesEnabled" Type="boolean">True</WorkflowParameter>
                      <WorkflowArrayParameter Name="NotificationTemplates" Type="guid">
                        <Item>0acbf2e3-10e9-fcfb-8c17-90f7733c8914</Item>
                      </WorkflowArrayParameter>
                      <WorkflowArrayParameter Name="UserAliasOrRelationships" Type="string">
                        <Item>15e577a3-6bf9-6713-4eac-ba5a5b7c4722</Item>
                      </WorkflowArrayParameter>
                    </WorkflowParameters>
                    <RetryExceptions />
                    <RetryDelaySeconds>60</RetryDelaySeconds>
                    <MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>
                  </WindowsWorkflowConfiguration>
                </Subscription>
              </WriteAction>
            </WriteActions>
          </Rule>
        </Rules>
      </Monitoring>
      <LanguagePacks>
        <LanguagePack ID="ENU" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="ManagementPack.008de1275d9c4cbbb968ed45e243bfd6">
              <Name>Email update temp MP</Name>
            </DisplayString>
            <DisplayString ElementID="WorkflowSubscription_e21278ae_2bd6_4dc9_8b00_20863b0bc55a">
              <Name>Email update temp workflow</Name>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
        <LanguagePack ID="SVE" IsDefault="false">
          <DisplayStrings>
            <DisplayString ElementID="WorkflowSubscription_e21278ae_2bd6_4dc9_8b00_20863b0bc55a">
              <Name>Email update temp workflow</Name>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
      </LanguagePacks>
    </ManagementPack>
    

    /Alexander

    Tuesday, September 6, 2011 8:22 AM