Kapsayıcı Etkinlik Durumu Uyarısı
ServiceManager.ActivityManagement.ContainerActivityStatusAlertRule (Rule)
Element properties:
Member Modules:
Source Code:
<Rule ID="ServiceManager.ActivityManagement.ContainerActivityStatusAlertRule" Enabled="true" Target="System.WorkItem.Activity.InternalWorkflowTarget" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>System</Category>
<DataSources>
<DataSource ID="DS" TypeID="Subscriptions!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
<Subscription>
<InstanceSubscription Type="$MPElement[Name='Activity!System.WorkItem.Activity.ContainerActivity']$">
<UpdateInstance>
<Criteria>
<Expression>
<Or>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<Property State="Pre">$Context/Property[Type='Activity!System.WorkItem.Activity.ContainerActivity']/Status$</Property>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value>$MPElement[Name="Activity!ActivityStatusEnum.OnHold"]$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<Property State="Post">$Context/Property[Type='Activity!System.WorkItem.Activity.ContainerActivity']/Status$</Property>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$MPElement[Name="Activity!ActivityStatusEnum.OnHold"]$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<Property State="Pre">$Context/Property[Type='Activity!System.WorkItem.Activity.ContainerActivity']/Status$</Property>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value>$MPElement[Name="Activity!ActivityStatusEnum.Cancelled"]$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<Property State="Post">$Context/Property[Type='Activity!System.WorkItem.Activity.ContainerActivity']/Status$</Property>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$MPElement[Name="Activity!ActivityStatusEnum.Cancelled"]$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<Property State="Pre">$Context/Property[Type='Activity!System.WorkItem.Activity.ContainerActivity']/Status$</Property>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value>$MPElement[Name="Activity!ActivityStatusEnum.Active"]$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<Property State="Pre">$Context/Property[Type='Activity!System.WorkItem.Activity.ContainerActivity']/Status$</Property>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value>$MPElement[Name="Activity!ActivityStatusEnum.Rerun"]$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<Property State="Post">$Context/Property[Type='Activity!System.WorkItem.Activity.ContainerActivity']/Status$</Property>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$MPElement[Name="Activity!ActivityStatusEnum.Active"]$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<Property State="Pre">$Context/Property[Type='Activity!System.WorkItem.Activity.ContainerActivity']/Status$</Property>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$MPElement[Name="Activity!ActivityStatusEnum.OnHold"]$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<Property State="Post">$Context/Property[Type='Activity!System.WorkItem.Activity.ContainerActivity']/Status$</Property>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$MPElement[Name="Activity!ActivityStatusEnum.Ready"]$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</Or>
</Expression>
</Criteria>
</UpdateInstance>
</InstanceSubscription>
<!--<StartWatermark>1</StartWatermark>-->
<PollingIntervalInSeconds>10</PollingIntervalInSeconds>
<BatchSize>100</BatchSize>
</Subscription>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WindowsWorkflow" TypeID="Subscriptions!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
<Subscription>
<WindowsWorkflowConfiguration>
<AssemblyName>Microsoft.EnterpriseManagement.ServiceManager.ActivityManagement.Workflows</AssemblyName>
<WorkflowTypeName>Microsoft.EnterpriseManagement.ServiceManager.ActivityManagement.Workflows.ContainerActivityStatusAlertWorkflow</WorkflowTypeName>
<WorkflowParameters>
<WorkflowParameter Name="InstanceId" Type="guid">$Data/BaseManagedEntityId$</WorkflowParameter>
</WorkflowParameters>
<RetryExceptions>
<RetryException>Microsoft.EnterpriseManagement.Common.DiscoveryDataModificationCollisionException, Microsoft.EnterpriseManagement.Core, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</RetryException>
</RetryExceptions>
<RetryDelaySeconds>11</RetryDelaySeconds>
<MaximumRunningTimeSeconds>7200</MaximumRunningTimeSeconds>
</WindowsWorkflowConfiguration>
</Subscription>
</WriteAction>
</WriteActions>
</Rule>