<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="../../../design/description.xslt" type="text/xsl"?>
<node lang="en" type="DynamicNode.Core.Nodes.NFlag" assembly="DNCore" xmlns="http://dynamicnodes.mastersign.de/description">
  <caption>Flag</caption>
  <group>System</group>
  <description>Represents a state switch of the graph.</description>
  <inPorts>
    <port name="name" caption="Flag-Name">
      <type>string</type>
      <description>The name of the flag represented by the node.</description>
    </port>
    <port name="flag" caption="Flag">
      <description>
        Takes arbitrary tokens. The state of the token is taken as the new state of the flag.
        If e.g. a token with the state 'valid' is received, the state of the flag is switched to 'valid'.
      </description>
    </port>
  </inPorts>
  <outPorts />
  <helpText>
    <p>
      With this node the state of a graph can be reflected to the outside of the graph.
      A flag node represents a state value of the graph and is controlled by incoming
      tokens. The state of a flag can be determined by applications hosting the DynamicNodes
      runtime. In this way a flag can be used as a criteria when to shut down the runtime.
    </p>
    <p>
      This concept is used by DNConsole, the command line tool to run DynamicNodes graphes.
      A DynamicNodes graph has typically no point of exit. It is executed until the runtime
      stoppes the execution. If a graph is executed by DNConsole, there need to be a defined exit point
      for the execution, otherwise DNConsole would execute the graph until the operating system kills the
      DNConsole process. A flag node can be utilized to provide such a defined exit point for DNConsole.
      On the start of DNConsole it is given the name of a flag and its target state. In the moment
      the flag is switched to the given target state, DNConsole stoppes the execution of the graph and
      shuts down the DynamicNodes runtime.
    </p>
  </helpText>
</node>