The error is occurring because  your function defines a required argument,
but you did not specify the argument on the STAX EXECUTE request.  So, if
you get the following:

>STAF local STAX EXECUTE FILE C:/STAF/services/stax/test.xml MACHINE local
WAIT RETURNRESULT
Response
--------
{
  Job ID         : 3
  Start Date-Time: 20101006-09:17:06
  End Date-Time  : 20101006-09:17:06
  Status         : Terminated
  Result         : org.python.core.pyinsta...@1187984
  Testcase Totals: {
    Tests : 0
    Passes: 0
    Fails : 0
  }
}

Then you can query the STAX job log to get detailed information about the
error:

>STAF local LOG QUERY MACHINE {STAF/Config/MachineNickname} LOGNAME
STAX_Job_3
Response
--------
Date-Time         Level Message
----------------- -----
-------------------------------------------------------
20101006-09:17:06 Start JobID: 3, File: C:\STAF\services\stax\test.xml,
Machine
                        : local, Function: NoOp, Args: null, JobName: <N/A>
20101006-09:17:06 Error STAXFunctionArgValidate signal raised. Terminating
job.
                           ===== XML Information =====  File: C:\STAF
\services\
                        stax\test.xml, Machine: local Line <Error in ARGS
optio
                        n>: Error in element type "<External>".  Required
argum
                        ent "arg1" is not provided in the call to function
"NoO
                        p".  ===== Call Stack for STAX Thread 1 =====  []
20101006-09:17:06 Info  Terminating block: main
20101006-09:17:06 Statu Testcase Totals: Tests: 0, Pass: 0, Fail: 0
                  s
20101006-09:17:06 Statu Job Result: org.python.core.pyinsta...@1187984
                  s
20101006-09:17:06 Stop  JobID: 3

If you execute the job via the STAX Monitor, then you will see the error in
the Messages panel:

20101006-09:21:12       STAXFunctionArgValidate signal raised. Terminating job.

===== XML Information =====

File: C:\STAF\services\stax\test.xml, Machine: local://local
Line <Error in ARGS option>: Error in element type "<External>".

Required argument "arg1" is not provided in the call to function "NoOp".

===== Call Stack for STAX Thread 1 =====

[]

And then if you specify the function argument on the STAX EXECUTE request,
then the job completes successfully:

>STAF local STAX EXECUTE FILE C:/STAF/services/stax/test.xml MACHINE local
ARGS ['myArg'] WAIT RETURNRESULT
Response
--------
{
  Job ID         : 6
  Start Date-Time: 20101006-09:23:34
  End Date-Time  : 20101006-09:23:34
  Status         : Normal
  Result         : None
  Testcase Totals: {
    Tests : 0
    Passes: 0
    Fails : 0
  }
}

David Bender


                                                                       
  From:       Arve Knudsen <arve.knud...@gmail.com>                    
                                                                       
  To:         staf-users@lists.sourceforge.net                         
                                                                       
  Date:       10/06/2010 05:49 AM                                      
                                                                       
  Subject:    [staf-users] How to get error information from STAX job  
                                                                       





Hello

I am new to STAF/STAX and am trying to implement a job as a STAX function.
First of all, I should like to get error information when the function call
fails. So far I am testing by calling my function without its required
arguments, but I can't for the life of me figure out how to get at the
error.

My STAX job definition is as simple as this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">
<stax>
  <defaultcall function="NoOp"/>
  <function name="NoOp">
    <function-list-args>
      <function-required-arg name="arg1"/>
    </function-list-args>
    <nop/>
  </function>
</stax>


I execute it with the command 'staf local stax EXECUTE FILE
C:/Users/knuarv/STAX/test.xml MACHINE local WAIT RETURNRESULT'. The
following information is then printed:
Response
--------
{
  Job ID         : 51
  Start Date-Time: 20101006-12:41:27
  End Date-Time  : 20101006-12:41:27
  Status         : Terminated
  Result         : org.python.core.pyinsta...@de9738
  Testcase Totals: {
    Tests : 0
    Passes: 0
    Fails : 0
  }
}


How do I get the error information? I can see that it's failed, given that
the Status is 'Terminated', but I need more detail.

Thanks,
Arve
------------------------------------------------------------------------------

Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to