2018-12-22 09:22:25 +01:00
|
|
|
<!--
|
|
|
|
Copyright JS Foundation and other contributors, http://js.foundation
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
|
|
|
|
2020-01-15 03:40:48 +01:00
|
|
|
<script type="text/html" data-help-name="function">
|
rework of DE translation (#2806)
* started rework of translation to DE, added translation rules and dictionary
* reworks DE translation of JSONata /editor-client/locales/de/jsonata.json
* rework DE translation of editor-client
* moved /editor-client/locales/de/README.md to Wiki https://github.com/node-red/node-red/wiki/Design:-i18n-de
* Update README.md
* Update README.md
* Create README.md
* Create README.md
* fixed #2: "Sie müssen ..., um ... zu können"
* fixed #3
* fixed #4 and removed unnecessary spaces
* fixed #5
* fixed #6, added missing dots, removed unnecessary spaces
* fixed #7, #8, #9
* fixed #10, #11, #12, #13, #14, #15
* fixed #17, #18, 19
* fixed #19
* moved /editor-client/locales/de/dictionary.csv to https://github.com/heikokue/node-red-designs/blob/i18n-de/designs/i18n-de/dictionary.csv
* reworked DE translation of runtime
* fine-tuned DE translation of editor-client
* reworked DE translation of common nodes, fine-tuned editor-client
* reworked DE translation of all nodes, fine-tuned editor-client, intotips, jsonata & runtime
* small i18n fixes
2021-03-12 14:07:12 +01:00
|
|
|
<p>JavaScript-Funktion zur Weiterverarbeitung eingehender Nachrichten.</p>
|
|
|
|
<p>Die empfangenen Nachrichten werden der Funktion als JavaScript-Objekt mit dem Namen <code>msg</code> übergeben.</p>
|
|
|
|
<p>Per Konvention enthält die <code>msg.payload</code>-Eigenschaft die eigentliche Nachricht.</p>
|
|
|
|
<p>Von der Funktion wird erwartet, dass sie ein (oder mehrere) Nachrichtenobjekt(e) zurückgibt.
|
|
|
|
Es kann aber auch nichts zurückgeben werden, um einen Flow zu stoppen.</p>
|
|
|
|
<p>In den <b>Start</b>-Tab kann Code eingetragen werden, der beim Node-Start ausgeführt wird.
|
|
|
|
In den <b>Stopp</b>-Tab kann Code eingetragen werden, der beim Node-Stopp ausgeführt wird.</p>
|
|
|
|
<p>Wenn ein promise-Objekt aus dem Start-Code zurückgegeben wird,
|
|
|
|
beginnt danach die reguläre Verarbeitung der Eingangsnachrichten.</p>
|
|
|
|
<h3>Details</h3>
|
|
|
|
<p>Siehe <a target="_blank" href="http://nodered.org/docs/writing-functions.html">Onlinedokumentation</a>
|
|
|
|
für weitere Informationen zum Schreiben von Funktionen.</p>
|
2021-03-31 17:51:40 +02:00
|
|
|
<h4><b>Nachrichten senden</b></h4>
|
rework of DE translation (#2806)
* started rework of translation to DE, added translation rules and dictionary
* reworks DE translation of JSONata /editor-client/locales/de/jsonata.json
* rework DE translation of editor-client
* moved /editor-client/locales/de/README.md to Wiki https://github.com/node-red/node-red/wiki/Design:-i18n-de
* Update README.md
* Update README.md
* Create README.md
* Create README.md
* fixed #2: "Sie müssen ..., um ... zu können"
* fixed #3
* fixed #4 and removed unnecessary spaces
* fixed #5
* fixed #6, added missing dots, removed unnecessary spaces
* fixed #7, #8, #9
* fixed #10, #11, #12, #13, #14, #15
* fixed #17, #18, 19
* fixed #19
* moved /editor-client/locales/de/dictionary.csv to https://github.com/heikokue/node-red-designs/blob/i18n-de/designs/i18n-de/dictionary.csv
* reworked DE translation of runtime
* fine-tuned DE translation of editor-client
* reworked DE translation of common nodes, fine-tuned editor-client
* reworked DE translation of all nodes, fine-tuned editor-client, intotips, jsonata & runtime
* small i18n fixes
2021-03-12 14:07:12 +01:00
|
|
|
<p>Die Funktion kann die Nachrichten zurückgeben, die sie an die nächsten Nodes im Flow weitergeben möchte,
|
|
|
|
oder kann <code>node.send(msg)</code> aufrufen.</p>
|
|
|
|
<p>Es kann folgendes zurückgeben/senden werden:</p>
|
2018-12-22 09:22:25 +01:00
|
|
|
<ul>
|
rework of DE translation (#2806)
* started rework of translation to DE, added translation rules and dictionary
* reworks DE translation of JSONata /editor-client/locales/de/jsonata.json
* rework DE translation of editor-client
* moved /editor-client/locales/de/README.md to Wiki https://github.com/node-red/node-red/wiki/Design:-i18n-de
* Update README.md
* Update README.md
* Create README.md
* Create README.md
* fixed #2: "Sie müssen ..., um ... zu können"
* fixed #3
* fixed #4 and removed unnecessary spaces
* fixed #5
* fixed #6, added missing dots, removed unnecessary spaces
* fixed #7, #8, #9
* fixed #10, #11, #12, #13, #14, #15
* fixed #17, #18, 19
* fixed #19
* moved /editor-client/locales/de/dictionary.csv to https://github.com/heikokue/node-red-designs/blob/i18n-de/designs/i18n-de/dictionary.csv
* reworked DE translation of runtime
* fine-tuned DE translation of editor-client
* reworked DE translation of common nodes, fine-tuned editor-client
* reworked DE translation of all nodes, fine-tuned editor-client, intotips, jsonata & runtime
* small i18n fixes
2021-03-12 14:07:12 +01:00
|
|
|
<li>Ein einzelnes Nachrichtenobjekt, das an Nodes am ersten Ausgang übergeben wird</li>
|
|
|
|
<li>Ein Array von Nachrichtenobjekten, die an die Nodes an den entsprechenden Ausgängen übergeben werden</li>
|
2018-12-22 09:22:25 +01:00
|
|
|
</ul>
|
2021-03-16 10:52:16 +01:00
|
|
|
<p><b>Hinweis</b>: Der Start-Code wird nur während der Initialisierung des Nodes ausgeführt.
|
rework of DE translation (#2806)
* started rework of translation to DE, added translation rules and dictionary
* reworks DE translation of JSONata /editor-client/locales/de/jsonata.json
* rework DE translation of editor-client
* moved /editor-client/locales/de/README.md to Wiki https://github.com/node-red/node-red/wiki/Design:-i18n-de
* Update README.md
* Update README.md
* Create README.md
* Create README.md
* fixed #2: "Sie müssen ..., um ... zu können"
* fixed #3
* fixed #4 and removed unnecessary spaces
* fixed #5
* fixed #6, added missing dots, removed unnecessary spaces
* fixed #7, #8, #9
* fixed #10, #11, #12, #13, #14, #15
* fixed #17, #18, 19
* fixed #19
* moved /editor-client/locales/de/dictionary.csv to https://github.com/heikokue/node-red-designs/blob/i18n-de/designs/i18n-de/dictionary.csv
* reworked DE translation of runtime
* fine-tuned DE translation of editor-client
* reworked DE translation of common nodes, fine-tuned editor-client
* reworked DE translation of all nodes, fine-tuned editor-client, intotips, jsonata & runtime
* small i18n fixes
2021-03-12 14:07:12 +01:00
|
|
|
Wenn <code>node.send</code> im Start-Code aufgerufen wird, können nachfolgende Nodes die Nachricht möglicherweise nicht empfangen.</p>
|
|
|
|
<p>Wenn ein Element des Arrays selbst ein Array von Nachrichten ist, werden mehrere Nachrichten an den entsprechenden Ausgang gesendet.</p>
|
|
|
|
<p>Wenn null zurückgegeben wird, entweder direkt oder als ein Array-Element, wird keine Nachricht weitergegeben.</p>
|
2021-03-31 17:51:40 +02:00
|
|
|
<h4><b>Protokollierung und Fehlerbehandlung</b></h4>
|
rework of DE translation (#2806)
* started rework of translation to DE, added translation rules and dictionary
* reworks DE translation of JSONata /editor-client/locales/de/jsonata.json
* rework DE translation of editor-client
* moved /editor-client/locales/de/README.md to Wiki https://github.com/node-red/node-red/wiki/Design:-i18n-de
* Update README.md
* Update README.md
* Create README.md
* Create README.md
* fixed #2: "Sie müssen ..., um ... zu können"
* fixed #3
* fixed #4 and removed unnecessary spaces
* fixed #5
* fixed #6, added missing dots, removed unnecessary spaces
* fixed #7, #8, #9
* fixed #10, #11, #12, #13, #14, #15
* fixed #17, #18, 19
* fixed #19
* moved /editor-client/locales/de/dictionary.csv to https://github.com/heikokue/node-red-designs/blob/i18n-de/designs/i18n-de/dictionary.csv
* reworked DE translation of runtime
* fine-tuned DE translation of editor-client
* reworked DE translation of common nodes, fine-tuned editor-client
* reworked DE translation of all nodes, fine-tuned editor-client, intotips, jsonata & runtime
* small i18n fixes
2021-03-12 14:07:12 +01:00
|
|
|
<p>Um alle Informationen zu protokollieren oder einen Fehler zu melden, sind die folgenden Funktionen verfügbar:</p>
|
|
|
|
<ul>
|
|
|
|
<li><code>node.log("Protokollnachricht")</code></li>
|
|
|
|
<li><code>node.warn("Warnmeldungstext")</code></li>
|
|
|
|
<li><code>node.error("Fehlermeldungstext")</code></li>
|
|
|
|
</ul>
|
|
|
|
</p>
|
|
|
|
<p>Der <span style="background-color:Gainsboro">catch</span>-Node kann auch zur Bearbeitung von Fehlern verwendet werden.
|
|
|
|
Er wird aufgerufen, indem <code>msg</code> als zweites Argument an <code>node.error</code> übergeben wird:</p>
|
|
|
|
<pre>node.error("Fehlermeldungstext" ,msg);</pre>
|
2021-03-31 17:51:40 +02:00
|
|
|
<h4><b>Zugriff auf Node-Informationen</b></h4>
|
rework of DE translation (#2806)
* started rework of translation to DE, added translation rules and dictionary
* reworks DE translation of JSONata /editor-client/locales/de/jsonata.json
* rework DE translation of editor-client
* moved /editor-client/locales/de/README.md to Wiki https://github.com/node-red/node-red/wiki/Design:-i18n-de
* Update README.md
* Update README.md
* Create README.md
* Create README.md
* fixed #2: "Sie müssen ..., um ... zu können"
* fixed #3
* fixed #4 and removed unnecessary spaces
* fixed #5
* fixed #6, added missing dots, removed unnecessary spaces
* fixed #7, #8, #9
* fixed #10, #11, #12, #13, #14, #15
* fixed #17, #18, 19
* fixed #19
* moved /editor-client/locales/de/dictionary.csv to https://github.com/heikokue/node-red-designs/blob/i18n-de/designs/i18n-de/dictionary.csv
* reworked DE translation of runtime
* fine-tuned DE translation of editor-client
* reworked DE translation of common nodes, fine-tuned editor-client
* reworked DE translation of all nodes, fine-tuned editor-client, intotips, jsonata & runtime
* small i18n fixes
2021-03-12 14:07:12 +01:00
|
|
|
<p>Im Funktionsblock können die ID und der Name des Nodes mit den folgenden Eigenschaften referenziert werden:</p>
|
|
|
|
<ul>
|
|
|
|
<li><code>node.id</code> - ID des Nodes</li>
|
|
|
|
<li><code>node.name</code> - Name des Nodes</li>
|
|
|
|
</ul>
|
2021-03-31 17:51:40 +02:00
|
|
|
<h4><b>Umgebungsvariablen verwenden</b></h4>
|
rework of DE translation (#2806)
* started rework of translation to DE, added translation rules and dictionary
* reworks DE translation of JSONata /editor-client/locales/de/jsonata.json
* rework DE translation of editor-client
* moved /editor-client/locales/de/README.md to Wiki https://github.com/node-red/node-red/wiki/Design:-i18n-de
* Update README.md
* Update README.md
* Create README.md
* Create README.md
* fixed #2: "Sie müssen ..., um ... zu können"
* fixed #3
* fixed #4 and removed unnecessary spaces
* fixed #5
* fixed #6, added missing dots, removed unnecessary spaces
* fixed #7, #8, #9
* fixed #10, #11, #12, #13, #14, #15
* fixed #17, #18, 19
* fixed #19
* moved /editor-client/locales/de/dictionary.csv to https://github.com/heikokue/node-red-designs/blob/i18n-de/designs/i18n-de/dictionary.csv
* reworked DE translation of runtime
* fine-tuned DE translation of editor-client
* reworked DE translation of common nodes, fine-tuned editor-client
* reworked DE translation of all nodes, fine-tuned editor-client, intotips, jsonata & runtime
* small i18n fixes
2021-03-12 14:07:12 +01:00
|
|
|
<p>Auf Umgebungsvariablen kann mit <code>env.get("Umgebungsvariablenname")</code> zugegriffen werden.</p>
|
2018-12-22 09:22:25 +01:00
|
|
|
</script>
|