{
  "synLogic": "int $ret \u003d $api($1, $2, $3);",
  "help": "This API is used to establish a connection to a messaging system using the Tibco library. If the connection fails, an error message is printed to the standard error output.\nThis method will return connection is free or it will make new connection and return it. In case of error, error code of value \u003c 0 is returned and error_msg (max 1014) is set with error message. \nFew possible errors are: \nAll connections are busy \nError in making connection \nIf actual connection is made, then transaction is started with name passed if it is not NULL or empty. \nIf connection fails, then transaction is ended with \u003cTxName\u003eError\u003cJMSErrorCode\u003e. For example, TIBCOProducerConnectError2012.",
  "notes": "Fields \nkey: JMS Key \nTxname: Transaction name to create connection",
  "returns": "A positive integer value that uniquely identifies the connection. If the connection is not established, the function returns a negative integer value, and an error message is stored in error_msg",
  "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\u003eJPID\u003c/td\u003e     \u003ctd\u003e  An integer that represents the process ID  \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e       \u003ctd\u003eTransaction Name\u003c/td\u003e     \u003ctd\u003e A string that represents the name of the connection  \u003c/td\u003e     \u003c/tr\u003e     \u003ctr\u003e    \u003ctd\u003eError Message\u003c/td\u003e     \u003ctd\u003e  A character array that will store the error message if the function fails.   \u003c/td\u003e     \u003c/tr\u003e   \u003c/table\u003e",
  "parameterization": "",
  "name": "ns_tibco_get_connection",
  "syntax": "int ns_tibco_get_connection(int jpid, char *transaction_name, char *error_msg)",
  "javaSyntax": "int ns_tibco_get_connection(int jpid, char *transaction_name, char *error_msg)",
  "cEx": "flow()\n{\n  int jpid;	//JMS Pool Id\n  int jcid;	//JMS Connection Id\n  char header[1024];	//message to be recieved\n  int header_len = 1024;	//message length\n  char error_msg[1024 + 1];	// Error string. Must be 1024 size\n  int ret;	// Error code\n  int msg_len = 1024;\n  char msg[1024 + 1];\n\n  if((jpid = ns_tibco_init_consumer(\"ssl://127.0.0.1\", 7222, 1, \"topic\", \"user_id\", ns_decrypt(\"NlEyRDZGLUQg\"), 1,error_msg)) < 0)\n  {\n    fprintf(stderr, \"Error in initializing Tibco consumer. Error code = %d, Error Msg = %s\", jpid, error_msg);\n    return;\n  }\n\n  if((jcid = ns_tibco_get_connection(jpid, \"TIBCOConsumerSSLConnect\", error_msg)) < 0)\n  {\n    fprintf(stderr, \"Error in getting Tibco connention. Error code = %d, Error Msg = %s\", jcid, error_msg);\n    return;\n  }\n\n}",
  "javaEx": "flow()\n{\n  int jpid;	//JMS Pool Id\n  int jcid;	//JMS Connection Id\n  char header[1024];	//message to be recieved\n  int header_len = 1024;	//message length\n  char error_msg[1024 + 1];	// Error string. Must be 1024 size\n  int ret;	// Error code\n  int msg_len = 1024;\n  char msg[1024 + 1];\n\n  if((jpid = ns_tibco_init_consumer(\"ssl://127.0.0.1\", 7222, 1, \"topic\", \"user_id\", ns_decrypt(\"NlEyRDZGLUQg\"), 1,error_msg)) < 0)\n  {\n    fprintf(stderr, \"Error in initializing Tibco consumer. Error code = %d, Error Msg = %s\", jpid, error_msg);\n    return;\n  }\n\n  if((jcid = ns_tibco_get_connection(jpid, \"TIBCOConsumerSSLConnect\", error_msg)) < 0)\n  {\n    fprintf(stderr, \"Error in getting Tibco connention. Error code = %d, Error Msg = %s\", jcid, error_msg);\n    return;\n  }\n\n}",
  "insertStrC": "ns_tibco_get_connection(int jpid, char *transaction_name, char *error_msg);",
  "insertStrJava": "ns_tibco_get_connection(int jpid, char *transaction_name, char *error_msg);",
  "description": "The ns_tibco_get_connection API is used to get connection from the connection pool.",
  "component": [
    {
      "id": "$1",
      "type": "TextField",
      "label": "JMS Pool id",
      "labelVarCheckbox": "",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter pool 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)"
      }
    }
     
  ]
}
