Assembly: System;
Namespace: Prognoz.Platform.Interop.ForeSystem;
The ITask interface contains basic methods and properties that are used to work with tasks.
ITask
A task is a unit of executable code started in synchronous or asynchronous mode with respect to the current application.
The current implementation supports the following types of special tasks:
IDalCommandTask - task that is used to work with a database using SQL queries.
To work with a task, the user needs to create an object that is an instance of a special task, set up object parameters and cast it to the ITask interface.
A special task can be created using the following methods:
IDalCommand2.CreateTask - creating an instance of the task for working with databases using SQL queries.
If required, execution of several tasks can be scheduled. To create a queue, use the ContinueWith method. A queue may include special tasks or the tasks that execute an action implemented in application code.
If all conditions for special tasks are satisfied, the task operates in asynchronous mode. Asynchronous mode does not support addressing form controls and the form itself. If visual part is to be used, synchronous operation mode is to be run.
NOTE. Synchronous execution is supported only in the desktop version of Foresight Analytics Platform.
Property name | Brief description | |
Action | The Action property returns parameters of the action executed under the current task. | |
Exception | The Exception property returns information on the error occurred at the task runtime. | |
IsCompleted | The IsCompleted property returns whether the task is completed. | |
Result | The Result property returns task execution result. | |
State | The State property returns the current state for the task. |
Method name | Brief description | |
Cancel | The Cancel method cancels task execution. | |
ContinueWith | The ContinueWith method creates an action execution task, which starts depending on the result of the current task, and adds it to task queue. | |
Start | The Start method starts task execution. | |
Wait | The Wait method pauses the current application until the task is completed. |
See also: