2. Manager Approval: Controller Program

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

C#:

(1) RetrieveToDo Method

  1.         RetrieveToDoList vdb = new RetrieveToDoList();
  2.         // Get a Task Service
  3.         HSDc.RingleFlow.Api.IWorkflowEngine engine = HSDc.RingleFlow.Api.Factory.WorkflowEngineFactory.GetInstance();
  4.         HSDc.RingleFlow.Api.Service.ITaskService taskService = engine.TaskService;
  5.         List<HSDc.RingleFlow.Api.Kernel.ITask> tasks = taskService.GetTasks(EmpId);
  6.         foreach (HSDc.RingleFlow.Api.Kernel.ITask item in tasks) {
  7.              vdb.Task.AddTaskRow(item.Id, item.Instance.Definition.Name, item.TaskName);
  8.         }
  9.         return vdb;

(2) CompleteTask Method

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

(3) GetTask Method

  1.         // Get a Task Service
  2.         HSDc.RingleFlow.Api.IWorkflowEngine engine = HSDc.RingleFlow.Api.Factory.WorkflowEngineFactory.GetInstance();
  3.         HSDc.RingleFlow.Api.Service.ITaskService taskService = engine.TaskService;
  4.         return taskService.GetTask(EmpID, InstanceID);

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

Comments

No comments yet.