{
  "synLogic": "int $ret \u003d $api($1, $2);",
  "help": "The ns_end_transaction marks the end of a transaction and records the amount of time it took to perform a transaction.\nTo indicate a transaction place the ns_start_transaction before the url/page and the ns_end_transaction  after the url/page.",
  "notes": "1. You can manually set the status of the transaction or allow the script to detect it automatically (default). \n2. By default the status of the transaction is NS_AUTO_STATUS which means that the status of transaction is same as status of the page . In case there are multiple pages in a transaction then the status of the last executed page is the transaction status. \n3. You can also set the status as SUCCESS or error (see example).",
  "returns": "returns 0 on success and –1 on failure",
  "arguments": "",
  "parameterization": "Parametrization can be done in transaction name",
  "component": [
    {
      "id": "$1",
      "type": "TextField",
      "label": "Transaction name",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Transaction name is of maximum 1024 characters.\r\nFirst character must be Alpha.\r\nOther characters are Alpha, Numeric or Underscore ",
      "placeHolder": "Transaction",
      "isDisabled": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,1023}$",
        "required": true,
        "min": 0,
        "max": 0
      },
      "quotes": true
    },
    {
      "id": "$2",
      "type": "Dropdown",
      "label": "Status",
      "value": "NS_AUTO_STATUS",
      "css": "p-grid p-align-center w-100-p",
      "title": "Select transaction status",
      "placeHolder": "select transaction status",
      "style": "",
      "isDisabled": "",
      "list": [
        {
          "label": " AutoStatus",
          "value": "NS_AUTO_STATUS"
        },
        {
          "label": " Success",
          "value": "0"
        },
        {
          "label": " TxErr64",
          "value": "64"
        },
        {
          "label": " TxErr65",
          "value": "65"
        },
        {
          "label": " TxErr66",
          "value": "66"
        },
        {
          "label": " TxErr67",
          "value": "67"
        },
        {
          "label": " TxErr68",
          "value": "68"
        },
        {
          "label": " TxErr69",
          "value": "69"
        },
        {
          "label": " TxErr70",
          "value": "70"
        },
        {
          "label": " TxErr71",
          "value": "71"
        },
        {
          "label": " TxErr72",
          "value": "72"
        },
        {
          "label": " TxErr73",
          "value": "73"
        },
        {
          "label": " TxErr74",
          "value": "74"
        },
        {
          "label": " TxErr75",
          "value": "75"
        },
        {
          "label": " TxErr76",
          "value": "76"
        },
        {
          "label": " TxErr77",
          "value": "77"
        },
        {
          "label": " TxErr78",
          "value": "78"
        },
        {
          "label": " TxErr79",
          "value": "79"
        },
        {
          "label": " TxErr80",
          "value": "80"
        },
        {
          "label": " TxErr81",
          "value": "81"
        },
        {
          "label": " TxErr82",
          "value": "82"
        },
        {
          "label": " TxErr83",
          "value": "83"
        },
        {
          "label": " TxErr84",
          "value": "84"
        },
        {
          "label": " TxErr85",
          "value": "85"
        },
        {
          "label": " TxErr86",
          "value": "86"
        },
        {
          "label": " TxErr87",
          "value": "87"
        },
        {
          "label": " TxErr88",
          "value": "88"
        },
        {
          "label": " TxErr89",
          "value": "89"
        },
        {
          "label": " TxErr90",
          "value": "90"
        },
        {
          "label": " TxErr91",
          "value": "91"
        },
        {
          "label": " TxErr92",
          "value": "92"
        },
        {
          "label": " TxErr93",
          "value": "93"
        },
        {
          "label": " TxErr94",
          "value": "94"
        },
        {
          "label": " TxErr95",
          "value": "95"
        }
      ],
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "text",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 0
      },
      "quotes": true
    },
    {
      "id": "$ret",
      "type": "TextField",
      "label": "Return Variable",
      "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": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "pattern": "^[a-zA-Z_][a-zA-Z0-9_\u003e]{0,63}$",
        "required": false,
        "min": 0,
        "max": 0
      },
      "quotes": true
    }
  ],
  "name": "ns_end_transaction",
  "syntax": "int ns_end_transaction(char* tx_name, int status)",
  "javaSyntax": "int ns_end_transaction(String txName, int status)",
  "jsSyntax": "ns_end_transaction(txName: string, status: number)",
  "cEx": "Example 1: Simple transaction \n\nflow()\n{\n    ns_start_transaction (\"AddToCart\");\n    ns_web_url (\"\"getcart\",\n        \"URL\u003dhttps:\/\/184.105.52.73:4444\/ProductUI\/productSummary\/cartsummary\",\n    );\n    ns_end_transaction (\"AddToCart\", NS_AUTO_STATUS););\n}\n\nExample2: Conditional transaction ending (Failed status)\n\nflow()\n{\n    if((strcmp(ns_eval_string(\"{CheckCartRenderingSP}\"),\"Subtotal\"))){\n      ns_start_transaction(\"MOB_Cart_CSR\");\n      ns_end_transaction(\"MOB_Cart_CSR\",NS_AUTO_STATUS);\n    } else {\n      ns_start_transaction(\"MOB_Cart_SSR\");\n      ns_end_transaction(\"MOB_Cart_SSR\",65);\n   }\n}\n",
  "javaEx": "Example 1: Simple transaction \n\nflow(NSApi nsApi)\n{\n    nsApi.ns_start_transaction (\"\"AddToCart\"\");\n    nsApi.ns_web_url (\"\"getcart\"\",\n        \"\"URL\u003dhttps:\/\/184.105.52.73:4444\/ProductUI\/productSummary\/cartsummary\"\",\n    );\n    nsApi.ns_end_transaction (\"\"AddToCart\"\", NS_AUTO_STATUS););\n}\n\nExample2: Conditional transaction ending (Failed status)\n\nflow(NSApi nsApi)\n{\n    if((nsApi.ns_eval_string(\"{CheckCartRenderingSP}\").equals(\"Subtotal\"))){\n      nsApi.ns_start_transaction(\"MOB_Cart_CSR\");\n      nsApi.ns_end_transaction(\"MOB_Cart_CSR\",NS_AUTO_STATUS);\n    } else {\n      nsApi.ns_start_transaction(\"MOB_Cart_SSR\");\n      nsApi.ns_end_transaction(\"MOB_Cart_SSR\",65);\n   }\n}\n",
  "jsEx": "Example 1: Simple transaction \n\n    nsApi.ns_start_transaction (\"\"AddToCart\"\");\n    nsApi.ns_web_url (\"\"getcart\"\",\n        \"\"URL\u003dhttps:\/\/184.105.52.73:4444\/ProductUI\/productSummary\/cartsummary\"\",\n    );\n    nsApi.ns_end_transaction (\"\"AddToCart\"\", NS_AUTO_STATUS););\n\nExample2: Conditional transaction ending (Failed status)\n\n  if((nsApi.ns_eval_string(\"{CheckCartRenderingSP}\").equals(\"Subtotal\"))){\n      nsApi.ns_start_transaction(\"MOB_Cart_CSR\");\n      nsApi.ns_end_transaction(\"MOB_Cart_CSR\",NS_AUTO_STATUS);\n    } else {\n      nsApi.ns_start_transaction(\"MOB_Cart_SSR\");\n      nsApi.ns_end_transaction(\"MOB_Cart_SSR\",65);\n   }\n",
  "insertStrC": "ns_end_transaction(char* tx_name, int status);",
  "insertStrJava": "ns_end_transaction(String txName, int status);",
  "insertStrJs": "ns_end_transaction(txName: string, status: number);",
  "description": "Marks the end of a transaction"
}