Tasks class
The Tasks object specifies a collection of loaded task objects. An instance of the Tasks collection is provided by the Session object.
Namespace: |
IYOPRO.Api |
Assembly: |
IYOPRO.Api (in IYOPRO.Api.dll) |
Methods
void Load(DateTime startDate, DateTime endDate, Dictionary<int, List<int>> activities, List<string> attributes, object userdata = null)
-
Retrieves tasks for the given user.
Names is an optional filter for process instance names.
StartDate and endDate are filters and specify the time range for the finishedDate of these tasks, which are finished.
Activities filter specifies a list of Activity control ids (out of the diagrams) which are requested
Attributes specify a list of process instance variable names, which should be retrieved.
Userdata will be provided in the TasksLoadedEventArgs
Events
TasksLoadedEvent TasksLoaded
-
The TasksLoaded event is triggered if the Load method has finished.
Example
// Load list of tasks
Session session = ...;
Tasks.TasksLoadedEvent handler = null;
handler = (s, args) =>
{
session.Tasks.TasksLoaded -= handler;
Data = args.Data;
...
};
session.Tasks.TasksLoaded += handler;
public Dictionary<int, List<int>> filter = // This is a filter. Here you specify, what tasks should be retrieved
new Dictionary<int, List<int>>() {
{
11175, // This is the Diagram Id that holds the Task.
new List<int>() { 72 } // This is a list of Task Id's inside the diagram.
}
};
// Skip all finished tasks and retrieve process variables Number and FormData
session.Tasks.Load(DateTime.UtcNow, DateTime.MaxValue, filter, new List<string>() { "Number", "FormData" });