{
  "synLogic": "int $ret \u003d $api($1, $2, $3, $4, $5, $6, $7, $8, $9);",
  "help": "The given code initializes an IBM MQ producer using the provided parameters and creates a connection pool with a given pool size. It returns a JMS Pool ID, which is used to get a connection from the pool. In case of an error, it returns an error code with an error message.",
  "notes": "", 
  "returns": "\nFunction returns a value less than zero, an error has occurred. The error code and error message are then printed to the standard error stream using fprintf(). \nIf there is no error, the program will proceed to consume messages from the IBM MQ queue using other functions not shown in the provided code snippet.",
  "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\u003eHost Name\u003c/td\u003e     \u003ctd\u003e     The hostname or IP address of the IBM MQ server.        \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e       \u003ctd\u003ePort\u003c/td\u003e     \u003ctd\u003e The port number on which the IBM MQ server is listening.        \u003c/td\u003e     \u003c/tr\u003e     \u003ctr\u003e    \u003ctd\u003eQueue Manager\u003c/td\u003e     \u003ctd\u003e The name of the queue manager to which the producer will connect. \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003eChannel\u003c/td\u003e     \u003ctd\u003e   The name of the channel to be used for communication.   \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003eQueue\u003c/td\u003e     \u003ctd\u003e           The name of the queue to which messages will be sent.   \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003eUser Name\u003c/td\u003e     \u003ctd\u003e           The user ID for authentication to the queue manager.         \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003ePassword\u003c/td\u003e     \u003ctd\u003e           The password for authentication to the queue manager, which is expected to be a Base64 encoded string. Note that the ns_decrypt function is used to decode this string.        \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003ePool Size\u003c/td\u003e     \u003ctd\u003e The maximum number of connections in the connection pool.         \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003eError Message\u003c/td\u003e     \u003ctd\u003e  A character array of size 1014 to store the error message in case of any errors.   \u003c/td\u003e     \u003c/tr\u003e  \u003c/table\u003e",
  "parameterization": "",
  "name": "ns_ibmmq_init_producer",
  "syntax": "int ns_ibmmq_init_producer(char *ibmmq_hostname, int ibmmq_port, char *queue_manager, char *channel,char *ibmmq_queue,char *ibmmq_userId,  char *ibmmq_password, int max_pool_size, char *error_msg)",
  "javaSyntax": "int ns_ibmmq_init_producer(char *ibmmq_hostname, int ibmmq_port, char *queue_manager, char *channel,char *ibmmq_queue,char *ibmmq_userId,  char *ibmmq_password, int max_pool_size, 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\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}",
  "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\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}",
  "insertStrC": "ns_ibmmq_init_producer(char *ibmmq_hostname, int ibmmq_port, char *queue_manager, char *channel,char *ibmmq_queue,char *ibmmq_userId,  char *ibmmq_password, int max_pool_size, char *error_msg);",
  "insertStrJava": "ns_ibmmq_init_producer(char *ibmmq_hostname, int ibmmq_port, char *queue_manager, char *channel,char *ibmmq_queue,char *ibmmq_userId,  char *ibmmq_password, int max_pool_size, char *error_msg);",
  "description": "The given code initializes an IBM MQ producer using the provided parameters and creates a connection pool with a given pool size. It returns a JMS Pool ID, which is used to get a connection from the pool. In case of an error, it returns an error code with an error message.",
  "component": [
    {
      "id": "$1",
      "type": "TextField",
      "label": "Host Name",
      "labelVarCheckbox": "If Host Name is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter Host Name",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
    {
      "id": "$2",
      "type": "TextField",
      "label": "Port",
      "labelVarCheckbox": "",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter port",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Number",
        "required": true,
		"max": 2147483647,
		"min": 0
		}
    },
	{
      "id": "$3",
      "type": "TextField",
      "label": "Queue Manager",
      "labelVarCheckbox": "If queue manager is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter queue manager",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$4",
      "type": "TextField",
      "label": "Channel",
      "labelVarCheckbox": "If channel is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter channel",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$5",
      "type": "TextField",
      "label": "Queue",
      "labelVarCheckbox": "If queue is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter queue",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$6",
      "type": "TextField",
      "label": "Username",
      "labelVarCheckbox": "If username is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter username",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$7",
      "type": "TextField",
      "label": "Password",
	  "labelVarCheckbox": "If username is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter Passowrd",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$8",
      "type": "TextField",
      "label": "Pool Size",
      "labelVarCheckbox": "",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter pool size",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Number",
        "required": true,
		"max": 2147483647,
		"min": 0
		}
    },
	{
      "id": "$9",
      "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)"
      }
    }
  ]
}
