Table of Contents

Search

  1. Preface
  2. RulePoint Interfaces
  3. RulePoint Services
  4. Custom Service API
  5. Java Adapter for REST API
  6. RulePoint REST API
  7. Sample XML and JSON Requests and Responses
  8. RulePoint Pluggable Authentication Module
  9. HTTP Request and Response Attributes

Developer Guide

Developer Guide

Update a Template

Update a Template

Use the PUT method to update a template in RulePoint.

PUT Request in JSON Format

Generate a PUT request. For example, the following PUT request updates a template in a RulePoint application:
PUT http://localhost:8080/rulepoint/api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44 Accept: application/json Content-Type: application/json Cookie: JSESSIONID=<VALID SESSION ID>

PUT Body in JSON Format

{ "name": "templ_stock_rule", "description": "", "instructions": "", "comment": "A template for creating rules around stocks", "templateDrqlText": "when 1 stock with symbol = '<<symbol>>' and price > '<<price>>' then MyFileOutputResponse with contents='${stock.symbol} price is greater than ${stock.price}'", "multithreaded": false, "force": false, "upgrade": false, "templateParameters": [ { "paramType": "String", "name": "symbol", "defaultParamValue": "XYZ", "testParamValue": "XYZ", "format": "", "picklist": "", "description": "", "leftLabel": "", "rightLabel": "", "popupHelp": "", "inlineHelp": null, "valueList": null, "minimum": null, "maximum": null, "realMin": null, "realMax": null, "maxLength": null, "setDefault": true, "fieldName": "symbol", "customValidationValue": [], "watchlist": null, "topicName": "", "paramOrder": 0 }, { "paramType": "Real", "name": "price", "defaultParamValue": "38.89", "testParamValue": "38.89", "format": "", "picklist": "", "description": "", "leftLabel": "", "rightLabel": "", "popupHelp": "", "inlineHelp": null, "valueList": null, "minimum": null, "maximum": null, "realMin": null, "realMax": null, "maxLength": null, "setDefault": true, "fieldName": "price", "customValidationValue": null, "watchlist": null, "topicName": "", "paramOrder": 1 } ] }

PUT Response in JSON Format

Returns the template object and source code. Returns the error object if an error occurs.
{ "id": "3d385b72-232a-4caa-861c-c59072a98b44", "name": "templ_stock_rule", "self": { "rel": "self", "href": "api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44", "title": "templ_stock_rule", "id": "3d385b72-232a-4caa-861c-c59072a98b44" }, "actions": [ { "rel": "createDeploymentPolicy", "href": "api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44/deploymentPolicy", "type": "POST", "title": "Create Deployment Policy" }, { "rel": "createTemplateRule", "href": "api/projects/1", "type": "DELETE", "title": "Create Template Rule" }, { "rel": "delete", "href": "api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44", "type": "DELETE", "title": "Delete" }, { "rel": "update", "href": "api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44", "type": "PUT", "title": "Edit" } ], "acl": { "rel": "acl", "href": "api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44/acl", "title": "acl" }, "owningProject": { "rel": "owningProject", "href": "api/projects/1", "title": "Default Project", "id": "1" }, "description": "", "type": "templates", "valid": true, "lastModifiedDate": "2013-09-26T15:38:08+05:30", "createDate": "2013-09-26T15:26:14+05:30", "createdBy": "Administrator", "predefined": false, "deployable": false, "deployState": "DRAFT", "force": false, "templateParameters": [ { "paramType": "String", "name": "symbol", "defaultParamValue": "XYZ", "testParamValue": "XYZ", "format": "", "picklist": "", "description": "", "leftLabel": "", "rightLabel": "", "popupHelp": "", "inlineHelp": null, "valueList": null, "minimum": null, "maximum": null, "realMin": null, "realMax": null, "maxLength": null, "setDefault": true, "fieldName": "symbol", "customValidationValue": [], "watchlist": null, "topicName": "", "paramOrder": 0 }, { "paramType": "Real", "name": "price", "defaultParamValue": "38.89", "testParamValue": "38.89", "format": "", "picklist": "", "description": "", "leftLabel": "", "rightLabel": "", "popupHelp": "", "inlineHelp": null, "valueList": null, "minimum": null, "maximum": null, "realMin": null, "realMax": null, "maxLength": null, "setDefault": true, "fieldName": "price", "customValidationValue": null, "watchlist": null, "topicName": "", "paramOrder": 1 } ], "rules": [], "topics": [ { "href": "api/projects/1/topics/c03e56e5-3718-4989-b23b-fe6f342ea655", "title": "stock", "objectType": "topics", "id": "c03e56e5-3718-4989-b23b-fe6f342ea655" } ], "watchlists": [], "analytics": [], "responses": [ { "href": "api/projects/1/responses/c792b088-5f99-4b4b-9b28-b02d2c618edb", "title": "MyFileOutputResponse", "objectType": "responses", "id": "c792b088-5f99-4b4b-9b28-b02d2c618edb" } ], "comment": "A template for creating rules around stocks", "upgrade": false, "multithreaded": false, "templateDrqlText": "when 1 stock with symbol = '<<symbol>>' and price > '<<price>>' then MyFileOutputResponse with contents='${stock.symbol} price is greater than ${stock.price}'", "instructions": "", "templateDrqlTextFormatted": "when 1 stock with symbol = '&lt;&lt;symbol&gt;&gt;' and price &gt; '&lt;&lt;price&gt;&gt;' then MyFileOutputResponse with contents='${stock.symbol} price is greater than ${stock.price}'" }
Response Code: 200 OK

PUT Request in XML Format

Generate a PUT request. For example, the following PUT request updates a template in a RulePoint application:
PUT http://localhost:8080/rulepoint/api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44 Accept: application/xml Content-Type: application/xml Cookie: JSESSIONID=<VALID SESSION ID>

PUT Body in XML Format

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <rule> <name>stock_rule</name> <description/> <type>rules</type> <valid>true</valid> <drqlStatement>when 1 stock with symbol = 'XYZ' and price &gt; '38.89' then MyFileOutputResponse with contents='${stock.symbol} price is greater than ${stock.price}'</drqlStatement> <drqlStatementFormatted>when 1 stock with symbol = 'XYZ' and price &gt; '38.89' then MyFileOutputResponse with contents='${stock.symbol} price is greater than ${stock.price}'</drqlStatementFormatted> <multithreaded>false</multithreaded> <responses> <response> <href>api/projects/1/responses/c792b088-5f99-4b4b-9b28-b02d2c618edb</href> <id>c792b088-5f99-4b4b-9b28-b02d2c618edb</id> <objectType>responses</objectType> <title>MyFileOutputResponse</title> </response> </responses> <ruleType>template</ruleType> <template> <href>api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44</href> <id>3d385b72-232a-4caa-861c-c59072a98b44</id> <rel>template</rel> <title>templ_stock_rule</title> </template> <templateParams> <entry> <key>price</key> <value>38.89</value> </entry> <entry> <key>symbol</key> <value>XYZ</value> </entry> </templateParams> <topics> <topic> <href>api/projects/1/topics/c03e56e5-3718-4989-b23b-fe6f342ea655</href> <id>c03e56e5-3718-4989-b23b-fe6f342ea655</id> <objectType>topics</objectType> <title>stock</title> </topic> </topics> </rule>

PUT Response in XML Format

Returns the schedule object and response code. Returns the error object if an error occurs.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <rule> <acl> <href>api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961/acl</href> <rel>acl</rel> <title>acl</title> </acl> <actions> <action> <href>api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961</href> <rel>update</rel> <title>Edit</title> <type>PUT</type> </action> <action> <href>api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961</href> <rel>delete</rel> <title>Delete</title> <type>DELETE</type> </action> <action> <href>api/projects/1/deploy</href> <rel>deploy</rel> <title>Deploy</title> <type>POST</type> </action> <action> <rel>createAdvancedRule</rel> <title>Create Advanced Rule</title> <type>POST</type> </action> <action> <href>api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961</href> <rel>createTemplate</rel> <title>Create Template</title> <type>POST</type> </action> </actions> <id>42ef4d92-caed-4e05-abe8-16515f9f2961</id> <name>stock_rule</name> <owningProject> <href>api/projects/1</href> <id>1</id> <rel>owningProject</rel> <title>Default Project</title> </owningProject> <self> <href>api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961</href> <id>42ef4d92-caed-4e05-abe8-16515f9f2961</id> <rel>self</rel> <title>stock_rule</title> </self> <createDate/> <createdBy>Administrator</createdBy> <deployState>DRAFT</deployState> <deployable>true</deployable> <description/> <force>false</force> <lastModifiedDate/> <predefined>false</predefined> <type>rules</type> <valid>true</valid> <drqlStatement>when 1 stock with symbol = 'XYZ' and price &gt; '38.89' then MyFileOutputResponse with contents='${stock.symbol} price is greater than ${stock.price}'</drqlStatement> <drqlStatementFormatted>when 1 stock with symbol = 'XYZ' and price &gt; '38.89' then MyFileOutputResponse with contents='${stock.symbol} price is greater than ${stock.price}'</drqlStatementFormatted> <multithreaded>false</multithreaded> <responses> <response> <href>api/projects/1/responses/c792b088-5f99-4b4b-9b28-b02d2c618edb</href> <id>c792b088-5f99-4b4b-9b28-b02d2c618edb</id> <objectType>responses</objectType> <title>MyFileOutputResponse</title> </response> </responses> <ruleType>template</ruleType> <template> <href>api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44</href> <id>3d385b72-232a-4caa-861c-c59072a98b44</id> <rel>template</rel> <title>templ_stock_rule</title> </template> <templateParams> <entry> <key>price</key> <value>38.89</value> </entry> <entry> <key>symbol</key> <value>XYZ</value> </entry> </templateParams> <topics> <topic> <href>api/projects/1/topics/c03e56e5-3718-4989-b23b-fe6f342ea655</href> <id>c03e56e5-3718-4989-b23b-fe6f342ea655</id> <objectType>topics</objectType> <title>stock</title> </topic> </topics> </rule>
Response Code: 200 OK

0 COMMENTS

We’d like to hear from you!