An HWS task may be reassigned to two distinct TaskID identifiers at the same time in BizTalk Server 2004


Symptoms


In Microsoft BizTalk Server 2004, a TaskID identifier for a Human Workflow Services (HWS) task may be reassigned to two distinct TaskID identifiers at the same time. For example, TaskID identifier A may be reassigned to TaskID identifier B and TaskID identifier C in the Hws_TaskReassignment table in BizTalkDTADb database.

When this issue occurs, the Hws_TaskReassignment table in the BizTalkDTADb database may appear similar to the following. In this example, A, B, and C are TaskID identifier GUIDs.
TaskIDReassignedToTaskIDFirstTaskID
ABA
BNULLA
CNULLA
Additionally, you may receive an error message when you call the GetAllTasksForUser function from the Microsoft BizTalk Server 2004 SDK.

Cause


This issue occurs because you submitted the same task two times.

Workaround


To work around this issue, delete the duplicate record from the Hws_TaskReassignment and Hws_Tasks tables in the BizTalkDTADb database.

More Information


To identify the duplicate records, run the following query in SQL Query Analyzer:
select trAll.*
from Hws_TaskReassignment tr
inner join Hws_TaskReassignment trAll
on tr.FirstTaskID = trAll.FirstTaskID
where tr.TaskID NOT IN
(
SELECT ReassignedToTaskID
FROM Hws_TaskReassignment
WHERE ReassignedToTaskID IS NOT NULL
)
and tr.ReassignedToTaskID IS NULL
order by trAll.FirstTaskID