ExecuteAsTask (TTaskConfigureController)

De Wiki1000
function ExecuteAsTask(var aReason:string):boolean;

Cette méthode exécute la tâche en asynchrone.

Result True : Succès, False : Erreur de création de la tâche
aReason Information sur l'erreur


Exemple :

function doExecuteMyTask:string;
var inst:TTaskConfigureController; myCallBack:myCallBackTask; aReason:string;
begin
  // Instance of the call which must be called after execution of the task
  // Just need to retreive the EventID of the call back
  myCallBack := myCallBackTask.Create;
 
  inst := TTaskConfigureController.Create;
 
  // Previously configured parameters
  inst.TaskParameters := myProcessusParameters;
 
  // In the case the task generate a document (for example a report)
  // We want to generate a document and to attach it to the main object
  // (The main object may be any persistent object)
  inst.DocumentAttachOID := mainObject.InstanceOID; 
 
  // We want to generate an event to execute asynchronously a call back
  inst.TaskEventID := myCallBack.EventID;
 
  // We want to retreive the log entry for this task
  inst.TaskReference := InstanceOID;
 
  // Execute asynchronously
  inst.ExecuteAsTask(aReason);
end;

Voir aussi

TTaskConfigureController_(class)Développement DSM

Outils personnels