Oledb probe for WF workflow monitoring

Microsoft.SystemCenter.ServiceManager.Monitoring.OledbProbe.WWFWorkflows (DataSourceModuleType)

This datasource module connects to the Service Manager database.It is used in WF workflow monitoring.

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityInternal
RunAsMicrosoft.SystemCenter.ServiceManager.DatabaseWriteActionAccount
OutputTypeSystem.OleDbData

Member Modules:

ID Module Type TypeId RunAs 
Scheduler DataSource System.SimpleScheduler Default
SQLProbe ProbeAction System.OleDbProbe Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
IntervalSecondsint$Config/IntervalSeconds$Interval SecondsHealth of this monitor will be recalculated once per IntervalSeconds.
SyncTimestring$Config/SyncTime$Sync TImeHealth of this monitor will be recalculated at sync time.

Source Code:

<DataSourceModuleType ID="Microsoft.SystemCenter.ServiceManager.Monitoring.OledbProbe.WWFWorkflows" Accessibility="Internal" RunAs="SM!Microsoft.SystemCenter.ServiceManager.DatabaseWriteActionAccount" Batching="false">
<Configuration>
<xsd:element name="IntervalSeconds" type="xsd:integer"/>
<xsd:element name="SyncTime" type="xsd:string"/>
<xsd:element name="ConnectionString" type="xsd:string"/>
<xsd:element name="Query" type="xsd:string"/>
<xsd:element name="GetValue" type="xsd:boolean"/>
<xsd:element name="IncludeOriginalItem" type="xsd:boolean"/>
<xsd:element name="OneRowPerItem" type="xsd:boolean"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.SimpleScheduler">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
</DataSource>
<ProbeAction ID="SQLProbe" TypeID="System!System.OleDbProbe">
<ConnectionString>Provider=SQLNCLI11;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(4000),DisplayStringView.DisplayName),
JobStatusView.Status,
JobStatusView.SubmittedBy,
ISNULL([JobStatusView].[ErrorMessage],'') AS [ErrorMessage],
[WindowsWorkflowTaskJobStatus].[BaseManagedEntityId],
[WindowsWorkflowTaskJobStatus].[RuleId],
ISNULL([WindowsWorkflowTaskJobStatus].[ErrorMessage],'') AS [TaskSubmissionErrorMessage]
FROM dbo.WindowsWorkflowTaskJobStatus
LEFT OUTER JOIN dbo.Rules
ON dbo.WindowsWorkflowTaskJobStatus.RuleId = dbo.Rules.RuleId
LEFT OUTER JOIN dbo.JobStatusView
ON dbo.[JobStatusView].[BatchId] = dbo.[WindowsWorkflowTaskJobStatus].[BatchId]
JOIN dbo.DisplayStringView ON dbo.DisplayStringView.MPElementId = dbo.Rules.RuleId AND DisplayStringView.LanguageCode ='ENU'
WHERE
(
( (dbo.WindowsWorkflowTaskJobStatus.LastModified &gt; DATEADD(second,-($Config/IntervalSeconds$),GETUTCDATE())) AND
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)
)
)
)

</Query>
<GetValue>$Config/GetValue$</GetValue>
<IncludeOriginalItem>$Config/IncludeOriginalItem$</IncludeOriginalItem>
<OneRowPerItem>$Config/OneRowPerItem$</OneRowPerItem>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="SQLProbe">
<Node ID="Scheduler"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.OleDbData</OutputType>
</DataSourceModuleType>