Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. # multi-layer-dss
  2.  
  3. A npm package that builds a multi-layered Decisión Support System (DSS) for Node.js.
  4.  
  5. This package makes use of three core clases: Flow, Layer, Rule; written in TypeScript and builded to JS.
  6.  
  7. * A Flow is the complete system. It contains Layers and a "resolve" function (Coded by the user) receiving all Layers results. Flow.execute receives the Object to pass the Flow.
  8. * A Layer contains related Rules and a "resolve" function (Coded by the user) receiving all Rules of this Layer and the Object. "resolve" should call the "resolve" function of each Rule.
  9. * A Rule contains any number of "conditions" as functions that receive the Object and should return a boolean, a "content" of any type, a number "weigth" useful in it's "resolve" function, that also receives the Object.
  10.  
  11. ## Installation
  12.  
  13. ```sh
  14. npm install multi-layer-dss --save
  15. ```
  16. ## Usage
  17.  
  18. ### Commands
  19. * Run EsLint test:
  20. >>
  21. ```sh
  22. npm run lint
  23. ```
  24.  
  25. * Run Mocha test (If builded):
  26. >>
  27. ```sh
  28. npm run test
  29. ```
  30.  
  31. * Build JS:
  32. >>
  33. ```sh
  34. npm run build
  35. ```
  36.  
  37. * Make use of 'debug.js':
  38. >>
  39. ```sh
  40. npm run debug
  41. ```
  42. ### Code example
  43.  
  44. ```javascript
  45. var mldss = require('multi-layer-dss');
  46. var flow = mldss.Flow;
  47. var layer = mldss.Layer;
  48. var rule = mldss.Rule;
  49. ```
  50.  
  51. #### Step by step
  52. You can also créate the Flow, his Layers and their Rules separately, using the "add" methods of each class.
  53.  
  54. #### JSO
  55.  
  56. ```javascript
  57. var x = new Foo();
  58. x.Bar();
  59. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement