IRuntimeService API: C# Sample Code

1. Get all tasks of this user by User ID | 2. Get one specific task | 3. Save temporarily or complete a task4. Change the task's assignee5. Add variable into the specific task 

Example: 

1. Get all tasks of this user by User ID. 

  1.         // Get all tasks of this user by User ID.
  2.         List<ITask> tasks = taskService.GetTasks(userId);

2. Get one specific task.

  1.         // Get the specific task by Task ID
  2.         ITask task = taskService.GetTask(taskId);
  3.         // Get the specific Task by User ID and the specific ProcessInstanceID
  4.         task = taskService.GetTask(userId, instanceId);

3. Save temporarily or complete a task

  1.         // Save the task temporarily
  2.         taskService.SaveTask(task);
  3.         // Complete the task
  4.         taskService.CompleteTask(task);

4. Change the task's assignee

  1.         // Change the task's assignee
  2.         task.ChangeAssignee("steve");

5. Add variable into the specific task 

  1.         // Add variable into the specific task 
  2.         task.AddVariable("Test Task Var", "Testing Variables.....");

Last edited Jun 13, 2012 at 8:16 AM by cathysung, version 6

Comments

No comments yet.