WF Workflows

Microsoft.SystemCenter.ServiceManager.WWFWorkflows.Monitor (UnitMonitor)

Workflow Monitor

Knowledge Base article:

Summary

Usually Windows Workflow failures can happen due to one of the following reasons. The active alerts view will have an alert associated with this failure. Alert knowledge will indicate the specific cause of the failure. If this monitor has been red since the management pack was imported and there are no alerts in the alerts view, it is possible that there were workflows failures existing in the system even before the management pack was imported. To turn this monitor green, please ignore all old workflow failures from the Service Manager console.

Causes

1. WF Workflow Failed : Workflow failures indicate that the workflow has run into a problem which caused it to stop working. A failed workflow usually implies that the issue is known.Workflows can fail for a multitude of reasons, such as the workflow account not having the needed level of permissions to complete an activity, resources not being available, connectivity issues, etc…

2. WF Workflow Submission Failed : This workflow did not get submitted to be run by the monitoring host.

3. WF Workflow Exception : The workflow status is showing as “Successful” but has had an exception. It should be confirmed that the expected result was obtained, and if not, the action that was performed to start the workflow, may need to be repeated. Software error in the Workflow Code will cause it to fail and throw an exception.

4. WF Workflow Time Out : If a workflow does not complete an activity within 25 minutes, it will time out. The workflow may be stuck in either the started or scheduled phase, and will appear in the “Need Attention” tab which can be found in the Service Manager console, in the administration/workflows/status view for that particular type of workflow. There are a multitude of causes for workflow time outs, such as running when a service is restarted, a long queue, or APIs that are taking a long time to return.

Resolutions

If WF Workflow Failed,

If WF Workflow Submission Failed,

If WF Workflow Exception,

If WF Workflow Time Out,

Element properties:

TargetMicrosoft.SystemCenter.ServiceManager.SmManagementServer
Parent MonitorMicrosoft.ServiceManager.Workflows.AvailabilityHealthRollup
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SystemCenter.ServiceManager.Workflows.OLEDB.Monitoring.DBProbeMonitorType
RemotableTrue
AccessibilityPublic
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.ServiceManager.WWFWorkflows.Monitor" Accessibility="Public" Enabled="true" Target="SM!Microsoft.SystemCenter.ServiceManager.SmManagementServer" ParentMonitorID="Microsoft.ServiceManager.Workflows.AvailabilityHealthRollup" Remotable="true" Priority="Normal" TypeID="Microsoft.SystemCenter.ServiceManager.Workflows.OLEDB.Monitoring.DBProbeMonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<OperationalStates>
<OperationalState ID="ComponentUnhealthy" MonitorTypeStateID="State1" HealthState="Warning"/>
<OperationalState ID="ComponentHealthy" MonitorTypeStateID="State2" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>60</IntervalSeconds>
<SyncTime/>
<ConnectionString>Provider=SQLOLEDB;Server=$Target/Property[Type='SM!Microsoft.SystemCenter.ServiceManager.SmManagementServer']/SmDbHostName$;Database=$Target/Property[Type='SM!Microsoft.SystemCenter.ServiceManager.SmManagementServer']/SMDbName$;Integrated Security=SSPI</ConnectionString>
<Query>
SELECT CONVERT(nvarchar,COUNT(*))
FROM dbo.WindowsWorkflowTaskJobStatus
LEFT OUTER JOIN dbo.JobStatusView
ON dbo.[JobStatusView].[BatchId] = dbo.[WindowsWorkflowTaskJobStatus].[BatchId]
LEFT OUTER JOIN dbo.MySubscriptions
ON dbo.[WindowsWorkflowTaskJobStatus].[RuleId] = dbo.[MySubscriptions].[RuleEntityId]
WHERE ((
dbo.[WindowsWorkflowTaskJobStatus].[Processed] IS NULL
AND
( (dbo.[WindowsWorkflowTaskJobStatus].[ErrorMessage] IS NOT NULL)
OR (dbo.[JobStatusView].Status = 3)
OR ((dbo.[JobStatusView].Status = 0 OR dbo.[JobStatusView].Status = 1)
AND
(DATEDIFF(MINUTE, dbo.[JobStatusView].TimeScheduled, GETUTCDATE()) &gt;= 25)
)
OR( dbo.[JobStatusView].Status = 2)
OR( dbo.[JobStatusView].Status is NULL)
)
))
</Query>
<State1Filter>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Columns/Column[1]</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="String">0</Value>
</ValueExpression>
</SimpleExpression>
</State1Filter>
<State2Filter>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Columns/Column[1]</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">0</Value>
</ValueExpression>
</SimpleExpression>
</State2Filter>
</Configuration>
</UnitMonitor>