OnChangeEventId (class)
De Wiki1000
(Différences entre les versions)
Ligne 24 : | Ligne 24 : | ||
<source lang='delphi'> | <source lang='delphi'> | ||
+ | |||
+ | //function TTestTask.doExecute(obj:TitObject):boolean; | ||
+ | begin | ||
+ | if obj is WFClasseA then | ||
+ | begin | ||
+ | //.... do something | ||
+ | Result := True; | ||
+ | end | ||
+ | else Result := False; | ||
+ | end; | ||
+ | |||
+ | //function TTestTask.Execute:boolean; | ||
+ | var aMsg:TdbmQueueMessage; | ||
+ | begin | ||
+ | Result := False; | ||
+ | aMsg := ReceivedMsg as TdbmQueueMessage; | ||
+ | if Assigned(aMsg) then | ||
+ | begin | ||
+ | if Assigned(SourceObject) then | ||
+ | begin | ||
+ | Result := doExecute(SourceObject); | ||
+ | end; | ||
+ | end; | ||
+ | end; | ||
+ | |||
//Procedure TestRegisterTasks; | //Procedure TestRegisterTasks; | ||
begin | begin |
Version du 26 septembre 2024 à 09:44
(Version 11)
class function OnChangeEventID(const iProperty:string; const iOldValue:variant; const iNewValue:variant):string;
Retire l'identifiant de l'évènement de modification d'un attribut d'un objet de cette classe.
iProperty | Nom de l'attribut |
oldValue | Ancienne valeur de l'attribut |
newValue | Nouvelle valeur de l'attribut |
Return | L'identifiant de l'évènement |
Exemple :
//function TTestTask.doExecute(obj:TitObject):boolean; begin if obj is WFClasseA then begin //.... do something Result := True; end else Result := False; end; //function TTestTask.Execute:boolean; var aMsg:TdbmQueueMessage; begin Result := False; aMsg := ReceivedMsg as TdbmQueueMessage; if Assigned(aMsg) then begin if Assigned(SourceObject) then begin Result := doExecute(SourceObject); end; end; end; //Procedure TestRegisterTasks; begin WFClasseA.RegisterOnChangeEvent('unEtat'); TTestTask.Subscribe(WFClasseA.OnChangeEventId('unEtat',NULL,WFCAState_Etat2),['unCode','unEntier'],['X',2]); end;
Voir aussi