That is working as designed.  When a subjob is executed, the STAXSubJobID 
variable is available in the calling job (not in the subjob).  The subjob 
will have the STAXJobID variable set to its unique job ID (just like any 
STAX job).

David Bender
STAF/STAX Development
8-1268 (512-838-1268) 
IBM Austin Bldg. 903-5B002
Internet: [EMAIL PROTECTED]




"Ahmed Mostafa" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
05/25/2008 09:07 AM

To
STAF <[email protected]>
cc

Subject
[staf-users] [STAX] STAXSubJobID not set at beginning of a <job>






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
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to