I think you may want to just use the <process-action> element within your 
<process> element, so that you can interact with the process.  Here is an 
example from the STAX User' Guide <process> section 
(http://staf.sourceforge.net/current/STAX/staxug.html#Header_Process):

In the following example of a process element, a process-action element is 
specified. The process-action task will be executed after the process 
starts. 

<script>
  machName = 'local'
  className = 'com.ibm.staf.service.stax.TestProcess'
  msg = 'Data being sent to the Process Queue after it starts executing'
</script>

<process name="'aProcess'">
  <location>machName</location>
  <command>'java'</command>
  <parms>className</parms>
  <process-action>
    <sequence>
      <stafcmd>
        <location>machName</location>
        <service>'QUEUE'</service>
        <request>'QUEUE HANDLE %s MESSAGE %s' % (STAXProcessHandle, 
msg)</request>
      </stafcmd>
    </sequence>
  </process-action>
  </process>

David Bender
STAF/STAX Development
(512-286-5315)
IBM Austin Bldg. 903-5B002
Internet: bda...@us.ibm.com




dudeja.ra...@gmail.com 
01/30/2009 09:02 AM

To
staf-users@lists.sourceforge.net
cc

Subject
[staf-users] Unable to use Static Handle with the consecutive   commands 
in a STAX job file






Hi,

I've the WindowsXP and STAF3.3.1.

I'm trying to create a static handle inside a STAX job which I want it to 
be shared across all the consecutive STAF commands used in <stafcmd> 
elemement and also across the process created in <process> element.

Though, I got some success by creating this Static handle and having it 
shared across the new process. But, I'm not finding any way to make it 
used by the consecutive <stafcmd> elements. These <stafcmd> are queueing 
some messages to the process created before.


So far, I used the following methods to create the static handle:
1. 

<stafcmd>
 <location>'local'</location>
 <service>'HANDLE'</service>
 <request>'CREATE HANDLE NAME "TestHandle1"'</request>
</stafcmd>

2.
<stafcmd>
 <location>'local'</location>
 <service>'PROCESS'</service>
 <request>
'START COMMAND python STATICHANDLENAME "PyHANDLE2" STDIN 
"C:/workspaces/test-workspace-xml/testProject1/src/TestSuite1/PyInt.py"'
 </request>
</stafcmd>

3. 

<script>
 from com.ibm.staf import *
 STAXMessageLog = 1
 STAXLogMessage = 1
 handle1 = STAFHandle("MyApplication")
 result = handle1.submit2("local", "HANDLE", "CREATE HANDLE NAME 
MyStaticHandleName")
 staticHandleNumber = int(result.result)
 handle = STAFHandle(staticHandleNumber)
 handle = handle.handle
</script>

Any help is highly appreciated.

Thanks,
Rajat 
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to