Your easiest option is if you can submit the STAX EXECUTE request from the
machine that wants to be notified when the STAX job completes. Note that
the machine where the STAX job xml file resides can be a different machine
than the machine submitting the STAX EXECUTE request by specifying the
MACHINE option on the STAX EXECUTE request. If this is the case, then you
can simply specify the WAIT option on the STAX EXECUTE request (so that it
won't return until the STAX job completes) and optionally specify the
RETURNRESULT option as well. You'll know when the STAX job completes when
the STAX EXECUTE request completes. For example:
STAF staxMachine STAX EXECUTE FILE /tests/job1.xml WAIT RETURNRESULT
Or, if file /tests/job1.xml doesn't reside on the machine submitting the
STAX EXECUTE request, then use the MACHINE option to specify the machine
where the file resides, e.g. the STAX service machine. For example:
STAF staxMachine STAX EXECUTE FILE /tests/job1.xml MACHINE staxMachine
RETURNRESULT
However, if you can't submit the STAX EXECUTE request from the machine
that wants to be notified when the STAX job completes, then you'll need to
do something else. You could use the STAX NOTIFY REGISTER ONENDOFJOB
<JobID> request, but you need to know the STAX Job ID (which you could get
various different ways). One way to do this is to have the STAX job use a
<stafcmd> to submit a "QUEUE HANDLE <Handle#> MESSAGE <STAX Job ID>"
request to the QUEUE service on the machine you want to notify. In order
to receive this message, there must be a program running on this notifiee
machine that is registered with STAF so that it has a STAF handle (which
has a queue associated with it). This program could submit a QUEUE GET
request to the QUEUE service on the local machine to receive this message
that contains the STAX Job ID. Then this program can submit a NOTIFY
REGISTER ONENDOFJOB <JobID> request to the STAX service on the STAX
service machine. This program needs to check it's queue for a STAX Job
completion message (which will have type STAF/Service/STAX/Job/End) that
will be sent from the STAX service machine when the STAX job completes. To
do this, you could have a loop that submits a GET request to the QUEUE
service, e.g. (STAF local QUEUE GET TYPE STAF/Service/STAX/Job/End WAIT
60000) continuously until it successfully completes with RC 0. Then you
can unmarshall the result to get information like the STAX Job ID that
completed, the job status and result (see section "NOTIFY
REGISTER/UNREGISTER" in the STAX User's Guide to see the table containing
the map definition of a job completion message). When the STAX job
completes, you must have network connectivity between the STAX service
machine and the machine that is to be notified of its completion in order
for the STAX service to successfully submit a QUEUE request to the QUEUE
service on the notifiee machine.
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
Tom Daggett <tdagg...@trellia.com>
02/09/2009 03:08 PM
To
staf-users@lists.sourceforge.net
cc
Subject
[staf-users] using Event Service, Query Service and/or STAX Notify
Register
Hi,
I'm working on a project to automatically run a STAX test cases job
locally on one machine and then report the results to a second machine.
Briefly our setup is this: we have a windows pc running FinalBuilder
that launches the tests via an asynchronous STAFCMD command to launch
the STAX xml file locally on a separate test machine. The test machine
will lose network connectivity periodically during the tests, but will
regain network connectivity at the end of the tests.
What I am trying to do is have the test machine inform the first machine
that it's test job has finished. The problem is I'm having trouble
seeing the overall way to do this. There's the STAX command NOTIFY
REGISTER, but there's also the Event Service (REGISTER, GENERATE) and
Queue service (GET WAIT).
Has anyone done something like this before with STAF/STAX? Could you
sketch out briefly what commands you used to do which parts of the
process?
Appreciate any guidance you might have on this.
Regards,
Tom Daggett
--
Tom Daggett | QA Automation Specialist, Engineering
t +1 514.747.5222 x295
e tdagg...@trellia.com
Trellia | Securing Mobility
www.trellia.com
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with
Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code
to
build responsive, highly engaging applications that combine the power of
local
resources and data with the reach of the web. Download the Adobe AIR SDK
and
Ajax docs to start building applications
today-http://p.sf.net/sfu/adobe-com
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users