Hi again David,

I think I've got to the bottom of my problem.

In my original test the issue was missing DLLs for my test executables. 
On a windows machine this is generating pop-ups reporting this problem 
and it seems that until these are cleared by 'oking' them there is no RC 
returned. This means the process returns results as though it is still 
running even though it hasn't started.

In the test I provided below the QUERY HANDLE will actually work as 
expected and return a non zero error RC if you insert a small sleep 
after the async start.

So it doesn't look there's any issue - sorry for suggesting there was.

On the other hand, I guess my question is if anyone knows if there's 
anyway to start a process with a STAFCMD on win32 such that the process 
creation (and failure) don't block with a pop-up if there's a missing 
library for the command ?

On 23/09/2010 17:17, Simon McQueen wrote:
> Hi David,
>
> Thanks very much for the prompt reply.
>
> On 23/09/2010 15:54, David Bender wrote:
>>
>> Hi,
>>
>> If you don't start it asynchronously (or change to use a<process>), is
>> the
>> RC in the STAX job what you expected?
>
> Pretty much yes - the job fails as expected.
>
>> In general we recommend that you
>> always use<process> to start processes in a STAX job (not<stafcmd>).
>
> Unfortunately I'm beset by requirements to start certain processes or
> services first and then after they have been started (but not before)
> start others to run against them. It's the nature of the beast testing a
> lot of middleware.
>
>>
>> Could you provide a real reproduction scenario for Windows, that we could
>> try? For example, the following works as expected for me:
>>
>> C:\>STAF local PROCESS START COMMAND "java unknownTestClass" NOTIFY ONEND
>> Response
>> --------
>> 55
>>
>> C:\>STAF local PROCESS QUERY HANDLE 55
>> Response
>> --------
>> Handle : 55
>> Handle Name :<None>
>> Title :<None>
>> Workload :<None>
>> Shell :<None>
>> Command : java unknownTestClass
>> Parms :<None>
>> Workdir :<None>
>> Focus : Background
>> User Name :<None>
>> Key :<None>
>> PID : 5932
>> Start Mode : Async
>> Start Date-Time: 20100923-09:46:47
>> End Date-Time : 20100923-09:46:48
>> Return Code : 1
>
> That works fine for me too. Unfortunately the issue appears when you do
> this:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE stax SYSTEM "stax.dtd">
> <stax>
> <defaultcall function="HelloMain">
> </defaultcall>
> <function name="HelloMain" scope="local" >
> <function-no-args/>
> <sequence>
> <script>
> request = 'START COMMAND "java unknownTestClass"'
> </script>
> <stafcmd>
> <location>'local'</location>
> <service>'PROCESS'</service>
> <request>request</request>
> </stafcmd>
> <script>
> request = 'QUERY HANDLE %s' % (STAFResult)
> </script>
> <stafcmd >
> <location>'local'</location>
> <service>'PROCESS'</service>
> <request>request</request>
> </stafcmd>
> <log level="'info'">'The STAF result: %s' % (STAFResult)</log>
> </sequence>
> </function>
> </stax>
>
> This produces:
>
> 20100923-17:11:45 Info The STAF result: {'rc': None, 'endTimestamp':
> None, 'command': 'java unknownTestClass', 'startMode': 'Async', 'pid':
> '4368', 'startTimestamp': '20100923-17:11:45', 'workload': None,
> 'handle': '156', 'staf-map-class-name':
> 'STAF/Service/Process/ProcessInfo', 'shell': None, 'userName': None,
> 'title': None, 'parms': None, 'key': None, 'handleName': None, 'focus':
> 'Background', 'workdir': None}
>
> Cheers,

Cheers,
-- 
Simon McQueen
e-mail: mailto:s...@prismtech.com
Tele:   +44-191-497-9966
Web:    http://www.prismtech.com

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to