parse-server-business-rule-engine
v1.0.0
Published
business rule engine (IFTTT) for parse-server
Downloads
2
Readme
WARNING: this project is in BETA and under huge development
Installation
npm install parse-server-business-rule-engine --save
then in your cloud-code(!) entrypoint (cloud/index.js
e.g.) add this:
Parse.Config.get()
.then( (cfg) => {
var BRE = require('parse-server-business-rule-engine')
var BREDatabase = require('parse-server-business-rule-engine/channel/Database')
var bre = new BRE( Parse )
new BREDatabase({bre, classes: cfg.attributes.breClasses })
})
Then specify which (database) classes you want to expose to it:
What are Channels?
A channel is basically an object which describes triggers and/or actions. For example, Twilio (the smsservice) can be seen as a channel with triggers (receive sms) and actions (send sms)
Creating a channel
copy channel/HelloWorld/index.js to mychannel.js
then in your cloud-code entrypoint-file (cloud/index.js
e.g.) add it:
// add the business rule engine + channels
var BRE = require('parse-server-business-rule-engine')
var BREDatabase = require('parse-server-business-rule-engine/channel/Database')
++ var MyChannel = require('./../mychannel`)
// setup BRE
var bre = new BRE( Parse )
new BREDatabase({bre, classes:['User','School']})
++ new MyChannel({bre})