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 Template Rule

Update Template Rule

Use the PUT method to update a template rule 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/rules/42ef4d92-caed-4e05-abe8-16515f9f2961 Accept: application/json Content-Type: application/json Cookie: JSESSIONID=<VALID SESSION ID>

PUT Body in JSON Format

{ "name": "stock_template_rule", "ruleType": "template", "template": { "rel": "template", "href": "api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44", "title": "templ_stock_rule", "id": "3d385b72-232a-4caa-861c-c59072a98b44" }, "templateParams": { "price": "38.89", "symbol": "XYZ" } }

PUT Response in JSON Format

Returns the template rule object and source code 200 OK. Returns the error object if an error occurs.
{ "id": "42ef4d92-caed-4e05-abe8-16515f9f2961", "name": "stock_template_rule", "self": { "rel": "self", "href": "api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961", "title": "stock_template_rule", "id": "42ef4d92-caed-4e05-abe8-16515f9f2961" }, "actions": [ { "rel": "update", "href": "api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961", "type": "PUT", "title": "Edit" }, { "rel": "delete", "href": "api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961", "type": "DELETE", "title": "Delete" }, { "rel": "deploy", "href": "api/projects/1/deploy", "type": "POST", "title": "Deploy" }, { "rel": "createAdvancedRule", "type": "POST", "title": "Create Advanced Rule" }, { "rel": "createTemplate", "href": "api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961", "type": "POST", "title": "Create Template" } ], "owningProject": { "rel": "owningProject", "href": "api/projects/1", "title": "Default Project", "id": "1" }, "type": "rules", "valid": true, "lastModifiedDate": "2013-09-26T16:00:06+05:30", "createDate": "2013-09-26T15:43:47+05:30", "createdBy": "Administrator", "predefined": false, "deployable": true, "deployState": "DRAFT", "force": false, "drqlStatement": "when 1 stock with symbol = 'XYZ' and price > '38.89' then MyFileOutputResponse with contents='${stock.symbol} price is greater than ${stock.price}'", "drqlStatementEditable": null, "topics": [ { "href": "api/projects/1/topics/c03e56e5-3718-4989-b23b-fe6f342ea655", "title": "stock", "objectType": "topics", "id": "c03e56e5-3718-4989-b23b-fe6f342ea655" } ], "responses": [ { "href": "api/projects/1/responses/c792b088-5f99-4b4b-9b28-b02d2c618edb", "title": "MyFileOutputResponse", "objectType": "responses", "id": "c792b088-5f99-4b4b-9b28-b02d2c618edb" } ], "multithreaded": false, "template": { "rel": "template", "href": "api/projects/1/templates/3d385b72-232a-4caa-861c-c59072a98b44", "title": "templ_stock_rule", "id": "3d385b72-232a-4caa-861c-c59072a98b44" }, "ruleType": "template", "templateParams": { "price": "38.89", "symbol": "XYZ" }, "drqlStatementFormatted": "when 1 stock with symbol = 'XYZ' and price > '38.89' 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/rules/42ef4d92-caed-4e05-abe8-16515f9f2961 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_template_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> <href>api/projects/1/responses/c792b088-5f99-4b4b-9b28-b02d2c618edb</href> <id>c792b088-5f99-4b4b-9b28-b02d2c618edb</id> <objectType>responses</objectType> <title>MyFileOutputResponse</title> </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> <href>api/projects/1/topics/c03e56e5-3718-4989-b23b-fe6f342ea655</href> <id>c03e56e5-3718-4989-b23b-fe6f342ea655</id> <objectType>topics</objectType> <title>stock</title> </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> <actions> <href>api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961</href> <rel>update</rel> <title>Edit</title> <type>PUT</type> </actions> <actions> <href>api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961</href> <rel>delete</rel> <title>Delete</title> <type>DELETE</type> </actions> <actions> <href>api/projects/1/deploy</href> <rel>deploy</rel> <title>Deploy</title> <type>POST</type> </actions> <actions> <rel>createAdvancedRule</rel> <title>Create Advanced Rule</title> <type>POST</type> </actions> <actions> <href>api/projects/1/rules/42ef4d92-caed-4e05-abe8-16515f9f2961</href> <rel>createTemplate</rel> <title>Create Template</title> <type>POST</type> </actions> <id>42ef4d92-caed-4e05-abe8-16515f9f2961</id> <name>stock_template_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_template_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> <href>api/projects/1/responses/c792b088-5f99-4b4b-9b28-b02d2c618edb</href> <id>c792b088-5f99-4b4b-9b28-b02d2c618edb</id> <objectType>responses</objectType> <title>MyFileOutputResponse</title> </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> <href>api/projects/1/topics/c03e56e5-3718-4989-b23b-fe6f342ea655</href> <id>c03e56e5-3718-4989-b23b-fe6f342ea655</id> <objectType>topics</objectType> <title>stock</title> </topics> </rule>
Response Code: 200 OK

0 COMMENTS

We’d like to hear from you!