{
  "synLogic": "int $ret \u003d $api($1, $2, $3, $4);",
  "help": "The ns_web_websocket_check allows you to do a content check on your websocket message.",
  "notes": "",
  "returns": "int",
  "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\u003eMessage Variable\u003c/td\u003e     \u003ctd\u003e             Variable which contains received message from server         \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e       \u003ctd\u003eCheck String\u003c/td\u003e     \u003ctd\u003e             String to search.         \u003c/td\u003e     \u003c/tr\u003e     \u003ctr\u003e    \u003ctd\u003eFailure Condition\u003c/td\u003e     \u003ctd\u003e              There are two failure conditions.       \u003c/td\u003e     \u003c/tr\u003e \u003ctr\u003e    \u003ctd\u003e \u003c/td\u003e     \u003ctd\u003e    Match Text Not Found: transaction would fail if check string not found in the received message.         \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003e \u003c/td\u003e     \u003ctd\u003e    Match Text Found: transaction would fail if check string found in the received message.         \u003c/td\u003e     \u003c/tr\u003e  \u003c/tr\u003e     \u003ctr\u003e    \u003ctd\u003eAction on Failure\u003c/td\u003e     \u003ctd\u003e              Action to follow when checkpoint fails. There are two action options.       \u003c/td\u003e     \u003c/tr\u003e \u003ctr\u003e    \u003ctd\u003e \u003c/td\u003e     \u003ctd\u003e    Stop Session:      session stops if checkpoint fails.         \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003e \u003c/td\u003e     \u003ctd\u003e    Continue Session:  session continues if checkpoint fails.   \u003c/td\u003e     \u003c/tr\u003e \u003c/table\u003e",
  "parameterization": "Standard parametrization is supported in all arguments",
  "component": [
    {
      "id": "$1",
      "type": "TextField",
      "label": "Message Variable",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter message variable",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "quotes": false,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 0,
        "method": "isValidVar(arg)"
      }
    },
    {
      "id": "$2",
      "type": "TEXT_VAR",
      "label": "Check String",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter check string",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "If check string is a program variable.",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 0
      },
      "quotes": true
    },
    {
      "id": "$3",
      "type": "Dropdown",
      "label": "Failure Condition",
      "value": "NS_CP_FAIL_ON_NOT_FOUND",
      "css": "p-grid p-align-center w-100-p",
      "title": "Select Failure Condition",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "list": [
        {
          "label": "Match Text Not Found",
          "value": "NS_CP_FAIL_ON_NOT_FOUND"
        },
        {
          "label": "Match Text Found",
          "value": "NS_CP_FAIL_ON_FOUND"
        }
      ],
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "text",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 0
      },
      "quotes": true
    },
	{
      "id": "$4",
      "type": "Dropdown",
      "label": "Action on Failure",
      "value": "NS_CP_ACTION_STOP",
      "css": "p-grid p-align-center w-100-p",
      "title": "Select Action on Failure",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "list": [
        {
          "label": "Stop Session",
          "value": "NS_CP_ACTION_STOP"
        },
        {
          "label": "Continue Session",
          "value": "NS_CP_ACTION_CONTINUE"
        }
      ],
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "text",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 0
      },
      "quotes": true
    }
  ],
  "name": "ns_web_websocket_check",
  "syntax": "int ns_web_websocket_check(char *mesg, char *check_string, int failure_condition, int action_on_failure)",
  "javaSyntax": "",
  "jsSyntax": "ns_web_websocket_check(mesg: string, check_string: string, failure_condition: number, action_on_failure: number)",
  "cEx": "flow()\n{\n  char *msg;	// Pointer to the buffer containing the message received. If no message (after timeout), it will be NULL.\n  ns_start_transaction(\"Read_Msg\");\n  msg = ns_web_websocket_read(1, 1000, &msg_len);\n  ns_end_transaction(\"Read_Msg\", NS_AUTO_STATUS);\n\n  //Example1\n  ns_web_websocket_check(\"Welcome\", \"msg\", NS_CP_FAIL_ON_NOT_FOUND, NS_CP_ACTION_STOP);\n  // Here in this example \'Read_Msg\' transaction will fail with status CVFail if string \'Welcome\' is NOT found in msg and session will stop on failure\n\n  //Example2\n  ns_web_websocket_check(\"Welcome\", \"msg\", NS_CP_FAIL_ON_NOT_FOUND, NS_CP_ACTION_CONTINUE);\n  // Here in this example \'Read_Msg\' transaction will fail with status CVFail if string \'Welcome\' is NOT found in msg and session will continue on failure\n\n  //Example3\n  ns_web_websocket_check(\"Invalid Customer ID\", \"msg\", NS_CP_FAIL_ON_FOUND, NS_CP_ACTION_STOP);\n  // Here in this example \'Read_Msg\' transaction will fail with status CVFail if string \'Invalid Customer ID\' is found in msg and session will stop on failure\n\n  //Example4\n  ns_web_websocket_check(\"Invalid Customer ID\", \"msg\", NS_CP_FAIL_ON_FOUND, NS_CP_ACTION_CONTINUE);\n  // Here in this example \'Read_Msg\' transaction will fail with status CVFail if string \'Invalid Customer ID\' is found in msg and session will continue on failure\n}",
  "javaEx": "",
  "jsEx": "  let *msg;	// Pointer to the buffer containing the message received. If no message (after timeout), it will be NULL.\n  nsApi.ns_start_transaction(\"Read_Msg\");\n  msg = nsApi.ns_web_websocket_read(1, 1000, &msg_len);\n  nsApi.ns_end_transaction(\"Read_Msg\", NS_AUTO_STATUS);\n\n  //Example1\n  nsApi.ns_web_websocket_check(\"Welcome\", \"msg\", NS_CP_FAIL_ON_NOT_FOUND, NS_CP_ACTION_STOP);\n  // Here in this example \'Read_Msg\' transaction will fail with status CVFail if string \'Welcome\' is NOT found in msg and session will stop on failure\n\n  //Example2\n  nsApi.ns_web_websocket_check(\"Welcome\", \"msg\", NS_CP_FAIL_ON_NOT_FOUND, NS_CP_ACTION_CONTINUE);\n  // Here in this example \'Read_Msg\' transaction will fail with status CVFail if string \'Welcome\' is NOT found in msg and session will continue on failure\n\n  //Example3\n  nsApi.ns_web_websocket_check(\"Invalid Customer ID\", \"msg\", NS_CP_FAIL_ON_FOUND, NS_CP_ACTION_STOP);\n  // Here in this example \'Read_Msg\' transaction will fail with status CVFail if string \'Invalid Customer ID\' is found in msg and session will stop on failure\n\n  //Example4\n  nsApi.ns_web_websocket_check(\"Invalid Customer ID\", \"msg\", NS_CP_FAIL_ON_FOUND, NS_CP_ACTION_CONTINUE);\n  // Here in this example \'Read_Msg\' transaction will fail with status CVFail if string \'Invalid Customer ID\' is found in msg and session will continue on failure\n}",
  "insertStrC": "ns_web_websocket_check(char *mesg, char *check_value, int failure_condition, int action_on_failure);",
  "insertStrJava": "",
  "insertStrJs": "ns_web_websocket_check(mesg: string, check_string: string, failure_condition: number, action_on_failure: number)",
  "description": "allows you to do a content check on your websocket message."
}
