<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>http://wiki.sage.fr/index.php?action=history&amp;feed=atom&amp;title=Exemple_Automate_d%C3%A9clench%C3%A9_par_SQL</id>
	<title>Exemple Automate déclenché par SQL - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.sage.fr/index.php?action=history&amp;feed=atom&amp;title=Exemple_Automate_d%C3%A9clench%C3%A9_par_SQL"/>
	<link rel="alternate" type="text/html" href="http://wiki.sage.fr/index.php?title=Exemple_Automate_d%C3%A9clench%C3%A9_par_SQL&amp;action=history"/>
	<updated>2026-05-25T10:50:41Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>http://wiki.sage.fr/index.php?title=Exemple_Automate_d%C3%A9clench%C3%A9_par_SQL&amp;diff=11768&amp;oldid=prev</id>
		<title>Syfre : /* Définition de la file d&#039;attente */</title>
		<link rel="alternate" type="text/html" href="http://wiki.sage.fr/index.php?title=Exemple_Automate_d%C3%A9clench%C3%A9_par_SQL&amp;diff=11768&amp;oldid=prev"/>
		<updated>2017-10-09T12:55:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Définition de la file d&amp;#039;attente&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 9 octobre 2017 à 12:55&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot;&gt;Ligne 12 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 12 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Définition de la file d&amp;#039;attente===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Définition de la file d&amp;#039;attente===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La file d&#039;attente peut être définie sur une classe de stéréotype file d&#039;attente de l&#039;application métier, pour simplifier nous utiliserons la classe générique &#039;TdbmStoredQueueMessage&#039; qui est pré-définie dans le référentiel.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;La file d&#039;attente peut être définie sur une classe de stéréotype file d&#039;attente de l&#039;application métier, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mais &lt;/ins&gt;pour simplifier nous utiliserons la classe générique &#039;TdbmStoredQueueMessage&#039; qui est pré-définie dans le référentiel.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[image:queue-automate-1.png]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[image:queue-automate-1.png]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Syfre</name></author>
	</entry>
	<entry>
		<id>http://wiki.sage.fr/index.php?title=Exemple_Automate_d%C3%A9clench%C3%A9_par_SQL&amp;diff=11767&amp;oldid=prev</id>
		<title>Syfre : /* Création du message */</title>
		<link rel="alternate" type="text/html" href="http://wiki.sage.fr/index.php?title=Exemple_Automate_d%C3%A9clench%C3%A9_par_SQL&amp;diff=11767&amp;oldid=prev"/>
		<updated>2017-10-09T12:19:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Création du message&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 9 octobre 2017 à 12:19&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l38&quot;&gt;Ligne 38 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 38 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[image:queue-automate-4.png]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[image:queue-automate-4.png]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{tip&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|&lt;/del&gt;|Cette classe mappe l&#039;attribut QueueName sur le sujet de la file}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{tip|Cette classe mappe l&#039;attribut QueueName sur le sujet de la file}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Déclenchement de l&amp;#039;automate===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Déclenchement de l&amp;#039;automate===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Syfre</name></author>
	</entry>
	<entry>
		<id>http://wiki.sage.fr/index.php?title=Exemple_Automate_d%C3%A9clench%C3%A9_par_SQL&amp;diff=11766&amp;oldid=prev</id>
		<title>Syfre : Page créée avec « __TOC__  Dans cet exemple nous allons déclencher un automate par une simple requête SQL.  Le principe est le suivant :  * Un automate est déclenché par un évènement ... »</title>
		<link rel="alternate" type="text/html" href="http://wiki.sage.fr/index.php?title=Exemple_Automate_d%C3%A9clench%C3%A9_par_SQL&amp;diff=11766&amp;oldid=prev"/>
		<updated>2017-10-09T12:18:39Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « __TOC__  Dans cet exemple nous allons déclencher un automate par une simple requête SQL.  Le principe est le suivant :  * Un automate est déclenché par un évènement ... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
Dans cet exemple nous allons déclencher un automate par une simple requête SQL.&lt;br /&gt;
&lt;br /&gt;
Le principe est le suivant :&lt;br /&gt;
&lt;br /&gt;
* Un automate est déclenché par un évènement file d&amp;#039;attente de type base de donnée.&lt;br /&gt;
* La file d&amp;#039;attente est configurée pour conserver les messages sur acquitement.&lt;br /&gt;
* Un message initial dans l&amp;#039;état Traité est créé &lt;br /&gt;
* L&amp;#039;automate est déclenché en modifiant l&amp;#039;état du message à &amp;quot;Prêt&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
===Définition de la file d&amp;#039;attente===&lt;br /&gt;
&lt;br /&gt;
La file d&amp;#039;attente peut être définie sur une classe de stéréotype file d&amp;#039;attente de l&amp;#039;application métier, pour simplifier nous utiliserons la classe générique &amp;#039;TdbmStoredQueueMessage&amp;#039; qui est pré-définie dans le référentiel.&lt;br /&gt;
&lt;br /&gt;
[[image:queue-automate-1.png]]&lt;br /&gt;
&lt;br /&gt;
Les champs importants sont :&lt;br /&gt;
&lt;br /&gt;
* Sujet&lt;br /&gt;
: Indiquer un sujet unique qui sera utilisé pour déclencher votre automate&lt;br /&gt;
&lt;br /&gt;
* Action sur succès&lt;br /&gt;
: Sélectionner &amp;#039;Conserver le message&amp;#039; de sorte que le message ne soit pas supprimer après déclenchement.&lt;br /&gt;
&lt;br /&gt;
===Définition de l&amp;#039;automate===&lt;br /&gt;
Définisez un évènement &amp;#039;File d&amp;#039;attente&amp;#039; sur la file d&amp;#039;attente que vous avez précédemment créée.&lt;br /&gt;
&lt;br /&gt;
[[image:queue-automate-2.png]]&lt;br /&gt;
&lt;br /&gt;
Puis utilisez cet évènement comme évènement déclencheur de votre automate.&lt;br /&gt;
&lt;br /&gt;
[[image:queue-automate-3.png]]&lt;br /&gt;
&lt;br /&gt;
===Création du message===&lt;br /&gt;
Pour créer le message utilisez l&amp;#039;exploreur d&amp;#039;objet.&lt;br /&gt;
&lt;br /&gt;
[[image:queue-automate-4.png]]&lt;br /&gt;
&lt;br /&gt;
{{tip||Cette classe mappe l&amp;#039;attribut QueueName sur le sujet de la file}}&lt;br /&gt;
&lt;br /&gt;
===Déclenchement de l&amp;#039;automate===&lt;br /&gt;
&lt;br /&gt;
Pour déclencher l&amp;#039;automate exécutez la requête suivante :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  update TDBMSTOREDQUEUEMESSAGE set queueState=0 where queueTopic=&amp;#039;DoMyTask&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cette requête passe le message dans l&amp;#039;état &amp;quot;Prêt&amp;quot; ce qui déclenchera l&amp;#039;automate à la prochaine exécution de sa boucle, une fois déclenché l&amp;#039;état du message est automatiquement repositionné à &amp;quot;Traité&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Automate]]&lt;br /&gt;
[[Category:File d&amp;#039;attente]]&lt;/div&gt;</summary>
		<author><name>Syfre</name></author>
	</entry>
</feed>