<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="behavior.xsl"?>
  <behavioral manifest="scanner.xml" version="2.0">
    <file>"XSLscannerBehav.xml"</file>
    <Author>Jim Fawcett</Author>
    <version No="1.1" date="10/25/01"/>
    <!--
      This is a behavioral desciption of a scanner process.  
        The scanner walks a connected graph formed by linked manifests.
        It publishes a delegate that invokes notifications, passing a manifest reference.
    -->
 
    <process name="Scanner">
      Handles recursive traversal of manifests and invokes a command on each manifest encountered.
    </process>

    <diagram diagramTitle="Scanner Structure">
      scanner.htm
    </diagram>

    <inputs>
      <input variable="manifestFileName">
        <def>holds the manifest file name</def>
        <text>This name identifies the root component for a scan.</text>
      </input>
      <input variable="subscriber">
        <def>identifies a process that requests notification of a scan event</def>
        <text>Each subscriber is passed a reference to the current manifest during a scan.
        Notification provides the subscriber an opportunity to process the current manifest.</text>
      </input>
    </inputs>

    <outputs>
      <output variable="manifestEventInvocation">
        <def>invokes subscriber's event handler</def>
        <text>scanner invokes all the subscribers who are interested in the manifests encountered while
        it recursively traverses a component tree</text>
        <connectsToTitle>CommandHandler Process</connectsToTitle>
        <connectsToFile>XSLcommandHandler.xml</connectsToFile>
      </output>
      <output variable="notification">
        <def>sends notification when there are no subscribers</def>
        <text>If there are no subscribers for the scan, scanner sends notification and terminates without scanning.</text>
        <connectsToTitle>Notification Process</connectsToTitle>
        <connectsToFile>XSLnotification.xml</connectsToFile>
      </output>
    </outputs>

    <requirements>
      <test No="Scanner_1">
        <traces to="derived"/>
        <def>Event handling</def>
        <text>Invokes each subscriber's event handler.  Invocation is activated for all current subscribers.</text>
      </test>
      <test No="Scanner_2">
        <traces to="A.3.1.18"/><traces to="A.3.1.19"/><traces to="derived"/>
        <def>complete traversal</def>
        <text>Visits every manifest dependent upon the root manifest, either directly or indirectly.</text>
        <note>
            This test defines the obligation to scan fully for extracting and building components,
            which is implied, but not explicit in the cited requirements.  Hence the trace to derived as well.
      </note>
      </test>
      <test No="Scanner_3">
        <traces to="derived"/>
        <def>No subscribers</def>
        <text>Sends notification and returns without scanning.</text>
      </test>
    </requirements>
    <!--
      The sibling tag, below, is used to identify lower level process descriptions.  Sibling tags have a visibility
      attribute, allowing them to be part of the parent's behavior model, or excluded, at the descretion of the
      behavior RI.
    -->
    <sibling ref="child2.xml" manifest="xmlTran.xml" visible="false"></sibling>
  </behavioral>