business-rule-editor1
v1.1.4
Published
Includes APIs for RuleService, FunctionService and FormService.
Downloads
2
Readme
API endpoints for Business Rule Editor
- RuleService
1.1. getAll
- Endpoint: RuleService.getAll()
- Params: NULL
- Return: ids - type: BusinessRule[]
- Description: Return all rules which were defined on blockchain network by BusinessRuleEditor app.
- Data Structure: BusinessRule = { uint id; string name; Action[] actions; Formula.Param[] params; } 1.2. runRule
- Endpoint: RuleService.runRule(id)
- Params: id - type: unit256
- Return: NULL
- Description: Run business rule for the given ID.
- Data Structure:
- FunctionService
2.1. getAll
- Endpoint: FunctionService.getAll()
- Params: NULL
- Return: ids- type: CustomFunction[]
- Description: Return all functions in blockchain network.
- Data Structure: CustomFunction = { uint id; string name; Param[] params; }
2.2. getOne
- Endpoint: FunctionService.getOne(id)
- Params: id: type: unit256
- Return: function- type: CustomFunction
- Description: Return a function for the given id in blockchain network.
- Data Structure: CustomFunction = { uint id; string name; Param[] params; }
2.3. runFunction
- Endpoint: FunctionService.runFunction(id)
- Params: id: type: unit256
- Return: True / False
- Description: Run a function for the given id in blockchain network.
- Data Structure:
- FormService
3.1. createOne
- Endpoint: FormService.createOne(category, name, data)
- Params: category- type: String name- type: String data- type: Node[]
- Return: TRUE / FALSE
- Description: Create a JSON data to Blockchain network.
- Data Structure: Node = { uint primaryId; string id; uint parentId; string name; string key; string value; string query; string datatype; string children; }
3.2. getAll // wrong return params
- Endpoint: FormService.getAll()
- Params: NULL
- Return: product_data- type: [Node [] ]
- Description: Returns all JSON data in Blockchain network.
- Data Structure: struct Node{ uint primaryId; string id; uint parentId; string name; string key; string value; string query; string datatype; string children; }
3.3. getMany
- Endpoint: FormService.getMany(query_pairs)
- Params: query_pairs- type: Query[]
- Return: product_data- type: [Node [] ]
- Description: Return Product data (JSON) on the given Queries
- Data Structure: Query = { string key; string value; } struct Node{ uint primaryId; string id; uint parentId; string name; string key; string value; string query; string datatype; string children; }
3.4. getOne
- Endpoint: FormService.getOne(_name)
- Params: _name- type: string
- Return: product_data- type: [Node [] ]
- Description: Return Product data(JSON) on the given product name.
- Data Structure:
3.5. deleteOne
- Endpoint: FormService.deleteOne(_name)
- Params: _name- type: String
- Return: TRUE / FALSE
- Description: Remove a Product data(JSON) on the given name.
- Data Structure:
3.6. deleteMany
- Endpoint: FormService.deleteMany(query_pairs)
- Params: query_pairs- type: Query[]
- Return: TRUE / FALSE
- Description: Remove Product data(JSONs) on the given queries.
- Data Structure: Query = { string key; string value; }
3.7. deleteAll
- Endpoint: FormService.deleteAll()
- Params: NULL
- Return: TRUE / FALSE
- Description: Remove all Product data (Form data) in blockchain network.
- Data Structure:
3.8. updateOne
- Endpoint: FormService.updateOne(name, query_pairs)
- Params: name- type: String query_pairs- type: Query[]
- Return: TRUE / FALSE
- Description: Modify a Product data using the given product name and queries.
- Data Structure: Query = { string key; string value; }
3.9. updateMany
Endpoint: FormService.updateMany(from_query_pairs, to_query_pairs)
Params: from_query_pairs- type: Query[] to_query_pairs- type: Query[]
Return:
Description: Modify Product data on given from_query_pairs to to_query_pairs.
Data Structure:
**** Deprecations
3.2. getRawData // deprecated
Endpoint: FormService.getRawData()
Params: NULL
Return: result- type: [{tree_child: tree_child, nodes: nodes}]
Description:
Data Structure: tree_child = { string id; string name; string category; string product_id; string query; // sample=> '$.' + category + '.' + name, array children; node[] nodes; };
node = { string id; string name; string value; string datatype; string primaryId; string parentId; string key; string query; array children; }