Operation Details
Description: Returns the details of tasks that are assigned to a specified member of a specified organization unit and that are due within the specified time period. The search criteria allow for the details of reserved tasks, assigned tasks or all of the tasks to be returned. The results are ordered by assigned date time, earliest first.
Sterotype: nsmulti
SQL
SELECT
  t.taskID,
  t.priority,
  t.reservedBy,
  u.fullName,
  t.assignedDateTime,
  t.wdoSnapshot,
  t.overflowInd,
  t.versionNo
INTO
  :taskID,
  :taskPriority,
  :taskReservedByUserName,
  :taskReservedByFullUserName,
  :taskAssignedDateTime,
  :taskWDOSnapshot,
  :taskWDOOverflowInd,
  :versionNo 
FROM
  Task t 
  
  LEFT OUTER JOIN
  
  Users u 
  ON (t.reservedBy = u.userName) 
  
  LEFT OUTER JOIN
  
  WorkflowDeadline w 
  ON (t.taskID = w.taskID) 
WHERE w.deadlineTime >= :fromDeadlineDateTime 
  AND w.deadlineTime < :toDeadlineDateTime 
  AND 
  (
    t.taskID IN 
    ( 
    SELECT
      taskID 
    FROM
      TaskAssignment u 
    WHERE u.relatedName = :userName 
      AND u.assigneeType = 'RL9' 
    ) 
  ) 
  AND 
  (
    
    (
      :allOrgUnitTasksInd = '0' 
      OR 
      (
        t.reservedBy IS NULL 
        OR t.reservedBy IS NOT NULL 
      ) 
    ) 
    AND 
    (
      :allReservedOrgUnitTasksInd = '0' 
      OR t.reservedBy = :userName 
    ) 
    AND 
    (
      :allAssignedOrgUnitTasksInd = '0' 
      OR t.reservedBy IS NULL 
    ) 
  ) 
ORDER BY t.assignedDateTime ASC