Composing an action

An action is classified as a Commands action or a JavaScript action.

Note: JavaScript actions are supported only in the Cleo Harmony application.

For JavaScript actions, you can enter statements in a free-form manner. The Cleo Harmony application uses Rhino (http://www.mozilla.org/rhino), which is an open source, pure Java, JavaScript engine, to interpret and compile JavaScript source files into temporary Java classes for execution. Visit https://developer.mozilla.org/en/Rhino_JavaScript_Compiler.

See the API javadocs for examples and a description of the methods and functions available from within JavaScript (refer specifically to the ISessionScript class javadoc). The methods include the ability to run other action commands within JavaScript and writing to debug or the system log. These methods, when combined with JavaScript, make it possible to have complex sequences or decisions that would not be possible using Commands actions alone.

For Commands, an action consists of one or more commands that are to be run sequentially as a group. You can choose to have one action that does ALL sending and receiving, or you can choose to separate sending and receiving into two or more actions, potentially if sends and receives are not to be scheduled at the same intervals.

  1. Select the action in the tree pane.
  2. The potential set of commands depends on the client-to-host protocol. 

    *HTTP derivatives like AS2, EBICS, ebXML, RNIF and WS generally only support PUT.

    The actual supported set of commands and their syntax is further dependent on the host type.  For more information, see the section specific to the host type in question.

    Table 1. Host Commands
    FTP HTTP* SSH FTP OFTP MQ SMTP HSP MLLP Purpose
    CONNECT X X       X     Connect (login) to the host
    PUT X X X X X X X X Send one or more files to the host
    GET X X X X X     X Receive one or more files from the host
    DIR X X X   X       Get a directory listing of available files from the host
    CD X   X           Changes the current directory on the host
    CONFIRM   X             Confirm, on the host, receipt of one or more files
    DELETE   X             Delete one or more files on the host
    REQUEUE   X             Requeues one or more previously received files on the host
    QUOTE X   X     X     Send a raw command to the server
    SITE X               Send a site specific command to the server
    TYPE X               Sets file data type to ASCII or BINARY
    Table 2. Local Commands
    FTP HTTP* SSH FTP OFTP MQ SMTP HSP MLLP Purpose
    SET X X X X X X     Change an action property value
    CLEAR X X X X X X     Clear an action string property
    SYSTEM X X X X X X     Execute a local system command
    WAIT X X X X X X     Pause
    LCOPY X X X X X X     Copy local files
    LDELETE X X X X X X     Delete local files
    LREPLACE X X X X X X     Replace bytes in local files
  3. Right-click in the empty space or on a command in the Action tab to display a menu. (Note that JavaScript actions will not contain the Edit or Comment options.)
    1. Select Edit to edit the current line using the dialog editor (refer to step 4).
    2. Select Insert (or the  button) to insert a new line before the current line using the dialog editor (refer to step 4).
    3. Select Move Down or Move Up (or the  and  buttons) to move the current line down or up.
    4. Select Comment (or the  button) to change the current command line to a comment line.
    5. Select Delete (or the  button) to clear the current line.
  4. The Action tab is a freeform editor. For JavaScript actions, type in your JavaScript. For Commands actions, if you are familiar with the supported commands and syntax, you can type commands in directly. Otherwise, you can use a dialog editor that will format commands for you. To open the dialog editor, click the wizard button. The wizard button is not available for JavaScript actions.
    1. Select the desired command from the list on the left.
    2. The dialog box prompts for source and destination paths (and allows for browsing), when applicable to the command and possible for the host type.
    3. Available options for the command are listed.
    4. For HTTP, the dialog prompts for any needed or optional parameter and/or header values for the command.
    5. For LCOPY zipping operations, the dialog prompts for any needed password information if AES encryption is being used.
    6. The resultant command text is displayed on the bottom line (native UI only).
    7. Edit as necessary and click OK.