This project is read-only.

2. Manager Approval: Controller Program

(Includes (1) RetrieveToDo Method, (2) CompleteTask Method and (3) GetTask Method above.)

VB .NET: 

(1) RetrieveToDo Method

  1.         Dim vdb As New RetrieveToDoList()
  2.         ' Get a Task Service
  3.         Dim engine As HSDc.RingleFlow.Api.IWorkflowEngine = HSDc.RingleFlow.Api.Factory.WorkflowEngineFactory.GetInstance()
  4.         Dim taskService As HSDc.RingleFlow.Api.Service.ITaskService = engine.TaskService
  5.         Dim tasks As List(Of HSDc.RingleFlow.Api.Kernel.ITask) = taskService.GetTasks(EmpId)
  6.         For Each item As HSDc.RingleFlow.Api.Kernel.ITask In tasks
  7.             vdb.Task.AddTaskRow(item.Id, item.Instance.Definition.Name, item.TaskName)
  8.         Next
  9.         Return vdb

(2) CompleteTask Method

  1.         ' Get a Task Service
  2.         Dim engine As HSDc.RingleFlow.Api.IWorkflowEngine = HSDc.RingleFlow.Api.Factory.WorkflowEngineFactory.GetInstance()
  3.         Dim taskService As HSDc.RingleFlow.Api.Service.ITaskService = engine.TaskService
  4.         ' Complete Task
  5.         Dim task As HSDc.RingleFlow.Api.Kernel.ITask = taskService.GetTask(TaskID)
  6.         task.AddVariable("submitResult", YesNo.ToString())
  7.         taskService.CompleteTask(task)

(3) GetTask Method

  1.         ' Get a Task Service
  2.         Dim engine As HSDc.RingleFlow.Api.IWorkflowEngine = HSDc.RingleFlow.Api.Factory.WorkflowEngineFactory.GetInstance()
  3.         Dim taskService As HSDc.RingleFlow.Api.Service.ITaskService = engine.TaskService
  4.         Return taskService.GetTask(EmpID, InstanceID)

Last edited Jun 25, 2012 at 3:06 PM by cathysung, version 2

Comments

No comments yet.