Skip to content

Instantly share code, notes, and snippets.

@jsloyer
Created July 29, 2015 16:28
Show Gist options
  • Select an option

  • Save jsloyer/e5a953cf5691a4aeefc2 to your computer and use it in GitHub Desktop.

Select an option

Save jsloyer/e5a953cf5691a4aeefc2 to your computer and use it in GitHub Desktop.
business rules example app.js
var app = require("express")(),
restler = require("restler");
app.get("/", function(request, response) {
var json = {
"employeeID": "jujuju",
"loanAmount": 10517320,
"theEmployee": {
"seniority": 3,
"annualSalary": 10517320,
"nbOfExtraVacationDaysBasedOnSeniority": 10517320
},
"creditAmount": 20000,
"__DecisionID__": "string",
"AnnualSalary": 20000
};
var options = {
username: "replaceme",
password: "replaceme"
};
var url = "https://brsv2-6855bc66.ng.bluemix.net/DecisionService/rest" + "/vacationsRuleApp/1.0/vacationsRuleProject/json";
restler.postJson(url, json, options).on('complete', function(data) {
response.send(data);
});
});
app.listen(process.env.VCAP_APP_PORT || 8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment