+

Search Tips | Advanced Search

Program invocation nested elements

Programs can be started using one of five nested elements: fte:presrc, fte:predst, fte:postdst, fte:postsrc, and fte:command. These nested elements instruct an agent to call an external program as part of its processing. Before we can start a program, you must ensure that the command is in a location specified by the commandPath property in the agent.properties file of the agent that runs the command.

Even though each program invocation element has a different name, they share the same set of attributes and the same set of nested elements. Programs can be started by the fte:filecopy, fte:filemove, and fte:command Ant tasks.

We cannot invoke programs from a Connect:Direct® bridge agent.


Ant tasks that can invoke programs:


Attributes


Parameters specified as nested elements


Arg attributes


Property attributes


Examples

This example shows an fte:postsrc program invocation being specified as part of an fte:filecopy task. The program invocation is for a program called post.sh and is supplied a single argument of /home/fteuser2/file.bin.
<fte:filecopy cmdqm="qm0@localhost@1414@SYSTEM.DEF.SVRCONN" 
              src=agent1@qm1 dst="agent2@qm2"
              rcproperty="copy.result">                    
		<fte:filespec srcfilespec="/home/fteuser1/file.bin" dstfile="/home/fteuser2/file.bin"/>

		<fte:postsrc command="post.sh" successrc=1 >         
				<fte:arg value="/home/fteuser2/file.bin"/>
		</fte:postsrc>

</fte:filecopy>
This example shows an fte:command program invocation being specified as part of a fte:call task. The program invocation is for an executable called command.sh, which is not passed any command-line arguments. If command.sh does not return a success return code of 1, the command is tried again after 30 seconds.
<fte:call cmdqm="qm0@localhost@1414@SYSTEM.DEF.SVRCONN"
            agent="agent1@qm1" 
            rcproperty="call.rc" 
            origuser="bob" 
            jobname="${job.id}">                
		<fte:command command="command.sh" successrc=1 retrycount="5" retrywait="30"/>		
</fte:call>
This example shows an fte:command program invocation being specified as part of a fte:call task. The program invocation is for the copy and compress targets in an Ant script called script.xml, which is passed two properties.
<fte:call cmdqm="qm0@localhost@1414@SYSTEM.DEF.SVRCONN"
            agent="agent1@qm1" 
            rcproperty="call.rc" 
            origuser="bob" 
            jobname="${job.id}">                
		<fte:command command="script.xml" type="antscript">
          <property name="src" value="AGENT5@QM5"/>
          <property name="dst" value="AGENT3@QM3"/>
          <target name="copy"/>	
          <target name="compress"/>
    </fte:command>	
</fte:call>