<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://frp.sage.fr/wiki1000/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
		<id>https://frp.sage.fr/wiki1000/index.php?action=history&amp;feed=atom&amp;title=Cr%C3%A9ation_d%27un_callback_de_t%C3%A2che_%28task%29</id>
		<title>Création d'un callback de tâche (task) - Historique des versions</title>
		<link rel="self" type="application/atom+xml" href="https://frp.sage.fr/wiki1000/index.php?action=history&amp;feed=atom&amp;title=Cr%C3%A9ation_d%27un_callback_de_t%C3%A2che_%28task%29"/>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=Cr%C3%A9ation_d%27un_callback_de_t%C3%A2che_(task)&amp;action=history"/>
		<updated>2026-06-17T20:09:03Z</updated>
		<subtitle>Historique pour cette page sur le wiki</subtitle>
		<generator>MediaWiki 1.18.6</generator>

	<entry>
		<id>https://frp.sage.fr/wiki1000/index.php?title=Cr%C3%A9ation_d%27un_callback_de_t%C3%A2che_(task)&amp;diff=13403&amp;oldid=prev</id>
		<title>Syfre le 29 mars 2020 à 13:59</title>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=Cr%C3%A9ation_d%27un_callback_de_t%C3%A2che_(task)&amp;diff=13403&amp;oldid=prev"/>
				<updated>2020-03-29T13:59:09Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Version précédente&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Version du 29 mars 2020 à 13:59&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 14 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 14 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; Function Execute():boolean;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; Function Execute():boolean;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; Procedure RegisterCallBack;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; Procedure RegisterCallBack;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; Procedure UnRegister;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; end;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; end;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 56 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 57 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; if not SubscribeToEvent(TTestTask.OnTerminateSuccessID(),aReason) then&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; if not SubscribeToEvent(TTestTask.OnTerminateSuccessID(),aReason) then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  showMessage('subscribe failed '+aReason); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  showMessage('subscribe failed '+aReason); &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;end;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Procedure TestTaskCallBack.UnRegister;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;//Procedure UnRegister;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;var aReason:string;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;begin&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; if not UnSubscribeFromEvent(TTestTask.OnTerminateSuccessID(),aReason) then&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160;  showMessage(aReason); &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;end;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;end;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Syfre</name></author>	</entry>

	<entry>
		<id>https://frp.sage.fr/wiki1000/index.php?title=Cr%C3%A9ation_d%27un_callback_de_t%C3%A2che_(task)&amp;diff=13401&amp;oldid=prev</id>
		<title>Syfre le 29 mars 2020 à 13:54</title>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=Cr%C3%A9ation_d%27un_callback_de_t%C3%A2che_(task)&amp;diff=13401&amp;oldid=prev"/>
				<updated>2020-03-29T13:54:33Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Version précédente&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Version du 29 mars 2020 à 13:54&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 10 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 10 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Type&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Type&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; TestTaskCallBack = Class(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;TitObject&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; TestTaskCallBack = Class(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;TitTask&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; public&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; public&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; Function Execute():boolean;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; Function Execute():boolean;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Syfre</name></author>	</entry>

	<entry>
		<id>https://frp.sage.fr/wiki1000/index.php?title=Cr%C3%A9ation_d%27un_callback_de_t%C3%A2che_(task)&amp;diff=13400&amp;oldid=prev</id>
		<title>Syfre : Page créée avec « Un callback de tâche est une tâche déclenchée par la fin de l'exécution d'une autre tâche.  {{Tip|Un callback doit être enregistré, une fois suffit.}}  Exemple :  ... »</title>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=Cr%C3%A9ation_d%27un_callback_de_t%C3%A2che_(task)&amp;diff=13400&amp;oldid=prev"/>
				<updated>2020-03-29T13:54:02Z</updated>
		
		<summary type="html">&lt;p&gt;Page créée avec « Un callback de tâche est une tâche déclenchée par la fin de l&amp;#039;exécution d&amp;#039;une autre tâche.  {{Tip|Un callback doit être enregistré, une fois suffit.}}  Exemple :  ... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Un callback de tâche est une tâche déclenchée par la fin de l'exécution d'une autre tâche.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Un callback doit être enregistré, une fois suffit.}}&lt;br /&gt;
&lt;br /&gt;
Exemple :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;delphi&amp;quot;&amp;gt;&lt;br /&gt;
unit TestSYFREWF;&lt;br /&gt;
interface&lt;br /&gt;
&lt;br /&gt;
Type&lt;br /&gt;
  TestTaskCallBack = Class(TitObject)&lt;br /&gt;
  public&lt;br /&gt;
    Function Execute():boolean;&lt;br /&gt;
    Procedure RegisterCallBack;&lt;br /&gt;
  end;&lt;br /&gt;
&lt;br /&gt;
Implementation&lt;br /&gt;
&lt;br /&gt;
{TestTaskCallBack}&lt;br /&gt;
&lt;br /&gt;
Function TestTaskCallBack.Execute():boolean;&lt;br /&gt;
//Function Execute():boolean;&lt;br /&gt;
var idx:Integer; S:string; aMsg:TdbmQueueMessage;&lt;br /&gt;
begin&lt;br /&gt;
  Result := True;&lt;br /&gt;
&lt;br /&gt;
  // Add messages to the log&lt;br /&gt;
  ProgressMessage('On TestTask Terminate');&lt;br /&gt;
&lt;br /&gt;
  if Assigned(UserContext.TaskContext) and Assigned(userContext.TaskContext.EventContext) then&lt;br /&gt;
   begin&lt;br /&gt;
     userContext.TaskContext.AddMessage('Has Task context');&lt;br /&gt;
     //&lt;br /&gt;
     aMsg := userContext.TaskContext.EventContext.ReceivedMsg;&lt;br /&gt;
     if Assigned(aMsg) then&lt;br /&gt;
      begin&lt;br /&gt;
        userContext.TaskContext.AddMessage(Format('Task reference: %s',[aMsg.ValueByNames(':message.source.reference')]));&lt;br /&gt;
        userContext.TaskContext.AddMessage(Format('Message parameters count:%d',[aMsg.Count]));&lt;br /&gt;
        for idx:=0 to aMsg.Count-1 do&lt;br /&gt;
         begin&lt;br /&gt;
           S := aMsg.DisplayStrings(idx);&lt;br /&gt;
           UserContext.TaskContext.AddMessage(S);&lt;br /&gt;
         end;&lt;br /&gt;
      end;&lt;br /&gt;
   end&lt;br /&gt;
   else ProgressMessage('no task context');&lt;br /&gt;
 &lt;br /&gt;
  Result := True;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
Procedure TestTaskCallBack.RegisterCallBack;&lt;br /&gt;
//Procedure RegisterCallBack;&lt;br /&gt;
var aReason:string;&lt;br /&gt;
begin&lt;br /&gt;
  if not SubscribeToEvent(TTestTask.OnTerminateSuccessID(),aReason) then&lt;br /&gt;
   showMessage('subscribe failed '+aReason); &lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Stéréotype tâche]]&lt;br /&gt;
[[Category:File d'attente]]&lt;br /&gt;
[[Category:Version900]]&lt;/div&gt;</summary>
		<author><name>Syfre</name></author>	</entry>

	</feed>