In a STAX job I issued another STAX sub-jobs using the <job> element as
follows:
*Temp.xml:*

> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE stax SYSTEM "stax.dtd">
>
> <stax>
>     <defaultcall function="Main"/>
>     <function name="Main">
>         <sequence>
>             <script>
>                 from os import path
>             </script>
>             <sequence>
>                 <paralleliterate var='i' in='[1, 2, 3]'>
>                     <sequence>
>                         <message>
>                             'Job #%s' % ( i )
>                         </message>
>                         <job clearlogs='"enabled"' monitor='1'
> name='"Job%s" % ( i )'>
>                             <job-file>path.dirname( STAXJobXMLFile ) +
> R'\TempJob.xml'</job-file>
>                             <job-function-args
> eval='1'>i</job-function-args>
>                         </job>
>                     </sequence>
>                 </paralleliterate>
>
>                 <message>'Parallel jobs ended'</message>
>             </sequence>
>         </sequence>
>     </function>
> </stax>
>
And here is the contents of *TempJob.xml*

> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE stax SYSTEM "stax.dtd">
>
> <stax>
>     <defaultcall function="TempJob"/>
>
>     <function name="TempJob">
>         <function-single-arg>
>             <function-required-arg name='i'></function-required-arg>
>         </function-single-arg>
>         <sequence>
>             <stafcmd>
>                 <location>'local'</location>
>                 <service>'DELAY'</service>
>                 <request>'Delay %s' % ( i * 10000 )</request>
>             </stafcmd>
>
>             <message level='"trace"' log='1'>
>                 'i = %s' % ( i )
>             </message>
>
>             <message if='vars().has_key( "STAXSubJobID" )' level='"trace"'
> log='1'>
>                 'STAXSubJobID = %s' % ( STAXSubJobID )
>             </message>
>
>             <message if='vars().has_key( "STAXJobID" )' level='"trace"'
> log='1'>
>                 'STAXJobID = %s' % ( STAXJobID )
>             </message>
>             <hold/>
>         </sequence>
>     </function>
> </stax>
>
When I run Temp.xml the jobs don't print their STAXSubJobID (so it is not
defined there), but their STAXJobID is printed (so it is defined) and is
unique!!! So why isn't STAXSubJobID defined? And why didn't they have the
same STAXJobID of their parent STAXjob?
-- 
Ahmed Mostafa
0123919750
[EMAIL PROTECTED]
Software Engineer
IBM Egypt, Cairo Technology Development Center
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to