Action File (Platform Transfer Client Utility)
The action file is an XML file specified by the T parameter on the command line. By using an action file, you can put multiple actions in one file specified using XML format.
The format of the action file is as follows:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE actions SYSTEM "siftactions.dtd"> <actions> <action name="action1" output=”action2:file1”> <arg name="arg1" value="somevalue" sc="a1"/> …… </action> …… </actions>
The <action> element defines an action. The <arg> element defines a parameter needed for this action. If multiple <action> elements are defined in the file, the program will execute them one by one.
The name attribute for the <action> element specifies the action name. This must be a valid action. The XML file names are all valid actions.
The name attribute for the <arg> element specifies the parameter name for an action. The name is case sensitive and should not be edited. The sc attribute for the <arg> element specifies a shortcut name for the name attribute, and it is case insensitive. You can use shortcut names to specify values in command line to replace default values specified in this file. If the action is specified by the A parameter in command line, you must specify parameter name for that action rather than a shortcut name. Shortcut names can be found in each XML file.
For actions that retrieve information from a web service, you can specify an output file in the output attribute for the <action> element. The program will save the retrieved information into the file (in action file format), which can be used as an action file.
Sample Action File
- Build an action file
userA.xml to retrieve the information of user A, and save the information into an
addUser command action in the file
userB.xml.
The syntax of the userA.xml file will be as follows:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE actions SYSTEM "siftactions.dtd"> <actions> <action name=”getUser” output=”addUser:userB.xml”> <arg name=”UserId” value=”userA” sc=”UID”/> </action> </actions>
The value for the output attribute is ActionName:FileName, or ActionName>FileName. Because the generated file is in action file format, both the action name and file name are needed. Use a colon (:) to generate a new output file, or use the greater than symbol (>) to append to an existing file.
- Run the program to get the information of user A, and generate an action file
userB.xml.
java –classpath %cp% cfcc.CFAdmin U:userA P:pwdA T:userA.xml
- Run the program again with the generated action file to add user B.
java –classpath %cp% cfcc.CFAdmin U:userB P:pwdB T:userB.xml UID:userB
- Use UID:userB to overwrite the UserId parameter from the action file, in which the value is userA.
Currently, the GetTransferFromBank action supports writing output into an xml file. The sample xml file included in the product creates the sfTmpl.xml file.