locked
activity implementer - workflow RRS feed

  • Question

  • Ok I have a weird issue.....I have set a workflow for manual activities. Thw workflow basically runs when the change to has 2 items present....  an activity implementer and the status in progress. I have some users who do not fill it in manually since they have a choice of who needs to work on it depending on who is here.

    So basically now if a user forgets to fill in the manual activities it sits there until they fill it in. The workflow kicks in but sends out two e-mails 2 minutes apart everytime. Now I know it's great to actually have the e-mail sent but I'd like one if possible. I am including the XML code if you could help.

    ---

    Also I noticed that it sends the 2nd e-mail every 180 seconds......I changed the exchange connector from 180 seconds to 300 seconds to see if it made a difference.....nope. I am stumped. No other workflow is acting this way.

    ---

    <ManagementPack ContentReadable="true" SchemaVersion="2.0" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <Manifest>
        <Identity>
          <ID>ManagementPack.4030546b26664d35b4a34f1a3bb736af</ID>
          <Version>7.5.1561.0</Version>
        </Identity>
        <Name>E-Mail activity implementer</Name>
        <References>
          <Reference Alias="EnterpriseManagement">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_WorkItem_Activity_Library">
            <ID>System.WorkItem.Activity.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_WorkItem_Library">
            <ID>System.WorkItem.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_Library">
            <ID>System.Library</ID>
            <Version>7.5.8501.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="EnterpriseManagement1">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Administration</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="ActivityManagement">
            <ID>ServiceManager.ActivityManagement.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="SystemCenter">
            <ID>Microsoft.SystemCenter.Subscriptions</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
        </References>
      </Manifest>
      <Categories>
        <Category ID="Category.9b307164b9d149ba99688c11e472eca0" Value="EnterpriseManagement!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
          <ManagementPackName>ManagementPack.4030546b26664d35b4a34f1a3bb736af</ManagementPackName>
          <ManagementPackVersion>7.5.1561.0</ManagementPackVersion>
        </Category>
        <Category ID="Category.f7372624710c463d9dc4dcfb92253b04" Target="WorkflowSubscription_fb94ba9e_2861_438a_9bba_8bf86edb7bbe" Value="EnterpriseManagement1!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions" />
      </Categories>
      <Monitoring>
        <Rules>
          <Rule ID="WorkflowSubscription_fb94ba9e_2861_438a_9bba_8bf86edb7bbe" Enabled="true" Target="ActivityManagement!System.WorkItem.Activity.WorkflowTarget" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
            <Category>System</Category>
            <DataSources>
              <DataSource ID="DS" TypeID="SystemCenter!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
                <Subscription>
                  <InstanceSubscription Type="7ac62bd4-8fce-a150-3b40-16a39a61383d">
                    <UpdateInstance>
                      <Criteria>
                        <Expression>
                          <And>
                            <Expression>
                              <SimpleExpression>
                                <ValueExpression>
                                  <Property State="Post">$Context/Property[Type='CustomSystem_WorkItem_Activity_Library!System.WorkItem.Activity']/Status$</Property>
                                </ValueExpression>
                                <Operator>Equal</Operator>
                                <ValueExpression>
                                  <Value>{11fc3cef-15e5-bca4-dee0-9c1155ec8d83}</Value>
                                </ValueExpression>
                              </SimpleExpression>
                            </Expression>
                            <Expression>
                              <UnaryExpression>
                                <ValueExpression>
                                  <Property State="Post">$Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAssignedToUser' TypeConstraint='CustomSystem_Library!System.Domain.User']/Property[Type='CustomSystem_Library!System.Domain.User']/UserName$</Property>
                                </ValueExpression>
                                <Operator>IsNotNull</Operator>
                              </UnaryExpression>
                            </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>
                  <VisibleWorkflowStatusUi>true</VisibleWorkflowStatusUi>
                  <EnableBatchProcessing>false</EnableBatchProcessing>
                  <WindowsWorkflowConfiguration>
                    <AssemblyName>Microsoft.EnterpriseManagement.WorkflowFoundation</AssemblyName>
                    <WorkflowTypeName>Microsoft.EnterpriseManagement.WorkflowFoundation.ConfigurationWorkflow</WorkflowTypeName>
                    <WorkflowParameters>
                      <WorkflowParameter Name="InstanceId" Type="guid">$Data/BaseManagedEntityId$</WorkflowParameter>
                      <WorkflowParameter Name="NotificationRulesEnabled" Type="boolean">True</WorkflowParameter>
                      <WorkflowArrayParameter Name="NotificationTemplates" Type="guid">
                        <Item>e03deb1b-e560-9ca5-8974-c9e434efdbf2</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="true">
          <DisplayStrings>
            <DisplayString ElementID="ManagementPack.4030546b26664d35b4a34f1a3bb736af">
              <Name>E-Mail activity implementer</Name>
              <Description>E-mails the implementer the activity isn't filled in with it.</Description>
            </DisplayString>
            <DisplayString ElementID="WorkflowSubscription_fb94ba9e_2861_438a_9bba_8bf86edb7bbe">
              <Name>E-Mail Activity Implementer</Name>
              <Description>E-mails activity implementer if they fill it in after it's done.</Description>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
      </LanguagePacks>
    </ManagementPack>


    Help


    Thursday, September 20, 2012 8:34 PM

Answers

  • Ok get this. So I was playing around with it and any manual activities in the template I created sends 1 e-mail. If I add an manual template to the workflow it sends two. So I've gone back to my original workflow and it works fine for the original manual activities but if anyone adds an extra manual template to the workflow it sends 2. Does that make sense?

    Thanks


    Help

    Friday, September 21, 2012 4:31 PM

All replies

  • What's in the "Change from" criteria configured?

    Andreas Baumgarten | H&D International Group

    Thursday, September 20, 2012 8:57 PM
  • Change from is blank...... change to is the only thing filled in. The manual activity is set to "in progress" when there is no implementer. So I left it empty.

    Help

    Thursday, September 20, 2012 8:59 PM
  • Could you please create a criteria at the "Change from" tab. For instance "Status does not equal  In Progress" and "Assigned To User equals NULL".


    Andreas Baumgarten | H&D International Group

    Thursday, September 20, 2012 9:03 PM
  • I can do the status does not equal but there is no option for assign to user in the change from tab.

    I only have the assign to user option for the change to tab. I am using the when it is updated option in the workflow.


    Help

    Friday, September 21, 2012 2:00 AM
  • You can try to add the missing criteria of "Assigned to:" on the "Change from" tab in the xml code.

    It should look almost the same than the "<Property State="Post">" lines but with a "Pre" instead of the "Post".


    Andreas Baumgarten | H&D International Group

    Friday, September 21, 2012 3:48 AM
  • Thanks I will give it a shot today. I will add the status in the change from first to get an idea on how that changes to XML file and hopefully just insert the assigned to in the code. Thanks I will let you know if it works.

    Help

    Friday, September 21, 2012 11:01 AM
  • Ok tried editing the XML file and got this error when I try to import it back. I think I got it right but it's not liking the value NULL.

    The management pack import failed.
    Errors (1):
    The configuration specified for Module DS is not valid.
    : Schema validation failed.
    The 'Operator' element is invalid - The value 'Null' is invalid according to its datatype 'UnaryOperatorType' - The Enumeration constraint failed.The Enumeration constraint failed.

    <ManagementPack ContentReadable="true" SchemaVersion="2.0" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <Manifest>
        <Identity>
          <ID>ManagementPack.4030546b26664d35b4a34f1a3bb736af</ID>
          <Version>7.5.1561.0</Version>
        </Identity>
        <Name>E-Mail activity implementer</Name>
        <References>
          <Reference Alias="EnterpriseManagement">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_WorkItem_Activity_Library">
            <ID>System.WorkItem.Activity.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_WorkItem_Library">
            <ID>System.WorkItem.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="CustomSystem_Library">
            <ID>System.Library</ID>
            <Version>7.5.8501.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="EnterpriseManagement1">
            <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Administration</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="ActivityManagement">
            <ID>ServiceManager.ActivityManagement.Library</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="SystemCenter">
            <ID>Microsoft.SystemCenter.Subscriptions</ID>
            <Version>7.5.1561.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
        </References>
      </Manifest>
      <Categories>
        <Category ID="Category.9b307164b9d149ba99688c11e472eca0" Value="EnterpriseManagement!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
          <ManagementPackName>ManagementPack.4030546b26664d35b4a34f1a3bb736af</ManagementPackName>
          <ManagementPackVersion>7.5.1561.0</ManagementPackVersion>
        </Category>
        <Category ID="Category.f7372624710c463d9dc4dcfb92253b04" Target="WorkflowSubscription_fb94ba9e_2861_438a_9bba_8bf86edb7bbe" Value="EnterpriseManagement1!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions" />
      </Categories>
      <Monitoring>
        <Rules>
          <Rule ID="WorkflowSubscription_fb94ba9e_2861_438a_9bba_8bf86edb7bbe" Enabled="true" Target="ActivityManagement!System.WorkItem.Activity.WorkflowTarget" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
            <Category>System</Category>
            <DataSources>
              <DataSource ID="DS" TypeID="SystemCenter!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
                <Subscription>
                  <InstanceSubscription Type="7ac62bd4-8fce-a150-3b40-16a39a61383d">
                    <UpdateInstance>
                      <Criteria>
                        <Expression>
                          <And>
                            <Expression>
                              <SimpleExpression>
                                <ValueExpression>
                                  <Property State="Pre">$Context/Property[Type='CustomSystem_WorkItem_Activity_Library!System.WorkItem.Activity']/Status$</Property>
                                </ValueExpression>
                                <Operator>NotEqual</Operator>
                                <ValueExpression>
                                  <Value>{11fc3cef-15e5-bca4-dee0-9c1155ec8d83}</Value>
                                </ValueExpression>
                              </SimpleExpression>
                            </Expression>
    			   <Expression>
                                  <UnaryExpression>
                                    <ValueExpression>
                                      <Property State="Pre">$Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAssignedToUser' TypeConstraint='CustomSystem_Library!System.Domain.User']/Property[Type='CustomSystem_Library!System.Domain.User']/UserName$</Property>
                                    </ValueExpression>
                                    <Operator>Null</Operator>
                                  </UnaryExpression>
                                </Expression>
                            <Expression>
                              <And>
                                <Expression>
                                  <SimpleExpression>
                                    <ValueExpression>
                                      <Property State="Post">$Context/Property[Type='CustomSystem_WorkItem_Activity_Library!System.WorkItem.Activity']/Status$</Property>
                                    </ValueExpression>
                                    <Operator>Equal</Operator>
                                    <ValueExpression>
                                      <Value>{11fc3cef-15e5-bca4-dee0-9c1155ec8d83}</Value>
                                    </ValueExpression>
                                  </SimpleExpression>
                                </Expression>
                                <Expression>
                                  <UnaryExpression>
                                    <ValueExpression>
                                      <Property State="Post">$Context/Path[Relationship='CustomSystem_WorkItem_Library!System.WorkItemAssignedToUser' TypeConstraint='CustomSystem_Library!System.Domain.User']/Property[Type='CustomSystem_Library!System.Domain.User']/UserName$</Property>
                                    </ValueExpression>
                                    <Operator>IsNotNull</Operator>
                                  </UnaryExpression>
                                </Expression>
                              </And>
                            </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>
                  <VisibleWorkflowStatusUi>true</VisibleWorkflowStatusUi>
                  <EnableBatchProcessing>false</EnableBatchProcessing>
                  <WindowsWorkflowConfiguration>
                    <AssemblyName>Microsoft.EnterpriseManagement.WorkflowFoundation</AssemblyName>
                    <WorkflowTypeName>Microsoft.EnterpriseManagement.WorkflowFoundation.ConfigurationWorkflow</WorkflowTypeName>
                    <WorkflowParameters>
                      <WorkflowParameter Name="InstanceId" Type="guid">$Data/BaseManagedEntityId$</WorkflowParameter>
                      <WorkflowParameter Name="NotificationRulesEnabled" Type="boolean">True</WorkflowParameter>
                      <WorkflowArrayParameter Name="NotificationTemplates" Type="guid">
                        <Item>e03deb1b-e560-9ca5-8974-c9e434efdbf2</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="true">
          <DisplayStrings>
            <DisplayString ElementID="ManagementPack.4030546b26664d35b4a34f1a3bb736af">
              <Name>E-Mail activity implementer</Name>
              <Description>E-mails the implementer the activity isn't filled in with it.</Description>
            </DisplayString>
            <DisplayString ElementID="WorkflowSubscription_fb94ba9e_2861_438a_9bba_8bf86edb7bbe">
              <Name>E-Mail Activity Implementer</Name>
              <Description>E-mails activity implementer if they fill it in after it's done.</Description>
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
      </LanguagePacks>
    </ManagementPack>


    Help

    Friday, September 21, 2012 1:14 PM
  • Can you modify the operator to IsNull please:

    <Operator>IsNull</Operator>


    Andreas Baumgarten | H&D International Group

    Friday, September 21, 2012 1:35 PM
  • Ok did that and was able to import it in. Looks like it removed the status which I will add in now and test.

    I will let you know.


    Help

    Friday, September 21, 2012 1:41 PM
  • Ok I have it all set but no e-mails are sent. I checked the status of the managementpack and don't see anything running. Not sure how to troubleshoot that one.

    Help

    Friday, September 21, 2012 2:56 PM
  • What happens if you only use the status criteria in the change from

    Andreas Baumgarten | H&D International Group

    Friday, September 21, 2012 3:02 PM
  • Nothing. I tried it again and nothing happens.

    I remove the change from "Assigned To User" and it works but still sends out two e-mails occassionally now for the manual activities.


    Weird


    Help

    Friday, September 21, 2012 4:04 PM
  • Ok get this. So I was playing around with it and any manual activities in the template I created sends 1 e-mail. If I add an manual template to the workflow it sends two. So I've gone back to my original workflow and it works fine for the original manual activities but if anyone adds an extra manual template to the workflow it sends 2. Does that make sense?

    Thanks


    Help

    Friday, September 21, 2012 4:31 PM
  • Not sure if you can replicate what I saw. Either way have a nice weekend and thank you for your assistance and suggestions.

    Help

    Friday, September 21, 2012 9:22 PM