{
  "synLogic": "int $ret \u003d $api($1, $2, $3);",
  "help": "The provided code is a function that initializes an IBM MQ producer with the given parameters and a connection pool of pool_size. It then retrieves a connection from the pool and closes the connection after using it.",
  "notes": "",
  "returns": "If the function returns a value less than zero, an error occurred while closing the connection, and the error message is stored in the error_msg parameter.",
  "arguments": "\u003ctable class\u003d\"newGuiTable\" style\u003d\"width:100%\" \u003e \u003ctr\u003e  \u003cth\u003eArgument\u003c/th\u003e  \u003cth\u003eDescription\u003c/th\u003e  \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003eJCID\u003c/td\u003e     \u003ctd\u003e  The connection ID returned by the ns_ibmmq_get_connection() function.     \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e       \u003ctd\u003eTransaction Name\u003c/td\u003e     \u003ctd\u003e             The name of the transaction to be started. If it is not NULL or empty, a transaction is started. If it fails, the transaction is ended with an error.  \u003c/td\u003e     \u003c/tr\u003e     \u003ctr\u003e    \u003ctd\u003eError Message\u003c/td\u003e     \u003ctd\u003e  A character array where the error message, if any, will be stored.  \u003c/td\u003e     \u003c/tr\u003e   \u003c/table\u003e",
  "parameterization": "",
  "name": "ns_ibmmq_close_connection",
  "syntax": "int ns_ibmmq_close_connection(int jpcid, char *transaction_name, char *error_msg)",
  "javaSyntax": "int ns_ibmmq_close_connection(int jpcid, char *transaction_name, char *error_msg)",
  "cEx": "flow()\n{\n	int jpid;	// JMS Pool Id\n	int jcid;	// JMS Connection Id\n	char error_msg[1024 + 1];	// Error string. Must be 1024 size\n	int ret;	// Error code\n	char *msg = \"Message goes here.\";	// Message to be produced\n	int msg_len = strlen(msg);	// Message Length\n	if((jpid = ns_ibmmq_init_producer(\"127.0.0.1\", 1414, \"queue_manager\", \"channel\", \"queue\", \"user_id\", ns_decrypt(\"NlEyRDJeMFI=\"), 1, error_msg)) < 0)\n	{\n		fprintf(stderr, \"Error in initializing IBMMQ producer. Error code = %d, Error Msg = %s\", jpid, error_msg);\n		return;\n	}\n\n	if((jcid = ns_ibmmq_get_connection(jpid, \"IBMMQProducerConnect\", error_msg)) < 0)\n	{\n		fprintf(stderr, \"Error in getting IBMMQ connention. Error code = %d, Error Msg = %s\", jcid, error_msg);\n		return;\n	}\n\n	if((ret = ns_ibmmq_close_connection(jcid, \"IBMMQProducerClose\", error_msg)) < 0)\n	{\n		fprintf(stderr, \"Error in closing Ibmmq connection %d\", ret);\n		return;\n	}\n}",
  "javaEx": "flow()\n{\n	int jpid;	// JMS Pool Id\n	int jcid;	// JMS Connection Id\n	char error_msg[1024 + 1];	// Error string. Must be 1024 size\n	int ret;	// Error code\n	char *msg = \"Message goes here.\";	// Message to be produced\n	int msg_len = strlen(msg);	// Message Length\n	if((jpid = ns_ibmmq_init_producer(\"127.0.0.1\", 1414, \"queue_manager\", \"channel\", \"queue\", \"user_id\", ns_decrypt(\"NlEyRDJeMFI=\"), 1, error_msg)) < 0)\n	{\n		fprintf(stderr, \"Error in initializing IBMMQ producer. Error code = %d, Error Msg = %s\", jpid, error_msg);\n		return;\n	}\n\n	if((jcid = ns_ibmmq_get_connection(jpid, \"IBMMQProducerConnect\", error_msg)) < 0)\n	{\n		fprintf(stderr, \"Error in getting IBMMQ connention. Error code = %d, Error Msg = %s\", jcid, error_msg);\n		return;\n	}\n\n	if((ret = ns_ibmmq_close_connection(jcid, \"IBMMQProducerClose\", error_msg)) < 0)\n	{\n		fprintf(stderr, \"Error in closing Ibmmq connection %d\", ret);\n		return;\n	}\n}",
  "insertStrC": "ns_ibmmq_close_connection(int jpcid, char *transaction_name, char *error_msg);",
  "insertStrJava": "ns_ibmmq_close_connection(int jpcid, char *transaction_name, char *error_msg);",
  "description": "The provided code is a function that initializes an IBM MQ producer with the given parameters and a connection pool of pool_size. It then retrieves a connection from the pool and closes the connection after using it.",
  "component": [
    {
      "id": "$1",
      "type": "TextField",
      "label": "JMS Pool connection id",
      "labelVarCheckbox": "",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter pool connection id",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Number",
        "required": true,
		"max": 2147483647,
		"min": 0
		}
    },
	{
      "id": "$2",
      "type": "TEXT_VAR",
      "label": "Transaction Name",
      "labelVarCheckbox": "If transaction name is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter transaction name",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$3",
      "type": "TEXT_VAR",
      "label": "Error Message",
      "labelVarCheckbox": "If error message is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter error message",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
    {
      "id": "$ret",
      "type": "TextField",
      "label": "Return Variable",
      "labelVarCheckbox": "",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "First character must be Alpha.\r\nOther characters are Alpha, Numeric or Underscore",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
	"pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,63}$",
        "required": false,
        "method": "isValidVar(arg)"
      }
    }
  ]
}
