Skip to content
This repository has been archived by the owner on Oct 15, 2018. It is now read-only.

Node.js client for Drools KIE server API.

License

Notifications You must be signed in to change notification settings

bucharest-gold/drools-kie-client

Repository files navigation

drools-kie-client

Coverage Status Build Status Known Vulnerabilities dependencies Status

NPM

Node.js client for Drools KIE server API.

Project Info
License: Apache-2.0
Build: make
Documentation: http://bucharest-gold.github.io/drools-kie-client
Issue tracker: https://github.com/bucharest-gold/drools-kie-client/issues
Engines: Node.js 4.x, 6.x, 8.x

Installation

npm install drools-kie-client -S

Usage

const client = require('drools-kie-client');

const options = {
  baseUrl: 'http://host:port/kie_server_context',
  username: 'yourAdminUsername',
  password: 'yourAdminPassword'
};

client = client(options);

client.info().then(x => console.log(x.msg));

const container = {
  "container-id": "bgold",
  "release-id": {
    "version": "1.0",
    "group-id": "org.bgold.kieserver",
    "artifact-id": "bgold"
  }
};

client.containerAdd(container).then(x => console.log(x.msg));

const commands = {
  "commands": [
    { "insert": { "object": "testCommand" } },
    { "fire-all-rules": {} }
  ]
};

client.executeCommand('containerID', commands)
.then(x => console.log(x))
.catch(error => console.log(error));

You can use to

  • Verify the server status.
  • List, add, delete containers.
  • Execute commands.
  • View and update release.
  • View and update scanner.

Contributing

Please read the contributing guide