Menu

Way to define nested timer

sarada
2005-10-03
2013-06-12
  • sarada

    sarada - 2005-10-03

    I need to define  a timer with some duration in another timer.But It always taking the duration of outer timer.It is not taking the inner time duration.
    Is there any way to define nested time?

    Could please through some lights on this.

    Thanks
    Sarada

     
    • Charles Rankin

      Charles Rankin - 2005-10-03

      What are the values you are using for the outer and inner timers?  Note, if the value of the outer timer is shorter than the inner timer, then it will "pop" before the inner one.

       
    • sarada

      sarada - 2005-10-04

      Hi Rankin,
      Thanks for your reply.Actually what happens is I have more than one one testcase element under outer timer loop each are performing some specified task.Under one testcase I specified timer with duration period less than the outer loop.After completing the duration it should stop the that task and it will contune with next task.But it is not stopping the task.I am wondering which timer duration it is taking.

      Thanks
      Sarada P.

       
      • Charles Rankin

        Charles Rankin - 2005-10-04

        Without seeing the job, it's hard to say for sure where things could be going wrong.  If by "stop the task" you mean that you don't see the process end (on the remote system), then that may be due to how you have the <process> designed.  In particular the <stopusing> definition.  STAX will try to stop the process via the method you specify there (or the default, which usually works).  However, even in the case where the wrong <stopusing> is definied (and, thus, the process continues to run), the job should still fall back to the end of the enclosing <timer> element.

        The following simple job works for me and exhibits the expected behavior.

        <?xml version="1.0" encoding="UTF-8" standalone="no"?>
        <!DOCTYPE stax SYSTEM "stax.dtd">

        <stax>
          <defaultcall function="Main"/>

          <function name="Main" scope="local">
            <sequence>

              <timer duration="'2m'">
                <sequence>

                  <message>'Starting outer timer'</message>

                  <timer duration="'15s'">
                    <sequence>

                      <message>'Starting inner timer'</message>

                      <stafcmd>
                        <location>'local'</location>
                        <service>'delay'</service>
                        <request>'delay 150000'</request>
                      </stafcmd>

                    </sequence>
                  </timer>

                  <message>'Left inner timer, RC: %s' % RC</message>

                </sequence>
              </timer>

              <message>'Left outer timer, RC: %s' % RC</message>

            </sequence>
          </function>
        </stax>

         

Log in to post a comment.