The following code excerpts the input and output of the TradeAllocation sample's AllocateTrade Tester.

JSON Input:


{
 "Objects": [{
  "dMarketValueBeforeTrade": "10216333.000000",
  "price": "950.000000",
  "transaction": [
  {
   "account": [{
    "maxPctHiYield": "35.000000",
    "dPositionHiYield": "330000.000000",
    "dPositionHiGrade": "819167.000000",
    "securityPosition": [
    {
     "quantity": "5000",
     "dMarketValue": "819167.000000",
     "security": [{
      "symbol": "PMBND",
      "yield": "6.000000",
      "daysInHolding": "23",
      "dMarketValue": "164.000000",
      "dProfile": "HI-GRD",
      "dAnnualInterestAmt": "60.000000",
      "price": "160.000000",
      "issuer": "Phillip Morris",
      "sin": "Y",
      "dAccruedInterest": "4.000000",
      "faceValue": "1000.000000",
      "rating": "A",
      "__metadata": {
      "#id": "Security_id_1",
      "#type": "Security"
      }
     }],
     "__metadata": {
      "#id": "SecurityPosition_id_1",
      "#type": "SecurityPosition"
     }
    },
    ...
     ],
     "__metadata": {
      "#id": "SecurityPosition_id_2",
      "#type": "SecurityPosition"
     }
    }
    ],
    "warnMargin": "3.000000",
    "name": "Boeing",
    "restricted": "false",
    "maxPctHiGrade": "75.000000",
    "number": "1640",
    "dMarketValue": "1149167.000000",
    "__metadata": {
    "#id": "Account_id_1",
    "#type": "Account"
    }
   }],
   "security": [{"__metadata": {"#ref_id": "Security_id_2"}}],
   "__metadata": {
    "#id": "Transaction_id_1",
    "#type": "Transaction"
   }
  },
  ...
  ],
 "__metadataRoot": {
  "#restrictInfoRuleMessages": "true",
  "#restrictViolationRuleMessages": "true",
  "#restrictWarningRuleMessages": "false"
 }
}
JSON TRANSLATION = 78

JSON Output:


{
  "Messages": {
    "Message": [
      {
       "entityReference": "Trade_id_1",
       "text": "[AccountConstraint,5] A restricted account [ Disney ] can't be involved in a trade.",
       "severity": "Warning",
       "__metadata": {"#type": "#RuleMessage"}
      },
      {
       "entityReference": "Trade_id_1",
       "text": "[AccountConstraint,4] No account [ Airbus ] involved in a trade can exceed 
               its maximum percentage [ 70.000000 ] for High Yield securities [ 86.156842 ].",
       "severity": "Warning",
       "__metadata": {"#type": "#RuleMessage"}
      },
      {
       "entityReference": "Trade_id_1",
       "text": "[AccountConstraint,4] No account [ Disney ] involved in a trade can exceed 
               its maximum percentage [ 65.000000 ] for High Yield securities [ 79.980241 ].",
       "severity": "Warning",
       "__metadata": {"#type": "#RuleMessage"}
      },
      {
       "entityReference": "Trade_id_1",
       "text": "[AccountConstraint,4] No account [ Boeing ] involved in a trade can exceed 
               its maximum percentage [ 35.000000 ] for High Yield securities [ 42.253808 ].",
       "severity": "Warning",
       "__metadata": {"#type": "#RuleMessage"}
      }
    ],
    "__metadata": {"#type": "#RuleMessages"},
    "version": "0.0"
  },
  "Objects": [{
    "dMarketValueBeforeTrade": 20432666,
    "price": "950.000000",
    "transaction": [
      {
       "dPositionHiGrade": 0,
       "dPositionHiYield": 269397.538944,
       "dAccruedInterest": 2249.666294,
       "dActualQuantity": 281.208287,
       "account": [{
         "dPctHiYield": 42.253808,
         "dPositionHiYield": "330000.000000",
         "dNewPositionHiGrade": 819167,
         "maxPctHiGrade": "75.000000",
         "restricted": "false",
         "dMarketValue": "1149167.000000",
         "number": "1640",
         "dPositionHiGrade": "819167.000000",
         "maxPctHiYield": "35.000000",
         "dNewPositionHiYield": 599397.538944,
         "name": "Boeing",
         "warnMargin": "3.000000",
         "securityPosition": [
          {
            "quantity": "5000",
            "dMarketValue": "819167.000000",
            "security": [{
            "symbol": "PMBND",
            "yield": "6.000000",
            "daysInHolding": "23",
            "dMarketValue": "164.000000",
            "dProfile": "HI-GRD",
            "dAnnualInterestAmt": "60.000000",
            "price": "160.000000",
            "issuer": "Phillip Morris",
            "sin": "Y",
            "dAccruedInterest": "4.000000",
            "faceValue": "1000.000000",
            "rating": "A",
            "__metadata": 
             {
               "#id": "Security_id_1",
               "#type": "Security"
              }
            }],
            "__metadata":{
               "#id": "SecurityPosition_id_1",
               "#type": "SecurityPosition"
             }
          },
          ...
          ],
  "__metadataRoot": {
    "#restrictInfoRuleMessages": "true",
    "#restrictViolationRuleMessages": "true",
    "#restrictWarningRuleMessages": "false"
  }
}

Testing a JSON request

Your Corticon Server installation implements Swagger. From your browser at http://localhost:8850/axis/swagger/ you can use Execute Decision Service to set up the dsname and a sample request's JSON Objects to run against a deployed Decision Service. See Test the installed Corticon Server on Java for more information.