Gateway 6.17.3 User Guide Save PDF Selected topic Selected topic and subtopics All content Axway Gateway: Managing Events Defining Decision Rule conditions About Decision Rule conditions Condition parameters Operators SMTP values in Decision Rule conditions Completing the Value field Using symbolic variables Using user functions Case-insensitive conditions About Decision Rule conditions Each Decision Rule condition that you define is an expression that comprises: Argument: To complete the Argument component of an expression, click the arrow on the Argument selection box and then select an argument from the drop-down list. The arguments displayed vary according to the type of Decision Rule you are creating or modifying, and, in the case of Transfers, the type of Transfer. The list contents vary to take into account, for example: The CGate selected on inputThe use of a VFDA transfer via an Axway Messaging connector Argument values in Decision Rules can comprise a combination of string values, user functions and symbolic variables. User functions can also be called inside one another, as long as the returned values are compatible with the argument expected in the upper function. This substitution mechanism applies to: Model names, when the selected Execution type is ModelDirectory paths and file patterns in the Trading Partner configuration Note: The number of functions you can nest is limited. The complete list of possible values for non-XMS (Axway Messaging) events is provided in Condition parameters below. In the case of Axway Messaging, the attribute list is derived dynamically from the processed message. It is therefore not possible to provide all potential elements of the list in this documentation. Operator: To complete the Operator component of an expression, click the arrow on the Operator selection box and then select an operator from the drop-down list that is displayed. The available operators (=, >, < and so on) vary according to the type of Argument you selected. The complete list of operators is given in Operators below. Value: A value of variable length. This value can be a symbolic variable. Example Argument Operator Value appli = FTP_A Note: A condition is identified within a given Decision Rule via the name Argument of the input argument to test. This means that a condition involving a given input argument can only be used once in a given Decision Rule condition. Condition parameters Each time you enter a value, Gateway checks that the string entered is syntactically correct and that it corresponds to the data type of the field. For example, it checks that a string only contains numeric characters for a field of the type integer. This type checking is only applicable to static strings, that is, that do not contain symbolic variables. The following table lists the parameters you can use in Decision Rule conditions. Note: Parameters for use specifically with SWIFTNet are listed in a separate table. Transfer Change State Decision Rule condition parameters Parameter Real type Description acknowledgement_option Select from: TO_ACK NOT_TO_ACK option for the acknowledgment of the transfer appli Allocation unit Application name appli_user_param1 User variables that relate to the Application appli_user_param2 block_size Integer Block size called_address Output of CGate or CGateGroup called_SAP Output of CGate or CGateGroup cgate_user_param1 User variables that relate to the selected CGate cgate_user_param2 content_id X.420 parameter content_type String[12] Mime content type of the attached file So far, only available for EDIINT and S/MIME files. data_code Integer Data character set dest_alias String[25] Destination destination String[25] Protocol destination name dir_path String[128] Directory path direction Select from: In Out Direction. Since Decision Rule processing can apply to both input and output Transfers, it is highly recommended that you set this parameter to specify whether to apply the Rule to the incoming or outgoing Transfer. If you do not set the direction parameter, the Decision Rule will loop continuously on both the input and output Transfer. dir_name String[254] VFD deposit directory f_bytes Integer Number of file data bytes transferred file_component String[127] File name file_label String[80] File description file_name String[128] Logical file name file_org File organization file_size Integer File size in octets file_type String[17] File type (protocol) full_state Full transfer state value group http_host_name CGate and CGateGroup output integer_user_param1 Integer User variables set by the C or Perl exit integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 ipmid_user_id String X.420 parameter last_end_reason Integer Last end reason for transfer local_agent String[32] Local Site message_id String[256] Mime Message-Id of the attached file Presently, only available for EDIINT and S/MIME files. mail_xpriority Integer SMTP/POP3 X-Priority mode Select from: Initiator Responder Both Mode mts_id String X.420 parameter multi_nb_ok Integer The number of successful child transfers of a Multi-transfer. Refer toTransferring multiple files with FTP for further information. multi_nb_total Integer The total number of child transfers of a Multi transfer. Refer toTransferring multiple files with FTP for further information. multi_state State of a Multi transfer. Refer toTransferring multiple files with FTP for further information. newline_convention (-nlc) Select from: U(nix) W(indows) SFTP only. Line feed convention for transfer, depending on remote system type org_alias String[25] Origin originator String[32] Protocol name originator p1.originator X.420 parameter p1.recipient X.420 parameter p2.ipmId.user X.420 parameter p2.bodyPartType X.420 parameter p2.importance X.420 parameter p2.sensitivity X.420 parameter padding Padding character code param1 String[41] User parameter no. 1 param2 String[41] User parameter no. 2 protocol Protocol rcv_appli Receiver Application name rcv_msg Received message rcv_text Receiver free text rcv_user Receiver user name rec_count Integer Number of records rec_fmt Record format rec_len Integer Record length receipt_nack_msg String[512] Receipt negative or warning description Only available for EDIINT and S/MIME files. receipt_reply_by_xfer Local identifier for the receipt sent for the current transfer receipt_reply_to_xfer Local identifier for the message that the current receipt acknowledges receipt_request Receipt request option used for transfer receipt_request_sync Receipt requested synchronously receipt_request_to String[256] Receipt return address receipt_sent_mode Select from: MANUAL AUTOMATIC Receipt send mode receipt_subtype Select from: WARNING ERROR FAILURE Receipt sub type receipt_type Select from: SUCCESS FAILURE Receipt type recipient_receipt_notif_request Select from: None NRN RN_NRN X.420 parameter recipient_reply_request Y or N X.420 parameter remote_agent String[32] Remote Site route_state Select from: FAILED NOT_ROUTED PROCESSING TO_ROUTE ROUTED signed_eerp Y or N Is signed EERP required? (for OFTP R2.0) sap TCP/IP local connection port site_user_param1 User variables that relate to the Local Site site_user_param2 smtp_bcc Bcc header field of the received SMTP message, when a single addressee is specified. smtp_cc Cc header field of the received SMTP message, when a single addressee is specified. smtp_from From header field of the received SMTP message. smtp_subject Subject header field of the received SMTP message. smtp_to To header field of the received SMTP message, when a single addressee is specified. snd_appli Sender Application name snd_text Sender free text snd_user Sender user name state string_user_param1 String User variables set by the C or Perl exit string_user_param2 string_user_param3 string_user_param4 string_user_param5 text_file Unsigned character Text file: Yes / No time_of_last_access tls_cipher_suite TLS cipher suite tls_client_auth Client authentication tls_server_auth Server authentication tls_sprof Security profile tmp_dea_id String Trading partner management DEA identifier trade_compress File is compressed trade_compress_algo ZLIB Compression algo trade_delivery_mode Select from: RT SNF Indicates the delivery mode of the file or message trade_dest String[128] Destination trading partner name trade_dest_alias String[31] Destination trading partner alias trade_encrypt File is encrypted trade_encrypt_dn String[100] Name used for encryption in Initiator mode. trade_encryption_algo File encryption algorithm trade_file_encoded File is in trade format or not trade_format Trading format used trade_key_encryption_algo RSA Key encryption algo trade_org String[128] Originator trading partner name trade_org_alias String[31] Originator trading partner alias trade_receipt_content_type String[256] Content type returned in receipt (S/MIME only) trade_receipt_message_id String[256] Message ID acknowledged by the receipt trade_receipt_mic String[40] MIC of the receipt trade_receipt_mic_algo MIC calculation algorithm requested for the receipt trade_receipt_recipient String[128] Recipient acknowledged by the receipt trade_receipt_request_type String[30] Type of acknowledgement request. trade_receipt_sign_algo Signing algorithm requested for the receipt trade_receipt_signature String[1024] Signature returned in receipt (S/MIME only) trade_remote_destination Destination partner is a remote partner trade_request_type String[30] Type of request trade_sign File is signed trade_sign_algo Select from: MD5withRSA SHA1withRSA Signing algo trade_sign_dn String[100] Name used for signing in Initiator mode. Otherwise the securityDN (supplied by SNL) is used. trade_state Trading process state type Request type (value in the condition: TRANS, EERP and so on) ua_rn_id String unprocessed_dir_path Directory path of the unprocessed file (clear file that is not yet encapsulated in EDIINT) unprocessed_file_component File name of the unprocessed file username user_processed Yes or No user_state virtual_file_desc free text Virtual file description (for OFTP R2.0) x_bytes Integer Number of bytes transferred x_data_code Transferred data code x_rec_fmt Transfer format x_rec_len Integer Transfer record length xfer_data_code Transfer data code xfer_duplicated Y or N Used to filter duplicate incoming SwiftNet FileAct RealTime transfers. The "xfer_duplicated" argument is linked with the "duplicated from xfer" transfer parameter: "xfer_duplicated=Y" means that "duplicated from xfer" is set in the transfer. Note:The "xfer_duplicate=Y" does not necessarily mean that the transfer is a duplicate. For example, a put at disposal permanent transfer will generate outgoing child transfers with "duplicate from xfer" pointing to the permanent put at disposal transfer. xfer_ident String[48] xfer_rec_fmt Transfer record format xfer_rec_len Integer Transfer record length yday Integer Day of the current year of the transfer Additional Decision Rule condition parameters for SWIFTNet The following Decision Rule condition parameters are specifically for use with SWIFTNet: Parameter Real type Description header_info Y or N Has Header Info? sw_add_params String Additional SwiftNet parameters file sign_list Y or N Has Signature List? sw_auth_indicator Refer to SWIFTNet File and Message Copy. sw_copy_indicator Refer to SWIFTNet File and Message Copy. sw_copy_state Refer to SWIFTNet File and Message Copy. sw_copy_type Refer to SWIFTNet File and Message Copy. sw_message_id String[40] Overwrite the message id with specified value. sw_pd_indication Make the responder aware that the incoming transfer may be a duplicate of another transfer. Refer to Possible Duplicate management for SWIFTNet. trade_non_repudiation Request SWIFT to keep proof of sending. trade_notif_queue String[30] Reception queue for Store-and-Forward delivery notifications. sw_retrieved_message Y or N Is a Retrieved Message? sw_retrieved_message_direction Select from: received sent Retrieved Message direction sw_third_party_dn String Third-Party DN trade_service String[30] SWIFT business service name. Operators This section describes the set of operators that you can use in Decision Rule expressions. The operators available depend on the type of argument that you set in the Argument field. Since SMTP fields typically contain a list of string values, the way Gateway handles Decision Rule expressions that contain SMTP arguments is slightly different. Refer to SMTP values in Decision Rule conditions. Operator Meaning Value field type = equals string: the value can contain wildcard characters "*" and "?" enumerated numeric # does not equal string: the value can contain wildcard characters "*" and "?" enumerated numeric < less than Comparison operators: string: compare alphabetic order numeric > greater than =< equal to or less than >= greater than or equal to = NULL is null # NULL is not null < > includes a set of values string enumerated numeric > < excludes a set of values string enumerated numeric [ ] ArgumentIn must be greater than or equal to the first value in the list and less than or equal to the second value numeric: the list must include two values separated by a comma (,) ] [ ArgumentIn must be less than the first value or greater than the second value in the list numeric: the list must include two values separated by a comma (,) exist JMS only exists not exist JMS only does not exist SMTP values in Decision Rule conditions Since SMTP fields typically contain a list of string values, the condition is valid (or invalid in the case of a negative operator), if one of the SMTP values corresponds to the value of the expression. The following table describes how Gateway processes Decision Rule conditions, where the smtp_to field in the incoming Transfer contains the values Smith, Jones and Black. Decision Rule condition Valid Description smtp_to = Smith YES Smith is one of the values in the incoming Transfer smtp_to field. smtp_to = Lloyd NO Lloyd is not a value listed in the incoming Transfer smtp_to field. smtp_to # Lloyd YES No name in the smtp_to field of the incoming Transfer is equal to Lloyd. smtp_to # Smith NO Smith is one of the names in the incoming Transfer smtp_to field. smtp_to <> Smith,Lloyd,Swanson YES One of the values in the incoming Transfer corresponds to one of the values in the Decision Rule expression (Smith). smtp_to <> Lloyd,Swanson,Kye NO No smtp_to value in the incoming Transfer corresponds to any of the values in the Decision Rule expression. smtp_to >< Lloyd,Swanson,Kye YES None of the names specified corresponds to any value in the smtp_to field in the incoming Transfer. smtp_to >< Jones,Lloyd,Kye NO Jones is one of the smtp_to values in the incoming Transfer. Scheduling Decision Rule condition parameters Parameter Real type Description integer_user_param1 Integer User variables set by the C or Perl exit integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 string_user_param1 String User variables set by the C or Perl exit string_user_param2 string_user_param3 string_user_param4 string_user_param5 Directory Scanning Decision Rule condition parameters Parameter Real type Description file_name String[255] File name file_size Integer File size in bytes integer_user_param1 Integer User variables set by the C or Perl Exit integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 string_user_param1 String User variables set by the C or Perl Exit string_user_param2 string_user_param3 string_user_param4 string_user_param5 last_modification Datetime Time of the last data change in the monitored folder Completing the Value field To complete the Value field, you can: Enter a value directly Select a defined object, such as a Site, from the drop-down list Select a symbolic variable from the drop-down list Use user functions Using symbolic variables To retrieve a value from the current Transfer Request, you can use symbolic variables. Gateway replaces the symbolic variable with the corresponding value in the current Transfer. The syntax is &(Variable_name) For example, if you set the condition: Destination # &(Originator), Gateway: Identifies the originator Site in the current Transfer Replaces the variable &(Originator) with this value Checks that the destination Site is not the same as the originator Site In particular, it is recommended that you use symbolic variables in the Model definition if you set the Execution type to Model. For example: file_component = &(dir_path)/&(file_component) application = &(appli) destination_alias = &(dest_alias) To retrieve the system date and time, use the following symbolic variables: &(DATE): to retrieve the system date, for example: 20070121 &(TIME): to retrieve the system time, for example: 101402 Symbolic variables for Transfer Change State Decision Rules You can use the following values as symbolic variables for Transfer Change State Decision Rules: acknowledgment_option alloc_count alloc_size alloc_unit append appli application appli_user_param1 appli_user_param2 attach_extract_file block_size called_addr cgate_user_param1 cgate_user_param2 compression content_id content_type counts_0 counts_1 counts_2 counts_3 counts_4 counts_5 counts_6 counts_7 counts_8 counts_9 create_date data_code DATE date_begin date_create date_end date_to_begin date_to_end destination dest_alias direction dir_name dir_path dir_type dn_request dup_from_xfer etb5_auth_type etb5_ciph_type etb5_id_bank etb5_id_bank_sec etb5_id_client etb5_id_client_sec etb5_memo_type etb5_paraf_used etb5_rsign1_used etb5_rsign2_used etb5_seal_type etb5_sign_type etb5_userarea exch_id extract_date file_ciphered file_component file_label file_name file_org file_size file_sys_dep_param file_type ftp_command full_state f_bytes generate_xfb_subject group header_info http_host_name ident integer_user_param1 integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 interval ipmid_user_id key_len key_offset last_end_diag last_end_err last_end_reason local_agent local_ident mail_xpriority master max_alloc_size max_file max_files max_request max_requests message_id mode model msg1 msg2 mts_id multi_nb_ok multi_nb_total multi_state nack_action nb_canceled nb_ended nb_frozen nb_progressing_servicing nb_suspended nb_total nb_to_begin newline_convention next_xfer org_alias originator padding param1 param2 path_name permanent prev_xfer priority protocol proto_spec_str purge_option rcv_appli rcv_msg rcv_text rcv_user receipt_nack_msg receipt_reply_by_xfer receipt_reply_to_xfer receipt_request receipt_request_sync receipt_request_to receipt_sent_mode receipt_subtype receipt_type recipient_receipt_notif_request recipient_reply_request rec_count rec_fmt rec_fmt rec_len rec_len remote_agent reply_by_xfer reply_to_xfer request_method response_code response_request_sync response_to_xfer retry_count retry_count_max route_from_xfer route_state route_to_xfer sap select_req sentinel_transfer_filter sentinel_xferident sentinel_xferobjectname sequence sign_list site_user_param1 site_user_param2 smtp_bcc smtp_cc smtp_from smtp_subject smtp_to snd_appli snd_msg snd_text snd_user state string_user_param1= string_user_param2= string_user_param3= string_user_param4= string_user_param5= sw_add_params sw_auth_by_xfer sw_auth_indicator sw_auth_to_xfer sw_copy_indicator sw_copy_stateone sw_copy_typeone sw_message_id sw_payload_type sw_pd_indication sw_retrieved_message sw_retrieved_message_direction sw_third_party_dn sys_dep text_file TIME tls_cipher_suite tls_client_auth tls_server_auth tls_sprof total_files total_requests tpm_dea_id tpm_local_dea_id trade_compress trade_compress_algo trade_delivery_mode trade_dest trade_dest_alias trade_encrypt trade_encryption_algo trade_encrypt_dn trade_fdacenter trade_fdasubmissiontype trade_file_encoded trade_format trade_key_encryption_algo trade_non_repudiation trade_notif_queue trade_org trade_org_alias trade_processing_error trade_receipt_content_type trade_receipt_message_id trade_receipt_mic trade_receipt_mic_algo trade_receipt_recipient trade_receipt_request_type trade_receipt_signature trade_receipt_sign_algo trade_remote_destination trade_request_type trade_rn_business_code trade_rn_document_name trade_rn_document_type trade_rn_message_id trade_rn_mic trade_rn_process_id trade_rn_transaction_id trade_rn_version trade_service trade_sign trade_sign_algo trade_sign_dn trade_state truncating_allowed type ua_rn_id unique_filename uniq_filename unprocessed_dir_path unprocessed_file_component username user_processed user_state xfer_duplicated xfer_ident xfer_rec_fmt xfer_rec_len xntf_filter xntf_profile x_bytes x_data_code yday Symbolic variables for Scheduling Decision Rules You can use the following values as symbolic variables for Scheduling Decision Rules: rule_table_id event_occur_time DATE TIME Yday integer_user_param1 integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 string_user_param1 string_user_param2 string_user_param3 string_user_param4 string_user_param5 Symbolic variables for Directory Scanning Decision Rules You can use the following values as symbolic variables for Directory Scanning Decision Rules: DATE TIME yday dir_name dir_path file_component file_name file_size integer_user_param1 integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 last_modification rule_table_id string_user_param1 string_user_param2 string_user_param3 string_user_param4 string_user_param5 Using user functions You can use the following user functions to complete the Decision Rule Value field: strrep() substr() substring() sepstring() uppercase() lowercase() These functions are described in the following tables: strrep() Purpose This function enables you to replace a substring of a source string with another substring. All the occurrences of the substring in the source string are replaced. Syntax strrep(source, old_substring, new_substring) where: source = the source data to be searchedsource must be in the format &(var_name) where var_name is a symbolic variable name representing a field in the transfer record. There must be no embedded space in the expression &(var_name). At run time, &(var_name) is substituted by its actual data. old_substring = substring to be replaced from the initial source string (one or more characters) new_substring = substring replacing all the occurrences (one or more characters) Examples In the following examples, &(var) has the value: e:/program files/axway/Gateway/v613/bin/test.exe Enter: The function returns: strrep(&(var), "/", "\") e:\program files\axway\Gateway\v613\bin\test.exe strrep(&(var), ''!', '@') e:/program files/axway/Gateway/v613/bin/test.exe strrep(&(var), '.exe', '.ini') e:/program files/axway/Gateway/v613/bin/test.ini strrep(&(var), "/", "//*) e://program files//axway//Gateway//v613//bin//test.exe strrep(&(var), "program files", "") e://axway/Gateway/v613/bin/test.exe substr() Purpose This function enables you to extract a sub-section of a source string. The function extracts a substring of the variable that you specify in the source parameter, starting from the position that you indicate via the from parameter and stopping at the position that you indicate via the to parameter. Syntax substr(source, from, to) where: source = the source data to be searchedsource must be in the format &(var_name) where var_name is a symbolic variable name representing a field in the transfer record. There must be no embedded space in the expression &(var_name). At run time, &(var_name) is substituted by its actual data. from = the starting position in the source from which to extract the substring to = the end position in the source for the substring extraction The from and to expressions must take one of the following two formats: A numeric expression: n, -n, +n, * n denotes the position relative to the beginning of the source (Relative to 1) -n denotes the position relative to the end of the source (-1 is the last position of the source, -2 is next before last, and so on) +n denotes the length of the characters to be copied, starting from a previously evaluated position. It has meaning only in the to expression. In the from expression, it is equivalent to n * denotes the end of the source A string expression: +n'string-to-search' 'string-to-search' comprises one or more characters denoting the string-pattern to search. It must be enclosed between a pair of single quotes (') or double quotes ("). n is optional. If present, it denotes the next nth occurrence of string-to-search within the source. Otherwise the first occurrence is assumed. If n is *, then the last occurrence is searched. + is optional. If present, the string-to-search is also included in the substring returned, otherwise it is not included. In the from expression, the search starts from the beginning of the source. In the to expression, the search starts at the last position located in the from expression. Examples In the following examples, &(var) has the value: e:/program files/axway/Gateway/v613/bin/test.exe Enter: The function returns: substr(&(var), 1, *) e:/program files/axway/Gateway/v613/bin/test.exe substr(&(var), 1, 2) e: substr(&(var), +2'/', +'/') /axway/ substr(&(var), *"/", *) test.exe substr(&(var), '/bin/', *) test.exe substr(&(var), -3, *) exe substr(&(var), -8, -5) test substring() Purpose This function extracts a substring of the variable name that you specify, starting from the position that you indicate via the startIndex parameter and stopping at the position that you indicate via the stopIndex parameter. Syntax substring(&(variableName), startIndex, stopIndex) or substring(&(variableName), startIndex) Examples If the Destination in the current Transfer is FTP_DEST, the function: substring(&(destination), 2, 5) returns: TP_D If the Destination in the current Transfer is FTP_DEST, the function: substring(&(destination), 2) returns: TP_DEST sepstring() Purpose This function extracts a substring from the variable name that you specify. sepstring extracts all, from nth occurrence of the specified separator up to the end. Syntax sepstring(&(variableName), separator, nb_occurrence) Example If the Destination in the current Transfer is /run_time/etc/file.txt, the function: sepstring(&(destination), '/', 3) returns: file.txt The function extracts all characters following the third separator /. Note: The separator parameter must be enclosed in single quotes ('). uppercase() Purpose This function converts the string that you specify to upper case characters. Syntax uppercase(&(variableName)) Example If the Destination in the current Transfer is ftp_dest, the function: uppercase(&(destination)) returns: FTP_DEST lowercase() Purpose This function converts the string that you specify to lower case characters. Syntax lowercase(&(variableName)) Example If the Destination in the current Transfer is FTP_DEST, the function: lowercase(&(destination)) returns: ftp_dest Case-insensitive conditions You can define case-insensitive conditions in Decision Rules. Example You may want to reject any incoming files that are potentially dangerous. The type of file concerned is executable and of the type: *.bat, *.bin, *.cmd, *.dll, *.exe and so on. However, you cannot be sure if the file name is in lowercase, uppercase or mixed. This example enables you to define a Decision Rule condition that selects all files with a name of the format *.exe, *.bin, *.bat, including: filename.EXE, filename.Exe and filename.eXe. Create a Decision Rule condition with the following parameters: Argument Operator Value file_name < > *.[eE][xX][eE], *.[bB][iI][nN], *.[bB][aA][tT] You can then call a script to delete these files. Related topics Overview: Event management Working with Rule Tables and Decision Rules Working with Decision Rules (command line) Working with Rule Tables (command line) Decision Rules and Rule Tables: Parameters List Command syntax for Scheduling Event Models (date syntax) Usage example: Routing Usage example: Directory Scanning Usage example: Scheduling User exits and Rule Tables Links to documentation set for Axway Gateway 6.17.3: Installation -- User -- Unix Configuration -- Upgrade -- Interoperability -- Security, requires login -- Release Notes Related Links
Axway Gateway: Managing Events Defining Decision Rule conditions About Decision Rule conditions Condition parameters Operators SMTP values in Decision Rule conditions Completing the Value field Using symbolic variables Using user functions Case-insensitive conditions About Decision Rule conditions Each Decision Rule condition that you define is an expression that comprises: Argument: To complete the Argument component of an expression, click the arrow on the Argument selection box and then select an argument from the drop-down list. The arguments displayed vary according to the type of Decision Rule you are creating or modifying, and, in the case of Transfers, the type of Transfer. The list contents vary to take into account, for example: The CGate selected on inputThe use of a VFDA transfer via an Axway Messaging connector Argument values in Decision Rules can comprise a combination of string values, user functions and symbolic variables. User functions can also be called inside one another, as long as the returned values are compatible with the argument expected in the upper function. This substitution mechanism applies to: Model names, when the selected Execution type is ModelDirectory paths and file patterns in the Trading Partner configuration Note: The number of functions you can nest is limited. The complete list of possible values for non-XMS (Axway Messaging) events is provided in Condition parameters below. In the case of Axway Messaging, the attribute list is derived dynamically from the processed message. It is therefore not possible to provide all potential elements of the list in this documentation. Operator: To complete the Operator component of an expression, click the arrow on the Operator selection box and then select an operator from the drop-down list that is displayed. The available operators (=, >, < and so on) vary according to the type of Argument you selected. The complete list of operators is given in Operators below. Value: A value of variable length. This value can be a symbolic variable. Example Argument Operator Value appli = FTP_A Note: A condition is identified within a given Decision Rule via the name Argument of the input argument to test. This means that a condition involving a given input argument can only be used once in a given Decision Rule condition. Condition parameters Each time you enter a value, Gateway checks that the string entered is syntactically correct and that it corresponds to the data type of the field. For example, it checks that a string only contains numeric characters for a field of the type integer. This type checking is only applicable to static strings, that is, that do not contain symbolic variables. The following table lists the parameters you can use in Decision Rule conditions. Note: Parameters for use specifically with SWIFTNet are listed in a separate table. Transfer Change State Decision Rule condition parameters Parameter Real type Description acknowledgement_option Select from: TO_ACK NOT_TO_ACK option for the acknowledgment of the transfer appli Allocation unit Application name appli_user_param1 User variables that relate to the Application appli_user_param2 block_size Integer Block size called_address Output of CGate or CGateGroup called_SAP Output of CGate or CGateGroup cgate_user_param1 User variables that relate to the selected CGate cgate_user_param2 content_id X.420 parameter content_type String[12] Mime content type of the attached file So far, only available for EDIINT and S/MIME files. data_code Integer Data character set dest_alias String[25] Destination destination String[25] Protocol destination name dir_path String[128] Directory path direction Select from: In Out Direction. Since Decision Rule processing can apply to both input and output Transfers, it is highly recommended that you set this parameter to specify whether to apply the Rule to the incoming or outgoing Transfer. If you do not set the direction parameter, the Decision Rule will loop continuously on both the input and output Transfer. dir_name String[254] VFD deposit directory f_bytes Integer Number of file data bytes transferred file_component String[127] File name file_label String[80] File description file_name String[128] Logical file name file_org File organization file_size Integer File size in octets file_type String[17] File type (protocol) full_state Full transfer state value group http_host_name CGate and CGateGroup output integer_user_param1 Integer User variables set by the C or Perl exit integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 ipmid_user_id String X.420 parameter last_end_reason Integer Last end reason for transfer local_agent String[32] Local Site message_id String[256] Mime Message-Id of the attached file Presently, only available for EDIINT and S/MIME files. mail_xpriority Integer SMTP/POP3 X-Priority mode Select from: Initiator Responder Both Mode mts_id String X.420 parameter multi_nb_ok Integer The number of successful child transfers of a Multi-transfer. Refer toTransferring multiple files with FTP for further information. multi_nb_total Integer The total number of child transfers of a Multi transfer. Refer toTransferring multiple files with FTP for further information. multi_state State of a Multi transfer. Refer toTransferring multiple files with FTP for further information. newline_convention (-nlc) Select from: U(nix) W(indows) SFTP only. Line feed convention for transfer, depending on remote system type org_alias String[25] Origin originator String[32] Protocol name originator p1.originator X.420 parameter p1.recipient X.420 parameter p2.ipmId.user X.420 parameter p2.bodyPartType X.420 parameter p2.importance X.420 parameter p2.sensitivity X.420 parameter padding Padding character code param1 String[41] User parameter no. 1 param2 String[41] User parameter no. 2 protocol Protocol rcv_appli Receiver Application name rcv_msg Received message rcv_text Receiver free text rcv_user Receiver user name rec_count Integer Number of records rec_fmt Record format rec_len Integer Record length receipt_nack_msg String[512] Receipt negative or warning description Only available for EDIINT and S/MIME files. receipt_reply_by_xfer Local identifier for the receipt sent for the current transfer receipt_reply_to_xfer Local identifier for the message that the current receipt acknowledges receipt_request Receipt request option used for transfer receipt_request_sync Receipt requested synchronously receipt_request_to String[256] Receipt return address receipt_sent_mode Select from: MANUAL AUTOMATIC Receipt send mode receipt_subtype Select from: WARNING ERROR FAILURE Receipt sub type receipt_type Select from: SUCCESS FAILURE Receipt type recipient_receipt_notif_request Select from: None NRN RN_NRN X.420 parameter recipient_reply_request Y or N X.420 parameter remote_agent String[32] Remote Site route_state Select from: FAILED NOT_ROUTED PROCESSING TO_ROUTE ROUTED signed_eerp Y or N Is signed EERP required? (for OFTP R2.0) sap TCP/IP local connection port site_user_param1 User variables that relate to the Local Site site_user_param2 smtp_bcc Bcc header field of the received SMTP message, when a single addressee is specified. smtp_cc Cc header field of the received SMTP message, when a single addressee is specified. smtp_from From header field of the received SMTP message. smtp_subject Subject header field of the received SMTP message. smtp_to To header field of the received SMTP message, when a single addressee is specified. snd_appli Sender Application name snd_text Sender free text snd_user Sender user name state string_user_param1 String User variables set by the C or Perl exit string_user_param2 string_user_param3 string_user_param4 string_user_param5 text_file Unsigned character Text file: Yes / No time_of_last_access tls_cipher_suite TLS cipher suite tls_client_auth Client authentication tls_server_auth Server authentication tls_sprof Security profile tmp_dea_id String Trading partner management DEA identifier trade_compress File is compressed trade_compress_algo ZLIB Compression algo trade_delivery_mode Select from: RT SNF Indicates the delivery mode of the file or message trade_dest String[128] Destination trading partner name trade_dest_alias String[31] Destination trading partner alias trade_encrypt File is encrypted trade_encrypt_dn String[100] Name used for encryption in Initiator mode. trade_encryption_algo File encryption algorithm trade_file_encoded File is in trade format or not trade_format Trading format used trade_key_encryption_algo RSA Key encryption algo trade_org String[128] Originator trading partner name trade_org_alias String[31] Originator trading partner alias trade_receipt_content_type String[256] Content type returned in receipt (S/MIME only) trade_receipt_message_id String[256] Message ID acknowledged by the receipt trade_receipt_mic String[40] MIC of the receipt trade_receipt_mic_algo MIC calculation algorithm requested for the receipt trade_receipt_recipient String[128] Recipient acknowledged by the receipt trade_receipt_request_type String[30] Type of acknowledgement request. trade_receipt_sign_algo Signing algorithm requested for the receipt trade_receipt_signature String[1024] Signature returned in receipt (S/MIME only) trade_remote_destination Destination partner is a remote partner trade_request_type String[30] Type of request trade_sign File is signed trade_sign_algo Select from: MD5withRSA SHA1withRSA Signing algo trade_sign_dn String[100] Name used for signing in Initiator mode. Otherwise the securityDN (supplied by SNL) is used. trade_state Trading process state type Request type (value in the condition: TRANS, EERP and so on) ua_rn_id String unprocessed_dir_path Directory path of the unprocessed file (clear file that is not yet encapsulated in EDIINT) unprocessed_file_component File name of the unprocessed file username user_processed Yes or No user_state virtual_file_desc free text Virtual file description (for OFTP R2.0) x_bytes Integer Number of bytes transferred x_data_code Transferred data code x_rec_fmt Transfer format x_rec_len Integer Transfer record length xfer_data_code Transfer data code xfer_duplicated Y or N Used to filter duplicate incoming SwiftNet FileAct RealTime transfers. The "xfer_duplicated" argument is linked with the "duplicated from xfer" transfer parameter: "xfer_duplicated=Y" means that "duplicated from xfer" is set in the transfer. Note:The "xfer_duplicate=Y" does not necessarily mean that the transfer is a duplicate. For example, a put at disposal permanent transfer will generate outgoing child transfers with "duplicate from xfer" pointing to the permanent put at disposal transfer. xfer_ident String[48] xfer_rec_fmt Transfer record format xfer_rec_len Integer Transfer record length yday Integer Day of the current year of the transfer Additional Decision Rule condition parameters for SWIFTNet The following Decision Rule condition parameters are specifically for use with SWIFTNet: Parameter Real type Description header_info Y or N Has Header Info? sw_add_params String Additional SwiftNet parameters file sign_list Y or N Has Signature List? sw_auth_indicator Refer to SWIFTNet File and Message Copy. sw_copy_indicator Refer to SWIFTNet File and Message Copy. sw_copy_state Refer to SWIFTNet File and Message Copy. sw_copy_type Refer to SWIFTNet File and Message Copy. sw_message_id String[40] Overwrite the message id with specified value. sw_pd_indication Make the responder aware that the incoming transfer may be a duplicate of another transfer. Refer to Possible Duplicate management for SWIFTNet. trade_non_repudiation Request SWIFT to keep proof of sending. trade_notif_queue String[30] Reception queue for Store-and-Forward delivery notifications. sw_retrieved_message Y or N Is a Retrieved Message? sw_retrieved_message_direction Select from: received sent Retrieved Message direction sw_third_party_dn String Third-Party DN trade_service String[30] SWIFT business service name. Operators This section describes the set of operators that you can use in Decision Rule expressions. The operators available depend on the type of argument that you set in the Argument field. Since SMTP fields typically contain a list of string values, the way Gateway handles Decision Rule expressions that contain SMTP arguments is slightly different. Refer to SMTP values in Decision Rule conditions. Operator Meaning Value field type = equals string: the value can contain wildcard characters "*" and "?" enumerated numeric # does not equal string: the value can contain wildcard characters "*" and "?" enumerated numeric < less than Comparison operators: string: compare alphabetic order numeric > greater than =< equal to or less than >= greater than or equal to = NULL is null # NULL is not null < > includes a set of values string enumerated numeric > < excludes a set of values string enumerated numeric [ ] ArgumentIn must be greater than or equal to the first value in the list and less than or equal to the second value numeric: the list must include two values separated by a comma (,) ] [ ArgumentIn must be less than the first value or greater than the second value in the list numeric: the list must include two values separated by a comma (,) exist JMS only exists not exist JMS only does not exist SMTP values in Decision Rule conditions Since SMTP fields typically contain a list of string values, the condition is valid (or invalid in the case of a negative operator), if one of the SMTP values corresponds to the value of the expression. The following table describes how Gateway processes Decision Rule conditions, where the smtp_to field in the incoming Transfer contains the values Smith, Jones and Black. Decision Rule condition Valid Description smtp_to = Smith YES Smith is one of the values in the incoming Transfer smtp_to field. smtp_to = Lloyd NO Lloyd is not a value listed in the incoming Transfer smtp_to field. smtp_to # Lloyd YES No name in the smtp_to field of the incoming Transfer is equal to Lloyd. smtp_to # Smith NO Smith is one of the names in the incoming Transfer smtp_to field. smtp_to <> Smith,Lloyd,Swanson YES One of the values in the incoming Transfer corresponds to one of the values in the Decision Rule expression (Smith). smtp_to <> Lloyd,Swanson,Kye NO No smtp_to value in the incoming Transfer corresponds to any of the values in the Decision Rule expression. smtp_to >< Lloyd,Swanson,Kye YES None of the names specified corresponds to any value in the smtp_to field in the incoming Transfer. smtp_to >< Jones,Lloyd,Kye NO Jones is one of the smtp_to values in the incoming Transfer. Scheduling Decision Rule condition parameters Parameter Real type Description integer_user_param1 Integer User variables set by the C or Perl exit integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 string_user_param1 String User variables set by the C or Perl exit string_user_param2 string_user_param3 string_user_param4 string_user_param5 Directory Scanning Decision Rule condition parameters Parameter Real type Description file_name String[255] File name file_size Integer File size in bytes integer_user_param1 Integer User variables set by the C or Perl Exit integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 string_user_param1 String User variables set by the C or Perl Exit string_user_param2 string_user_param3 string_user_param4 string_user_param5 last_modification Datetime Time of the last data change in the monitored folder Completing the Value field To complete the Value field, you can: Enter a value directly Select a defined object, such as a Site, from the drop-down list Select a symbolic variable from the drop-down list Use user functions Using symbolic variables To retrieve a value from the current Transfer Request, you can use symbolic variables. Gateway replaces the symbolic variable with the corresponding value in the current Transfer. The syntax is &(Variable_name) For example, if you set the condition: Destination # &(Originator), Gateway: Identifies the originator Site in the current Transfer Replaces the variable &(Originator) with this value Checks that the destination Site is not the same as the originator Site In particular, it is recommended that you use symbolic variables in the Model definition if you set the Execution type to Model. For example: file_component = &(dir_path)/&(file_component) application = &(appli) destination_alias = &(dest_alias) To retrieve the system date and time, use the following symbolic variables: &(DATE): to retrieve the system date, for example: 20070121 &(TIME): to retrieve the system time, for example: 101402 Symbolic variables for Transfer Change State Decision Rules You can use the following values as symbolic variables for Transfer Change State Decision Rules: acknowledgment_option alloc_count alloc_size alloc_unit append appli application appli_user_param1 appli_user_param2 attach_extract_file block_size called_addr cgate_user_param1 cgate_user_param2 compression content_id content_type counts_0 counts_1 counts_2 counts_3 counts_4 counts_5 counts_6 counts_7 counts_8 counts_9 create_date data_code DATE date_begin date_create date_end date_to_begin date_to_end destination dest_alias direction dir_name dir_path dir_type dn_request dup_from_xfer etb5_auth_type etb5_ciph_type etb5_id_bank etb5_id_bank_sec etb5_id_client etb5_id_client_sec etb5_memo_type etb5_paraf_used etb5_rsign1_used etb5_rsign2_used etb5_seal_type etb5_sign_type etb5_userarea exch_id extract_date file_ciphered file_component file_label file_name file_org file_size file_sys_dep_param file_type ftp_command full_state f_bytes generate_xfb_subject group header_info http_host_name ident integer_user_param1 integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 interval ipmid_user_id key_len key_offset last_end_diag last_end_err last_end_reason local_agent local_ident mail_xpriority master max_alloc_size max_file max_files max_request max_requests message_id mode model msg1 msg2 mts_id multi_nb_ok multi_nb_total multi_state nack_action nb_canceled nb_ended nb_frozen nb_progressing_servicing nb_suspended nb_total nb_to_begin newline_convention next_xfer org_alias originator padding param1 param2 path_name permanent prev_xfer priority protocol proto_spec_str purge_option rcv_appli rcv_msg rcv_text rcv_user receipt_nack_msg receipt_reply_by_xfer receipt_reply_to_xfer receipt_request receipt_request_sync receipt_request_to receipt_sent_mode receipt_subtype receipt_type recipient_receipt_notif_request recipient_reply_request rec_count rec_fmt rec_fmt rec_len rec_len remote_agent reply_by_xfer reply_to_xfer request_method response_code response_request_sync response_to_xfer retry_count retry_count_max route_from_xfer route_state route_to_xfer sap select_req sentinel_transfer_filter sentinel_xferident sentinel_xferobjectname sequence sign_list site_user_param1 site_user_param2 smtp_bcc smtp_cc smtp_from smtp_subject smtp_to snd_appli snd_msg snd_text snd_user state string_user_param1= string_user_param2= string_user_param3= string_user_param4= string_user_param5= sw_add_params sw_auth_by_xfer sw_auth_indicator sw_auth_to_xfer sw_copy_indicator sw_copy_stateone sw_copy_typeone sw_message_id sw_payload_type sw_pd_indication sw_retrieved_message sw_retrieved_message_direction sw_third_party_dn sys_dep text_file TIME tls_cipher_suite tls_client_auth tls_server_auth tls_sprof total_files total_requests tpm_dea_id tpm_local_dea_id trade_compress trade_compress_algo trade_delivery_mode trade_dest trade_dest_alias trade_encrypt trade_encryption_algo trade_encrypt_dn trade_fdacenter trade_fdasubmissiontype trade_file_encoded trade_format trade_key_encryption_algo trade_non_repudiation trade_notif_queue trade_org trade_org_alias trade_processing_error trade_receipt_content_type trade_receipt_message_id trade_receipt_mic trade_receipt_mic_algo trade_receipt_recipient trade_receipt_request_type trade_receipt_signature trade_receipt_sign_algo trade_remote_destination trade_request_type trade_rn_business_code trade_rn_document_name trade_rn_document_type trade_rn_message_id trade_rn_mic trade_rn_process_id trade_rn_transaction_id trade_rn_version trade_service trade_sign trade_sign_algo trade_sign_dn trade_state truncating_allowed type ua_rn_id unique_filename uniq_filename unprocessed_dir_path unprocessed_file_component username user_processed user_state xfer_duplicated xfer_ident xfer_rec_fmt xfer_rec_len xntf_filter xntf_profile x_bytes x_data_code yday Symbolic variables for Scheduling Decision Rules You can use the following values as symbolic variables for Scheduling Decision Rules: rule_table_id event_occur_time DATE TIME Yday integer_user_param1 integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 string_user_param1 string_user_param2 string_user_param3 string_user_param4 string_user_param5 Symbolic variables for Directory Scanning Decision Rules You can use the following values as symbolic variables for Directory Scanning Decision Rules: DATE TIME yday dir_name dir_path file_component file_name file_size integer_user_param1 integer_user_param2 integer_user_param3 integer_user_param4 integer_user_param5 last_modification rule_table_id string_user_param1 string_user_param2 string_user_param3 string_user_param4 string_user_param5 Using user functions You can use the following user functions to complete the Decision Rule Value field: strrep() substr() substring() sepstring() uppercase() lowercase() These functions are described in the following tables: strrep() Purpose This function enables you to replace a substring of a source string with another substring. All the occurrences of the substring in the source string are replaced. Syntax strrep(source, old_substring, new_substring) where: source = the source data to be searchedsource must be in the format &(var_name) where var_name is a symbolic variable name representing a field in the transfer record. There must be no embedded space in the expression &(var_name). At run time, &(var_name) is substituted by its actual data. old_substring = substring to be replaced from the initial source string (one or more characters) new_substring = substring replacing all the occurrences (one or more characters) Examples In the following examples, &(var) has the value: e:/program files/axway/Gateway/v613/bin/test.exe Enter: The function returns: strrep(&(var), "/", "\") e:\program files\axway\Gateway\v613\bin\test.exe strrep(&(var), ''!', '@') e:/program files/axway/Gateway/v613/bin/test.exe strrep(&(var), '.exe', '.ini') e:/program files/axway/Gateway/v613/bin/test.ini strrep(&(var), "/", "//*) e://program files//axway//Gateway//v613//bin//test.exe strrep(&(var), "program files", "") e://axway/Gateway/v613/bin/test.exe substr() Purpose This function enables you to extract a sub-section of a source string. The function extracts a substring of the variable that you specify in the source parameter, starting from the position that you indicate via the from parameter and stopping at the position that you indicate via the to parameter. Syntax substr(source, from, to) where: source = the source data to be searchedsource must be in the format &(var_name) where var_name is a symbolic variable name representing a field in the transfer record. There must be no embedded space in the expression &(var_name). At run time, &(var_name) is substituted by its actual data. from = the starting position in the source from which to extract the substring to = the end position in the source for the substring extraction The from and to expressions must take one of the following two formats: A numeric expression: n, -n, +n, * n denotes the position relative to the beginning of the source (Relative to 1) -n denotes the position relative to the end of the source (-1 is the last position of the source, -2 is next before last, and so on) +n denotes the length of the characters to be copied, starting from a previously evaluated position. It has meaning only in the to expression. In the from expression, it is equivalent to n * denotes the end of the source A string expression: +n'string-to-search' 'string-to-search' comprises one or more characters denoting the string-pattern to search. It must be enclosed between a pair of single quotes (') or double quotes ("). n is optional. If present, it denotes the next nth occurrence of string-to-search within the source. Otherwise the first occurrence is assumed. If n is *, then the last occurrence is searched. + is optional. If present, the string-to-search is also included in the substring returned, otherwise it is not included. In the from expression, the search starts from the beginning of the source. In the to expression, the search starts at the last position located in the from expression. Examples In the following examples, &(var) has the value: e:/program files/axway/Gateway/v613/bin/test.exe Enter: The function returns: substr(&(var), 1, *) e:/program files/axway/Gateway/v613/bin/test.exe substr(&(var), 1, 2) e: substr(&(var), +2'/', +'/') /axway/ substr(&(var), *"/", *) test.exe substr(&(var), '/bin/', *) test.exe substr(&(var), -3, *) exe substr(&(var), -8, -5) test substring() Purpose This function extracts a substring of the variable name that you specify, starting from the position that you indicate via the startIndex parameter and stopping at the position that you indicate via the stopIndex parameter. Syntax substring(&(variableName), startIndex, stopIndex) or substring(&(variableName), startIndex) Examples If the Destination in the current Transfer is FTP_DEST, the function: substring(&(destination), 2, 5) returns: TP_D If the Destination in the current Transfer is FTP_DEST, the function: substring(&(destination), 2) returns: TP_DEST sepstring() Purpose This function extracts a substring from the variable name that you specify. sepstring extracts all, from nth occurrence of the specified separator up to the end. Syntax sepstring(&(variableName), separator, nb_occurrence) Example If the Destination in the current Transfer is /run_time/etc/file.txt, the function: sepstring(&(destination), '/', 3) returns: file.txt The function extracts all characters following the third separator /. Note: The separator parameter must be enclosed in single quotes ('). uppercase() Purpose This function converts the string that you specify to upper case characters. Syntax uppercase(&(variableName)) Example If the Destination in the current Transfer is ftp_dest, the function: uppercase(&(destination)) returns: FTP_DEST lowercase() Purpose This function converts the string that you specify to lower case characters. Syntax lowercase(&(variableName)) Example If the Destination in the current Transfer is FTP_DEST, the function: lowercase(&(destination)) returns: ftp_dest Case-insensitive conditions You can define case-insensitive conditions in Decision Rules. Example You may want to reject any incoming files that are potentially dangerous. The type of file concerned is executable and of the type: *.bat, *.bin, *.cmd, *.dll, *.exe and so on. However, you cannot be sure if the file name is in lowercase, uppercase or mixed. This example enables you to define a Decision Rule condition that selects all files with a name of the format *.exe, *.bin, *.bat, including: filename.EXE, filename.Exe and filename.eXe. Create a Decision Rule condition with the following parameters: Argument Operator Value file_name < > *.[eE][xX][eE], *.[bB][iI][nN], *.[bB][aA][tT] You can then call a script to delete these files. Related topics Overview: Event management Working with Rule Tables and Decision Rules Working with Decision Rules (command line) Working with Rule Tables (command line) Decision Rules and Rule Tables: Parameters List Command syntax for Scheduling Event Models (date syntax) Usage example: Routing Usage example: Directory Scanning Usage example: Scheduling User exits and Rule Tables Links to documentation set for Axway Gateway 6.17.3: Installation -- User -- Unix Configuration -- Upgrade -- Interoperability -- Security, requires login -- Release Notes